8 years ago
Thank-you for your support on this suggestion to update the Linux-Mint Rescue Disk feature.
Coders should include the following direct disk (DD) features/commands:
Linux Mint Terminal Commands to determine which drive devices are designated, bootable and which partitions carry your linux or other OS systems:
sudo fdisk -l
sudo fdisk -l -u
To Save the MBR to a file (this contains the partition table too):
sudo dd if=/dev/sda1 of=sda1-mbr-full bs=512 count=1
To Save the MBR, without the partition table, to a file:
sudo dd if=/dev/sda1 of=sda1-mbr-nopart bs=446 count=1
To Restore the MBR plus the main Partition Table:
sudo dd if=sda1-mbr-full of=/dev/sda1 bs=512 count=1 (RESTORE Entire Master Boot Record Plus Partition Table)
To Restore only the Master Boot Record (MBR):
sudo dd if=sda1-mbr-nopart of=/dev/sda1 bs=446 count=1 (Restore Only Master Boot Record Not Including the Partition Table)
Linux sfdisk command can also quickly and easily make a backup of the primary and extended partition table as follows. It creates a file that can be read in a text editor, or this file can be used by sfdisk to restore the primary/extended partition table.
To back up the Linux Mint based disk Partition Table /dev/sda, enter:
sudo sfdisk -d /dev/sda > /tmp/sda.bak
To Restore the Linux Mint based disk Partition Table on /dev/sda, enter:
sudo sfdisk /dev/sda < /tmp/sda.bak
Note: Adjust the actual drive/device to what you find with the sudo blkid,
sudo fdisk -l or sudo fdisk -l -u output.
The tiny size files these backup's of the MBR really makes it a no excuse to fully use them. A quick backup of the MBR for a WinX-Linux dual boot BEFORE Grub modify's the MBR is quick and cheap insurance that user won't blow up their Windows partition boot information. AFTER Grub is successfully installed, the corresponding MBR and Partition Table files again are very small in size yet utterly priceless in regards to backups.
I suggest these scripted tools all be made fully available for the new Linux Mint installers and experienced users to safeguard their systems. Should their bootloader get corrupted, in a matter of moments, the MBR can be restored, same with the entire partition tables should they become corrupted.