NetBSD-Users archive

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

Re: Keeping NetBSD disklabel up to date



Hi,

Michael van Elst schrieb:
beaker%sdf.org@localhost writes:

So it sounds like mbrlabel by itself would not have been sufficient for
avoiding this scenario; it's output still needs to be applied via the
disklabel tool; is that correct?

Yes.

No, this is not fully correct. See below.

I'm sort of surprised as the mbrlabel(8)
manpage says

  "mbrlabel is used to update a NetBSD disk label from the Master Boot
   Record (MBR) label and Extended Boot Record (EBR) label(s) found on
   disks that were previously used on DOS/Windows systems (or other MBR
   using sys tems)."

Perhaps it's grammatically correct but not literally correct -- it is
used to update the disklabel but doesn't actually do it itself?

mbrlabel does the following:

- read the current disklabel from disk
- enumerate the MBR partitions, for each partition

Note that this includes any extended partitions on the disk.

   - ignore if a disklabel entry with the same offset and size exists.
   - ignore if a disklabel entry exists that overlaps
   - otherwise add a corresponding disklabel entry

Just for the record, there has to be space in the disklabel for the
new entry.

- with -w option, write back the modified disklabel to disk

No, the -w options updates the in-core disklabel only.  You'll
have to add a -r as well in order to write the label to the disk, too.

So the best thing that can happen is that the modified partitions
are appended. But usually it will just clash with with a previous
entry.

You can remove the previous disklabel entries for the non-NetBSD
partitions, and then run mbrlabel -w to append the new entries.

Or you can run mbrlabel (without -w) and replace the previous entries
accordingly.

No, without -w, mbrlabel will just print out the modified disklabel,
but will neither change the in-core label nor the one on disk.

Ciao,
Wolfgang
--
Wolfgang%Solfrank.net@localhost				Wolfgang Solfrank


Home | Main Index | Thread Index | Old Index