[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reading cfdisk partitioned drives

From: Matt Davis
Subject: Reading cfdisk partitioned drives
Date: Sat, 26 May 2007 19:43:04 -0400

I have been wanting to contribute code to an OSS project for sometime,
and I have been assigned Ticket #14 to tackle.


Anyways, I setup a qemu virtual drive along the specs of what the
ticket had (mainly 80GB) with 4 primary partitions.   I created those
partitions via cfdisk on a debian.iso from qemu.

The oddity that I have have seen, and I am not sure if this is what is
causing the funky-ness in #14, but fdisk/cfdisk both read the fs_type
from the disk properly.  In my case (using parted 1.8.7), bootsector.c
is reading the first 512 bytes of the Fat16 partition starting at 63.
Parted, and I have confirmed this via gdb, does not see a boot sector
signature starting at those partition offsets, thus when I run parted
on the drive I get output with proper drive sizes but no file system
information for those drives.  Further, to see if there was any data
on that boot sector at all, I performed:
`dd if=/dev/hda1 of=boot bs=512 count=1`  And the boot sector was all
zeroed out.  Either way that's far off from the 0xAA55 that a fat16
should have.  But that still does not explain why fdisk and cfdisk
report the fs_types properly.  I assume they are just grabbing those
values from the MBR and not the actual boot sector of the hard drive
(as parted is doing).

My question:  Should parted continue to obtain file system type
information from the boot sector of that partition or from the MBR, as
stated above it seems as if fdisk/cfdisk both query the MBR?  In any
case fdisk/cfdisk must not have placed any data on the actual boot
sectors for the partitions they created.    I will continue to work on
bug 14, but right now I have yet to actually replicate the issues on
the ticket.  I hope someone can provide me further lead-way so that I
can be of some asset to this project :-)

-Matt (Enferex)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]