Disk partition table backup, deletion and recovery
Partition table backup
? The MBR partition table is stored in the 0th sector of track 0 of the hard disk, a total of 512 bytes, the first 446 bytes It is the bootloader, the middle 64 bits are the disk partition table information, each partition information occupies 16 bytes, and it is stored in 4 partitions in total.
? Check the hexadecimal file of the hard disk, among the first 512 bytes of the hard disk, the 64 bytes from 2080 to aa55 is the disk partition table we need to back up
Backup
- < li>Use the dd command to back up the information of the hard disk partition table
- Check the backed up data to ensure correctness.
- will be backed up Transfer the file to a remote host, or copy it to a USB flash drive for backup.
- Log in to the remote host , And review the data to ensure consistency.
Clear the disk partition table
- Use the dd command to clear the 64 bytes after the 446 bytes
- View the data after emptying
- The disk partition is damaged, restarting will not be able to enter, the system error message shows that there is no disk
Restore data
- Disconnect the power and restart, and quickly press the Esc key to select the disc mode
- Select Troubleshooting
- Select Rescue a CentOS system to enter rescue mode
- Select 1 Continue, press Enter to select default Recognize SHELL
- this When the host does not have a network address, so you need to configure the host with a network address
- From the remote host, copy the backup file to the local
- Use the dd command to restore the backup partition table data to /dev/sda and restart the system
- The system starts normally, and the /dev/sda data is successfully restored
< img alt="Disk partition table backup, deletion and recovery" src="/wp-content/uploads/images/hardware/network-card/1626799164707.png" >