backup and restore boot partition
what is the best way to backup and restore boot partition.
using lvm snapshots is not right way as it doesnt deal with MBR. tried using tar but cudnt make it successfull. Please let me know if you have known any? Thanks, Ajay |
Hi.
If you ask how to backup/restore MBR, then `dd' is your friend: Backup: Code:
dd if=/dev/sda of=mbr.bin bs=512 count=1 Code:
dd if=mbr.bin of=/dev/sda bs=512 count=1 |
thanks
thanks for reply
sfdisk should not be used for partitions, its mainly for disks. for dd it looks to be better option, but my problem was backing up whole partition(with MBR) not just the MBR. please let me know if anybody has done it successfully. |
The MBR is not part of any partition.
For LVM you would be better concentrating on maintaining a good backup of the LVM metadata - see "man vgcfgbackup". |
You mention the /boot partition. I'm assuming boot is it's own filesystem and not in a logical volume. You just use tar to get this data. If you lost the system I assume you'll be rebuilding the partition table anyway. From a rescue disk you could 1) build the partition table, 2) restore /boot from the tar 3) rebuild the rest of the system from your snapshots, 4) do a chroot and re-run grub install to re-install the boot loader in the mbr. I've done this successfully a few times when moving a system to new hardware.
If you just want to preserve the mbr, I agree with fistfire. |
All times are GMT -5. The time now is 08:06 AM. |