Archived discussions regarding the Stand-Alone-Tools

Backup of Linux Harddisk

Post by chris » Mon Aug 06, 2007 12:04 pm

I backuped my Linux Harddisk consisting of 3 partitions (/swap, /root and /home) with HDClone Prof. 3.25 to a larger partition on an external USB drive and now have problems with restoring the partition(s) to another identical harddisk. Harddisk is not bootable and some tools say that partitions are overlapping. Any ideas? Thanks, Chris.
chris
 

Re: Backup of Linux Harddisk

Post by Alex » Mon Aug 06, 2007 12:15 pm

Depending on how you did your backup, there might be several reasons for that:

If you used disk-to-disk copy, the entire content of the disc, including the partition table has been copied to the other disk. You write that you have copied it to a larger "partition", which makes me wonder if you used disk-to-partition copy. In this case, to reverse this, you should use partition-to-disk copy to grab the entire contents of the first disk (which is contained in the partition of the second disk) and copy it again on a new (third) disk.

If you proceeded that way, your hard disk layout may vary and thus creating problems with the bootability.

Under linux you can use fdisk -l /dev/hdxxx to display the partition layout and see if there are any overlapping partitions. Please attach a sample output in order to track down this issue.
Alex
Site Admin
 
Posts: 527
Joined: Thu Apr 14, 2005 7:21 pm

Re: Backup of Linux Harddisk

Post by chris » Mon Aug 06, 2007 1:00 pm

Backup: disk(1)-to-partition(usb)
Restore: partition(usb)-to-disk(3)

So your advice is to do:
partition(usb,/swap)-to-disk(3)
partition(usb,/root)-to-disk(3)
partition(usb,/home)-to-disk(3)

Correct? In that case how to find (/swap, /root and /home) partition on USB-Partition?
chris
 

Re: Backup of Linux Harddisk

Post by Alex » Mon Aug 06, 2007 1:36 pm

This is a bit tricky, but it can work.

Since you copied the entire disk into one partition (you can think of it like making an image of a disk and saving it into a file), the easiest way to get the partitions out of the containing partition is to copy the containing partition to the disk (as indicated by your Restore-line).

This done, fdisk or any other program should show you the new disk with the intact partition layout as it was on the primary source disk.

So you don't have to find /swap, /root and /home on the USB partition (though there's a way:

If e.g. you have copied your disc with HDClone into Partition 3 of the USB disc (say /dev/usb), then you want the contents of usb3 (which is Partition 3 of usb) to be treated as a disc. You can already start fdisk, but you must pass it the cylinder number from the original disc (e.g. 592).

then the call:
# fdisk -l -u -C 592 /dev/usb
will print out the partitioning of the stored image, e.g.:
Disk /dev/usb3: 0 MB, 0 bytes
255 heads, 63 sectors/track, 592 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/usb31 * 63 7438094 3719016 7 HPFS/NTFS
/dev/usb32 7438095 9510479 1036192+ 5 Extended
/dev/usb35 7438158 7695134 128488+ 82 Linux swap
/dev/usb36 7695198 9510479 907641 83 Linux

Then you can mount your Partition with the following command:
mount -o loop,offset=32256 /dev/usb1 /mnt

where 32256=63 (starting sector of the Partition) * 512 (size in bytes of a sector).



Still I don't think you have to go through all of this, simply restoring it to the new disk (3) should do the job.
Alex
Site Admin
 
Posts: 527
Joined: Thu Apr 14, 2005 7:21 pm


Who is online

Users browsing this forum: No registered users and 5 guests