Thursday, September 14, 2017

How can I backup and restore MBR via dd command?

Check device name of HD:
# lsblk








Backup MBR:
# dd if=/dev/sda of=file bs=1 count=512




Note:
1. The size of MBR is 512 bytes and located in the first sector.
2. Of cause you need to save MBR backup file somewhere else.

Restore MBR:
# dd if=file of=/dev/sda bs=1 count=512


No comments: