Ubuntu Backup of MBR / Grub Config

Hi,

I have a dual boot Windows 10 / Ubuntu system. I have Windows installed one drive C: a second data NTFS parition on Drive D: the second hard drive. for the remaning logical drives on that disk I have Ubuntu. Sorry I cant remember the exact term.

Anyway I know with clozilla I can backup partitions and disks. My question is there a way I can backup just the MBR and Grub config. So I can keep my windows and ubuntu backups seperate. Or is the only way to get the Grub info to backup the C: partition / drive.

Also where is the Grub config stored?

Thanks,

Ward
LVL 1
whorsfallAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dfkeCommented:
Hi,

You can always chroot into your broken Ubuntu and reinstall the GRUB, read more about that here:
https://help.ubuntu.com/community/Grub2/Installing

Please note that the following commands can be pretty dangerous so be aware of what you are doing !

However here is what you can do:

Get a backup from MBR:

sudo dd if=/dev/sda of=/home/user/mbr bs=512 count=1

Get a backup from files within the /boot directory. It's not really necessary, you can only get a copy of /boot/grub/grub.cfg it's the file containing the menu entries etc..

Note that /dev/sda is the first hard disk where my grub has been installed on for you it might be  /dev/sdb or something else.
When ever you break your system's GRUB (Mostly because of a broken MBR), you can easily boot into a Live system and restore your MBR using:

sudo dd if=/home/usr/mbr of=/dev/sda

And voila your MBR with a working grub is back. You can also use your backup from /boot to restore anything else that might be corrupted.


Cheers

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.