Thread: [Clonezilla-live] How to recover partition table w/out restoring rest of disk?
A partition and disk imaging/cloning program
Brought to you by:
steven_shiau
From: Kevin W. W. <kev...@gm...> - 2009-08-06 03:25:19
|
Months back I used Clonezilla-live (1.2.2.something) to do a full image backup of an internal hard drive to an external USB hard drive. The internal disk was Linux-only and had a separate boot partition w/ MBR. File systems were all either ext2 (boot partition) or ext3 or swap. Running OpenSUSE 11.0 if that matters. Weeks ago, my son power-cycled the PC and it seems to have caused the the partition table to have been completely wiped and unfortunately, I don't have a hard copy of it anywhere. Am unable to check the file systems via fsck but have been able to successfully mount of few of the file systems (read-only just in case) and the data itself seems to be intact. Since it's been months since my latest backup (my bad; I figured I could get away w/ it since it's only used by my son playing BZFlag and developing BZFlag maps), I'd prefer not to simply restore the disk image, but rather would like to use the Clonezilla-live saved image from my USB drive to ONLY RESTORE THE PARTITION TABLE, but NOT any of the partitions. Any pointers (URLs are fine if you point to the right section) of how to do this? I read something about a '-j0' option to restore partition table, but it says not to use if I have logical drives and I don't recall if this OpenSUSE was installed / configured using LVM or not. (It's was an upgrade from OpenSUSE 10.1 which was build using a custom partitioning scheme.) Is there a way to tell if it was using LVM and logical partitions? And if it was, what then? I could just restore the whole drive and my son will be SOL wrt his BZFlag maps. My only "punishment" would be to have to do all the OpenSUSE updates again and put up with my son castigating me for not doing more regular backups. (Something I told HIM to do which is why I gave him a USB thumb drive.) Anyway, any help would be appreciated. TIA, -kevin -- Kevin W. Wall "The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents." -- Nathaniel Borenstein, co-creator of MIME |
From: Jorge F. <jor...@gm...> - 2009-08-06 11:41:44
|
On Wednesday 05 August 2009 07:25:02 pm Kevin W. Wall wrote: > ONLY RESTORE THE PARTITION TABLE, but NOT any of the partitions. It's been a while since I used Clonezila but if I remember correctly, when you perform the cloning...in the directory where the actual image is stored, there will be a file called sda-mbr (assuming sda drive). That's the Master Boot Record (first 512 bytes of drives) and the last 64 bytes there contains the actual partition table. You need to boot with a Live CD (I guess you can use Clonezilla and bring up the shell) and do this: # If you have a USB jump drive put in...so we can backup the current MBR # just in case... dd if=/dev/sda of=/mnt/usbdrive/sda-crippled.mbr bs=512 count=1 # Now we're going to try to restore the actual partition table. I would # restore the whole MBR but here's this way to restore ONLY the p.table DISCLAIMER: You use this at entirely your own risk! cd /to/original/backup/directory/ dd if=sda-mbr of=/dev/sda bs=1 count=64 skip=446 seek=446 If you want to restore the whole MBR: dd if=sda-mbr of=/dev/sda bs=512 count=1 HTH, Jorge |
From: Steven S. <st...@nc...> - 2009-08-07 15:25:07
|
Hi Kevin, There is a partition table file in the image dir, e.g. http://clonezilla.org/clonezilla-live/doc/showcontent.php?topic=02_Restore_disk_image the file "hda-chs.sf" is the partition table for hda, and its format is for sfdisk. Therefore you can manually restore the partition by: sfdisk /dev/hda < hda-chs.sf //NOTE// sfdisk is a very powerful tool, which means it might make all your data on the disk disappear. Therefore use it very carefully. BTW, there is a tool called "testdisk" included in the Clonezilla live. It's also a good to "guess" and recovery the lost partition table. You can try it, too. Good luck. Steven. Kevin W. Wall wrote: > Months back I used Clonezilla-live (1.2.2.something) to do a full image > backup of an internal hard drive to an external USB hard drive. The internal > disk was Linux-only and had a separate boot partition w/ MBR. File systems were > all either ext2 (boot partition) or ext3 or swap. Running OpenSUSE 11.0 if that > matters. > > Weeks ago, my son power-cycled the PC and it seems to have caused the the > partition table to have been completely wiped and unfortunately, I don't have > a hard copy of it anywhere. Am unable to check the file systems via fsck > but have been able to successfully mount of few of the file systems (read-only > just in case) and the data itself seems to be intact. > > Since it's been months since my latest backup (my bad; I figured I could > get away w/ it since it's only used by my son playing BZFlag and developing > BZFlag maps), I'd prefer not to simply restore the disk image, but rather > would like to use the Clonezilla-live saved image from my USB drive to > ONLY RESTORE THE PARTITION TABLE, but NOT any of the partitions. > > Any pointers (URLs are fine if you point to the right section) of how to > do this? I read something about a '-j0' option to restore partition table, > but it says not to use if I have logical drives and I don't recall if > this OpenSUSE was installed / configured using LVM or not. (It's was an > upgrade from OpenSUSE 10.1 which was build using a custom partitioning > scheme.) Is there a way to tell if it was using LVM and logical partitions? > And if it was, what then? > > I could just restore the whole drive and my son will be SOL wrt his > BZFlag maps. My only "punishment" would be to have to do all the > OpenSUSE updates again and put up with my son castigating me for > not doing more regular backups. (Something I told HIM to do which > is why I gave him a USB thumb drive.) > > Anyway, any help would be appreciated. > TIA, > -kevin > -- Steven Shiau <steven _at_ nchc org tw> <steven _at_ stevenshiau org> National Center for High-performance Computing, Taiwan. http://www.nchc.org.tw Public Key Server PGP Key ID: 1024D/9762755A Fingerprint: A2A1 08B7 C22C 3D06 34DB F4BC 08B3 E3D7 9762 755A |