absolute vs. relative offsets in disklabel

Dmitry Marakasov amdmi3 at mail.ru
Mon Jul 31 20:32:19 UTC 2006


Recent `disklabel differences FreeBSD, DragonFly' thread gave me a
thought - why do we have absolute offsets in disklabel? AFAIK, on NetBSD
and OpenBSD, label is not necessarily located `near' filesystems stored
in it's partitions - and even disklabel utility shows absolute offsets
(with 'c' covering entire device). FreeBSD, however, seem to step far
away from that standart - 8 partitions instead of 16, label located in
the beginning of a partition, bsdlabel shows relative offsets. Now I
wonder if there are any reasons for offsets to be actually absolute?
There are many weighty arguments for relative offsets:
- No confusion (once I did try to dd slice from one place on disk to
  another to copy it, and was very surprised when changes made on one
  partition appeared on another as well)
- Ability to copy and move slices with simple dd(1).
- Ability to save whole disk images on slices and access subpartitions
  without problems (for example when moving system to larger hdd or when
  storing hdd images for emulation on partitions instead of filesystem,
  avoiding overhead). This was as an argument for geom's recursive
  labelling feature, but now I realize that it was not quite correct, as
  because of absolute offsets it can't actually be used now.

So I want to hear opinions on the subject - is it worth implementing and
how easy or hard will it be to implement it and migrate. I've looked
through geom_label and bsdlabel code and found these quite easy to change.
I'm not sure about compatibility though - is it possible to introduce
some flag into label indicating that it uses relative offsets?

If the idea is welcomed, I am eager to work on it, as I would like this
change much.

Best regards,
 Dmitry                          mailto:amdmi3 at mail.ru

More information about the freebsd-hackers mailing list