Port-macppc archive

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

Re: disklabel endianness problems



> I see.  If I manually recreate the disklabel using the same offsets
> and sizes as the previous disklabel had, would things work?

It might work, but MBR partition handling in disksubr.c is
also machine dependent.

macppc seems to support it (i.e. checks MBR first then searches
NetBSD label in NetBSD partition) but I doubt it's tested enough,
especially on write ops.

> One thing I have always wondered is where exactly the disklabel is
> stored.

We have to check MD disksubr.c implementation and
LABELSECTOR and LABELOFFSET defined in <machine/disklabel.h>.
In some case there is no NetBSD disklabel data on disks.
(converted from "native" label format).

> I presume rewriting it from a different platform will just
> overwrite the existing label and nothing else, so I should not expect
> data corruption.  Correct?

It's machine dependnent, too.
- Most ports can't handle swapped byteorder.
- Some ports use fixed LABELOFFSET on write,
  others search magic in existing label.

To create image on hosts different from the target,
you can use tools/disklabel. It's handles target's disklabel
structures including byte order.

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index