It is a good idea to save the MBR (Master Boot Record) of a Linux installation. We're going to use just the 'dd' command. First find out the start device which is in the most cases the first one. fdisk may give you the information.
Disk /dev/mapper/luks-b63e511d-f534-4629-b2f8-c15b1faf20f0 doesn't contain a valid partition table
Disk /dev/mapper/vg_oc1878585214-lv_root doesn't contain a valid partition table
Disk /dev/mapper/vg_oc1878585214-lv_swap doesn't contain a valid partition table
Disk /dev/mapper/sdb1_crypt doesn't contain a valid partition table
Disk /dev/sda: 240.1 GB, 240057409536 bytes
Disk /dev/sdb: 320.1 GB, 320072933376 bytes
Disk /dev/mapper/luks-b63e511d-f534-4629-b2f8-c15b1faf20f0: 239.5 GB, 239529361408 bytes
Disk /dev/mapper/vg_oc1878585214-lv_root: 230.8 GB, 230820937728 bytes
Disk /dev/mapper/sdb1_crypt: 320.1 GB, 320068191232 bytes
In this case it seems to be the device 'sda'. Backup the MBR and check the created image.
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00339408 s, 151 kB/s
mbrsda.img: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, boot drive 0x80, 1st sector stage2 0x518e, GRUB version 0.94; partition 1: ID=0x83, active, starthead 32, startsector 2048, 1024000 sectors; partition 2: ID=0x83, starthead 221, startsector 1026048, 467834880 sectors, code offset 0x48
After booting a "live linux CD" you could restore the MBR:
DANGER: To delete or overwrite the MBR (the bootcode AND the partitiontable!) with "zero's" type in:
The post Linux: Save the MBR appeared first on Linux on the mainframe.