I have an MBR formatted sd card and when connect to a Linux machine (xubuntu 12.04) it can mount a partition and parse the file system (as can GParted). However, when I try to read the MBR from the device using dd it gives me a bunch of spurious data.
Could anyone shed any light into how Linux/GParted is able to read and make sense of the MBR when dd isn't able to read the MBR. Do they use different methods to get at the data? I.E not open(), read()
DD command is:
dd if=/dev/sdb of=mbr.bin bs=512 count=1
DD output is:
1+0 records in
1+0 records out
512 bytes transferred in 0.000786 secs (651345 bytes/sec)
mbr.bin dump with hexdump -C mbr.bin
is:
00000000 04 16 41 53 4d 49 2d 53 44 03 00 00 00 00 16 f1 |..ASMI-SD.......|
00000010 00 7f 00 32 1f 5b 80 00 36 db bf bf 96 c0 00 01 |...2.[..6.......|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 6f 00 00 10 00 00 02 2e 00 00 00 00 00 00 00 00 |o...............|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200
Best Answer
The card does not have a Master Boot Record (MBR). If it had your hexdump would have given you at least one partition entry at offset
0x1C0
and55aa
at the end.Not all partition tables lay out data in the first 512 bytes. The spurious data you see is SID and CSD register of (a / the) SD card. But from the looks of it, it is not the correct data for the card (unless it is an old 1 MiB 2001 model.)
First 16 bytes are:
Next 16 bytes (at least part of it):
Also, the CRC7 check for CSD register is wrong. It could be old data left from a pastime.
Those registers and more can be queried from the card directly by various commands. This is done by module drivers, card hubs, etc.
Would be interesting to see what you find by the commands given by Stephane Chazelas, slm etc.