How to back up restore and view hard disk MBR and partition table under Linux

Source: Internet
Author: User

The Master boot record (master boot RECORD,MBR) is located on a hard disk with 0 cylinders, 0 disk faces, and 1 sectors, total 512 bytes. The specific divisions are: Boot code area 440 bytes, disk signature 4 bytes, white space (Ox0000) 2 bytes, MBR partition table (Disk Partition table,dpt) 64 bytes, end flag (OX55AA) 2 bytes. The MBR partition table (DPT) differs from another "Globally unique identity partition table (GUID Partition table,gpt)". This article discusses only MBR and DPT today.

Needless to say, the following first describes how to back up, restore MBR and DPT:

Backup/restore HDD MBR (all 512 bytes):

#备份 #  DD if=/dev/sda of=/mbr.bak bs=512 count=1# Recovery #  DD If=/mbr.bak OF=/DEV/SDA bs=512 count=1

Partition Table DPT (after 66 bytes) for backup/restore only disks:

#备份 #  DD if=/dev/sda of=/dpt.bak bs=1 skip=446 count=66# Recovery #  DD if=/dpt.bak OF=/DEV/SDA bs=1 seek=446 count=66

Recover only the boot code portion of the hard disk mbr (first 446 bytes):

#恢复 #  DD if=/mbr.bak OF=/DEV/SDA bs=446 count=1

After you have backed up the MBR, you can use the OD command to view the contents of the backed up MBR. The command is as follows:

[Email protected]/]# od-x Mbr.bak
0000000 48eb 1090 d08e 00BC b8b0 0000 d88e c08e
0000020 befb 7c00 00bf b906 0200 a4f3 21ea 0006
0000040 be00 07be 0438 0b75 c683 8110 fefe 7507
0000060 ebf3 b416 b002 bb01 7c00 80b2 748a 0203
0000100 0080 8000 615a 0000 0800 90FA f690 80c2
0000120 0275 80b2 59ea 007c 3100 8ec0 8ed8 bcd0
0000140 a0fb 7c40 ff3c 0274 c288 f652 80c2
0000160 5474 41b4 aabb cd55 5a13 7252 8149 55FB
0000200 75aa a043 7c41 c084 0575 e183 7401 6637
0000220 4c8b be10 7c05 44c6 01ff 8b66 441e c77c
0000240 1004 c700 0244 0001 8966 085c 44c7 0006
0000260 6670 c031 4489 6604 4489 b40c cd42 7213
0000300 bb05 7000 7deb 08b4 13cd 0a73 c2f6 0f80
0000320 f084 e900 008d 05be c67c ff44 6600 c031
0000340 f088 6640 4489 3104 88d2 c1ca 02e2 e888
0000360 f488 8940 0844 c031 d088 e8c0 6602 0489
0000400 a166 7c44 3166 66d2 34f7 5488 660a d231
0000420 f766 0474 5488 890b 0c44 443b 7d08 8a3c
0000440 0d54 e2c0 8a06 0a4c c1fe d108 6c8a 5a0c
0000460 748a bb0b 7000 c38e db31 01b8 cd02 7213
0000500 8c2a 8ec3 4806 607c b91e 0100 db8e f631
0000520 ff31 f3fc 1fa5 ff61 4226 be7c 7d7f 40e8
0000540 eb00 be0e 7d84 38e8 eb00 be06 7d8e 30e8
0000560 be00 7d93 2ae8 eb00 47fe 5552 2042 4700
0000600 6f65 006d 6148 6472 4420 7369 006b 6552
0000620 6461 7245 6f72 0072 01bb b400 cd0e
0000640 ac10 003c f475 00c3 0000 0000 0000 0000
0000660 0000 0000 0000 0000 5dd6 0001 0000 2080
0000700 0021 9f83 1906 0800 0000 4000 0006 9F00
0000720 1907 8383 16ed 4800 0006 8000 00BB 8300
0000740 16ee fe82 ffff c800 00c1 0000 0040 9800
0000760 1b3e d405 32a2 c800 0101 3800 017e Aa55
0001000
[Email protected]/]#

How to back up restore and view hard disk MBR and partition table under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.