0

I know how to use dd to backup the boot record of a MBR partitioned disk, but how do I backup the boot record of a GPT partitioned disk?

(I use sgdisk to backup the partition table, but also need the boot record)

I'm looking for the GPT equivalent of (MBR backup):

dd if=/dev/sda of=/dev/sdb bs=512 count=1
2

If you used the --backup option to the sgdisk program to create the backup, it already contains all there is to back up: the "protective MBR", the GPT header, and the partition table. There is no boot record in addition to these on GPT partitioned disks.

  • Could you expand on that? In particular, MBR contains a "boot sector" to bootstrap the PC. Doesn't a GPT partitioned disk also need a "boot sector" to bootstrap the PC? If not how is that handled? – TSG Jan 1 '18 at 19:56
  • On a UEFI system, the machine starts by executing code in the firmware (i.e. in ROM on the motherboard). This code is smart enough to look for the ESP (EFI System Partition), and it also knows how to read and execute files from the ESP, directed by variables stored in non-volatile memory. Thus there is no "boot sector", it's all in normal files on the disk. In the rare combination GPT disk + legacy BIOS boot, the boot code is read in the old-fasioned way from the MBR. – Johan Myréen Jan 1 '18 at 20:04
  • So a non-UEFI bios would need a protective MBR on the GPT disk in order to book that disk? (In which case the above 'dd' method of copying the MBR is required)? – TSG Jan 1 '18 at 20:33
  • If you use gdisk's backup command, it includes the MBR in the backup. Also note that using legacy BIOS (CSM) mode together with GPT is not something that is usually done, and can be risky. – Johan Myréen Jan 1 '18 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.