[parted-devel] [PATCH] sun: initialize basic label fields

Jim Meyering jim at meyering.net
Fri Feb 19 16:20:21 UTC 2010


Karel Zak wrote:
> libparted completely ignores basic fields in the sun VTOC, then
> for example fdisk prints warnings for such labels:
>
> 	# fdisk -lu /dev/sdb
> 	Detected sun disklabel with wrong version [0x00000000].
> 	Detected sun disklabel with wrong sanity [0x00000000].
> 	Detected sun disklabel with wrong num_partitions [0].
>
> It seems that the current libparted sun support follows old Linux
> kernel code, but the code was changed 3 years ago (see kernel commit
> 3961bae0ac030a70ae2e0578270203889021f1a1).
>
> Linux kernel also uses version, sanity magic and nparts to check
> Sun VTOC usability. (Fortunately, it's able to work with old
> (zeroized) VTOC too.)
>
> Note that the number of partitions (nparts) is optional for Linux
> kernel, but fdisk(8) strictly requires SUN_DISK_MAXPARTITIONS (=8)
> there. This patch sets nparts to SUN_DISK_MAXPARTITIONS rather then
> use a real number of partitions.

Hi Karel,

Thanks for the patch!
I assume that the patched parted would produce a sun partition
table that no longer provokes warnings from fdisk.

Would you please add a NEWS entry?
If it's not too much to ask, would you also add a test
that fails when using the unpatched parted, but succeeds
with the new version?  I.e., create a sun partition table
in a file and use od to extract and confirm presence of the new values.

Good timing, by the way.
I'm expecting to make the parted-2.2 release early next week.
This is the third patch in my queue: before it are the ones
from Hans De Goede and Curtis Gedac.



More information about the parted-devel mailing list