Discuss about the plans: what features to add, how to develop, ...

Moderator: feffer

Post Reply
Posts: 2
Joined: Wed May 02, 2007 3:13 am


Post by brokndodge » Sat May 12, 2007 5:23 am

I have a small feature request. I am currently using partimage to clone harddrives. I have found that partimage is missing a rather obvious feature. There is not a method to tell partimage which device to restore the MBR to. The current partimage only allows for the following command.

Code: Select all

partimage restmbr /mnt/source/clone.gz.000
the command that I need would be structured something like this

Code: Select all

partimage -b -B=foo restmbr /dev/hdd /mnt/source/clone.gz.000
the above command would be structured much like the command to restore the filesystem but would instead restore the mbr. the first string after "restmbr" would tell partimage which device the work is to be performed on. The second string after "restmbr" would tell partimage where the image file is stored.

I was kinda confused that partimage didn't already supprt this command. Anyway I have moved past the confusion. It would be a nice feature to see in the future.


Posts: 2
Joined: Thu Nov 08, 2007 8:08 am

Post by bdcnesfr » Thu Nov 08, 2007 9:47 am

I also am interested in such a feature
I am using PI distributed with the System Rescue CD and by default it seems that

Code: Select all

partimage -b restmbr /path/to/sda.img
writes to /dev/loop0.

At least is it what it looks like when launching the previous command without the "-b" switch

Posts: 1
Joined: Tue Jul 15, 2008 4:17 pm

Post by a_pirard » Tue Jul 15, 2008 5:09 pm

I do love Partimage, thanks. Here's my 3.2 cents (Euro) :

The discussion above is about "where" the MBR is restored, surprizingly not well defined making restmbr look like a very dangerous command to try.
Another matter is "what" the MBR is.
As explained on these web pages, the "original" MBR (512 bytes) contains tiny boot code and defines the primary partitions (it's great to know that, for a disk using only primary partitions, restoring the MBR is equivalent to repartitioning).
But as mentioned too, the MBR has also evolved to (be longer and) contain boot code and data for programs like GRUB, which are just as important to restore as the original boot record.

It would be nice that Partimage saved and restored the whole of that MBR whose size could be defined as, unless otherwise specified by a parameter, the sectors starting at the partition table record up to the beginning of the first partition but limited to one track. It would save the user to make a wrong computation and overwrite is first partition.

Extended partitions is an extended but welcome subject.

Posts: 2
Joined: Thu Oct 08, 2009 4:28 pm

Possible solution

Post by Houchy » Thu Oct 08, 2009 4:51 pm

I found the following commands on another forum, do you think it will work?

To save MBR

Code: Select all

sudo dd if=/dev/sda of=/mnt/bkp/sda-mbr.bin bs=512 count=1

To restore MBR

Code: Select all

sudo dd if=/mnt/bkp/sda-mbr.bin of=/dev/sda
Thanks for your help

Post Reply