tlu
November 15th, 2009, 08:20 AM
One disadvantage of Clonezilla is that you can't restore specific files/directory from the image (as far as I know). The tool kpartx should overcome this problem: It should be possible to mount the image file as a device. So it would be easy to, e.g., copy specific files back to your HD.
The basics can be found on http://equivocation.org/node/107 . Let's say you have an image file called image.img on an external USB disk.
In order to list the partitions in that image file you would execute
sudo kpartx -l /media/disk/image.img
In order to find the next available loopback device execute
sudo losetup -f
and you'll probably get /dev/loop0
With
sudo losetup /dev/loop0 /media/disk/image.img
the device /dev/loop0 is mapped to the image file. The following steps (how to mount this device) can be found in the link above.
The problem: Neither the first nor the third step work on my system. My image is called 2009-10-01-14-img.
sudo kpartx -l /media/disk/2009-10-01-14-img
results in
-{ Quote: "Missing major number for persistent device.
Couldn't create ioctl argument.
Missing major number for persistent device.
Couldn't create ioctl argument.
last_lba(): I don't know how to handle files with mode 41ed
read error, sector 0
read error, sector 1
read error, sector 29
Missing major number for persistent device.
Couldn't create ioctl argument." }-
and
sudo losetup /dev/loop0 /media/disk/2009-10-01-14-img
results in
-{ Quote: "media/disk/2009-10-01-14-img: Is a directory" }-
But Clonezilla always saves an image as a directory and not as a file, doesn't it? So how can I use kpartx and losetup if they expect a single file?
I might be missing something very easy and obvious. Any idea?
The basics can be found on http://equivocation.org/node/107 . Let's say you have an image file called image.img on an external USB disk.
In order to list the partitions in that image file you would execute
sudo kpartx -l /media/disk/image.img
In order to find the next available loopback device execute
sudo losetup -f
and you'll probably get /dev/loop0
With
sudo losetup /dev/loop0 /media/disk/image.img
the device /dev/loop0 is mapped to the image file. The following steps (how to mount this device) can be found in the link above.
The problem: Neither the first nor the third step work on my system. My image is called 2009-10-01-14-img.
sudo kpartx -l /media/disk/2009-10-01-14-img
results in
-{ Quote: "Missing major number for persistent device.
Couldn't create ioctl argument.
Missing major number for persistent device.
Couldn't create ioctl argument.
last_lba(): I don't know how to handle files with mode 41ed
read error, sector 0
read error, sector 1
read error, sector 29
Missing major number for persistent device.
Couldn't create ioctl argument." }-
and
sudo losetup /dev/loop0 /media/disk/2009-10-01-14-img
results in
-{ Quote: "media/disk/2009-10-01-14-img: Is a directory" }-
But Clonezilla always saves an image as a directory and not as a file, doesn't it? So how can I use kpartx and losetup if they expect a single file?
I might be missing something very easy and obvious. Any idea?