public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* Support for the new OpenBSD disklabel format
@ 2013-12-02 17:21 Nikos Skalkotos
  2013-12-10 10:32 ` Karel Zak
  0 siblings, 1 reply; 4+ messages in thread
From: Nikos Skalkotos @ 2013-12-02 17:21 UTC (permalink / raw)
  To: util-linux; +Cc: synnefo-devel

Hello all,

Lately, I've been evaluating all available solutions for manipulationg
*BSD disks from Linux and found out that none recognizes the new OpenBSD
disklabel format correctly. I ended up writing my own tool in python for
manipulating OpenBSD partitions.

parted, that is more script-friendly than fdisk, does not support
disklabels at all. Older fdisk versions (the ones that are shipped with
the major linux distos like Debian and Ubuntu) only check for FreeBSD
and NetBSD partition IDs (but not OpenBSD). Latest versions of fdisk
recognize disklabels on OpenBSD partitions but OpenBSD has changed the
disklabel format.

In order to support disks and partitions that are larger that 2TB, the
OpenBSD folks have converted some 32bit disklabel fields to 48bit (e.g.
the "sectors per unit" field). In order to implement this, they have
replaced some obsolete "hardware characteristics" fields with the high
part (16 most significant bits) of the aforementioned. Even the
partition table has changed. The "filesystem basic fragment size"
(=32bit) has been replaced with the "starting sector high part" (=16bit)
and the "number of sectors high part" (=16bit) fields.

Besides the python tool I've written, for a more permanent solution, I'm
considering patching libfdisk to support the OpenBSD disklabel. I wanted
to know if you are interested for those patches. I think the best way to
do it is to split the disklabel parts that have changed into different
structs and use unions to create a disklabel struct that will work both
for NetBSD and OpenBSD. What do you think?

If this works out, I'd be happy to create python bindings for libfdisk
(like the ones you have for libmount) as a later step. I know that the
API is not currently stable, but most parts seem OK.


Best Regards,
Nikos Skalkotos


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-13 11:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-02 17:21 Support for the new OpenBSD disklabel format Nikos Skalkotos
2013-12-10 10:32 ` Karel Zak
2013-12-13 10:48   ` Nikos Skalkotos
2013-12-13 11:45     ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox