An explanation of the MBR records for disks in Linux

Source: Internet
Author: User

On the hard disk, the hard disk 0 cylinder 0 Head First 1 sector is called the main boot sector, also known as the master boot Record -mbr (main boot recording), where the MBR is the following three parts of the composition

1,Bootloader, master boot program---446 bytes

2.Dpt (Disk Partition table), hard disk partition table---64 bytes

3, sector end sign (55AA)--2 bytes

A total of 512 bytes, the first 446 bytes is the master boot record, is the BIOS power-on self-test to run after the code, the middle 64 bytes is a partitioned table.

In simple terms MBR=BOOTLOADER+DPT (64) + END sign (55AA). where the DPT disk partition table (64 bytes, each 16 bytes is a group, altogether 4 groups ),

So what if we get the MBR of a disk in a Linux system? It is not difficult, we can get through the DD command, as shown in:

When we get the MBR of the disk in the Linux system, can we go to see it, here I introduce three ways to view the contents of MBR

Method One, use the Hexdump command to view

[[email protected]5201351 ~]# hexdump-c mbr.bin       // Total 33 rows, 32 rows *16 bytes, ending at 55AA

-c displays the corresponding ASCII code in bytes per unit
-c per unit in bytes with 16 mechanism and ASCII code displayed

----------------------------------------------------------------------------------------------------
Method Two, in the VIM command mode input :%!xxd is to convert the former text to 16 binary format.

This method 55AA after the end of a row, the content of 0a, for the content of the author is unclear

----------------------------------------------------------------------------------------------------
Method Three, using the OD command to view

[[email protected]5201351 ~]# od-x mbr.bin      // Total 33 rows, 32 rows *16 bytes

But this is not the same as the output of the previous 2 methods, because he ends with a aa55, notice that this method to see each group of two byte swap position to see

such as Aa55 on the hard disk storage is actually 55AA, after the Internet query said is the reason for Little-endian, here is not more explored.

An explanation of the MBR records for disks in Linux

Related Article

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.