Page 1 of 1

[SOLVED] How do I backup grub2 prior to a windows 7 install

PostPosted: May 10th, '14, 22:26
by akbrian
I would like to install Windows 7 on my unused sda2 partition.

sda1 /boot
sda2 unused and existing, windows 7 target
sda5 /
sda6 /home
numerous other logical partitions follow...

I'm currently using mageia's version of grub2. I probably should have stuck to legacy grub, but thought grub2 would be more compatible with other current distros I try out on my test "beta" partitions. I've never dealt with win7 before, but I'm "assuming" it carries on the XP tradition of writing over any existing boot manager. In the past I'd boot the mageia install dvd after a windows install and reinstall grub or lilo using the rescue gui. Does the rescue gui support grub2 ? Google shows me that Ubuntu has a tool on their live CD to reinstall a previously saved grub2 backup. Is there a similar Mageia 4 tool?

Before I install windows 7, what steps should I take to make the grub2 reinstall/restore the easiest, assuming it does get overwritten?

Re: How do I backup grub2 prior to a windows 7 install

PostPosted: May 11th, '14, 01:04
by linuxero
Of course you can always use the Mageia Insatllation Media to boot into rescue mode and I think you can recover GRUB2 from there easily..

In case you want to have a sure copy of your GRUB2 MBP you can save it as follows:

Code: Select all
# dd if=/dev/sda of=/PATH/TO/YOUR/STASH bs=440 count=1


Then after Windows 7 satisfactorily destroys your GRUB2 MBP you can boot into either rescue mode or a live session and rewrite it back as follows:

Code: Select all
# dd of=/dev/sda if=/PATH/TO/YOUR/STASH bs=440 count=1


You must be root, obviously!

After that you should reconfigure GRUB2 in order for you to boot Windows ;)

Re: How do I backup grub2 prior to a windows 7 install

PostPosted: May 11th, '14, 10:08
by akbrian
Thanks for the help. I ended up doing a quick "upgrade" install with nothing to upgrade, so it just took a couple minutes. Then I reinstalled grub2 at the configure screen. It picked up Win 7 on it's own. The rescue gui "reinstall bootloader" on the Mageia 4 install disk didn't work for grub2, it failed with errors. I didn't see the response soon enough to do the elegant save a backup of grub solution, I'm embarassed to say. Thanks again, sorry for the delayed reply.