information in partition table with dd
I use dd to view MBR partition table on my computer that has 3 partitions. I can see all the information such as beginning blocks and size of each partition, where each of the partition has 16 bytes.
The cmd I use was $ dd if=/dev/sda bs=512 count=1 | od -x Now, I am try to use dd on each partition: sda1, sda2, and sda3. $ dd if=/dev/sda1 bs=512 count=1 | od -x What information is the partition table? Is it useful? I am trying to fix a problem with one of my partition disappear, but I want to understand what information is available first. Thank you in advance |
For primary partitions, all the relevant data is in the partition table in the first sector on the disk. Which you've already found.
There is no other pertinent (size) info in the partition itself. Logical partitions are a linked list, and a (pseudo) partition table does exist at the start of each (logical) partition. There are several references on the web, but are probably only of educational benefit if you are dealing with primary partitions. |
Here is a portion of the output from fdisk for my system (u option to display in sectors):
Code:
Device Boot Start End Blocks Id System Here is the dd command and output showing the partition table entry for sda6: Code:
[root@localhost mherring]# dd if=/dev/sda bs=512 skip=71569575 count=1|hexdump -C The offset to the start of the partition The offset to the partition table for the next partition. An extended partition is nothing more than an entry in a partition table pointing to the next logical partition. Thus there are actually multiple extended partitions in the example. Aren't you glad you asked?....;) |
pixellany ... Thank you so much.. This is very good information...
Howeve, I am a litte confused about what you did Quote:
Then I believe the information in the table will tell me where the /dev/sda7 is, right? if so, does the information is described with 16 bytes data as well? From the table it looks like it starts at 000001be, correct? In addition, from your example, the extended partition /dev/sda4 starts at 49142835 and end at 197503109, but the partition /dev/sda7 end at 110639654. Does it mean you still have some space left on your drive? Usually I would guess that the /dev/sda4 and /dev/sda7 will have the same end bytes. |
Quote:
Quote:
Quote:
Quote:
|
Try this post. It's a little long, but it's worth it.
http://www.linuxquestions.org/questi...ommand-362506/ |
All times are GMT -5. The time now is 04:33 PM. |