Get the App
SLTechnology News&Howtos  ›  Servers  › 

Backup, deletion, and recovery of disk partition tables

Shulou Source: shulou.com Published: 2022-06-03 05:05:32 09月21日 Update

The MBR partition table is stored in sector 0 of track 0 of the hard disk, with a total of 512 bytes. The first 446 bytes are bootloader, and the middle 64 bits are disk partition table information. Each partition information accounts for 16 bytes, and is stored in 4 partitions in total.  Looking at the hex file of the hard disk, in the first 512 bytes of the hard disk, starting from 2080 to 64 bytes before aa55 is the disk partition table we need to backup

Backup Use dd to back up information from the hard disk partition table

Check the backup data to make sure it is correct.

Transfer the backed up files to a remote host or copy them to a USB stick for backup.

Log in to the remote host and review the data to ensure consistency.

Empty the disk partition table Use dd to empty the 64 bytes following the 446 bytes

View data after emptying

Disk partition destroyed, reboot will not be able to enter, system error message shows no disk

Recover data Disconnect power to restart and quickly press Esc to select CD mode

Choose Troubleshooting

Select Rescue a CentOS system to enter rescue mode

Select 1 Continue, Enter to select default SHELL

At this time, the host does not have a network address, so you need to configure the network address for the host.

Copy backup files locally from a remote host

Use dd command to restore the backup partition table data to/dev/sda and restart the system

The system starts normally, and/dev/sda data is restored successfully.

Tags: Backup partition table bytes disk data host selection information hard disk command file system address data recovery mode network consistency success consistency CD Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Technology Xiaomi MariaDB MySQL