Subject: Re: disklabel questions
To: None <>
From: Christos Zoulas <>
List: port-i386
Date: 10/28/2001 19:36:46
In article <>,
Georges Heinesch <> wrote:
>Some questions regarding disklabels:

Tons of questions, ok...

>- Is the "in-core" disklabel the disklabel stored somewhere on  NetBSD
>  filesystem?


>- Where is the in-core disklabel saved?
>  (in /etc/disktab)

In memory [kernel data structures]

>- Why is disklabel, of the disk where NetBSD is on, showing an NTFS
>  partition with fstype "unused"? NTFS is a recognized filesystem.

Well, there can be two "labels" on the disk. One is the mbr label, where
there are four primary partitions and inside primary partitions there
can be logical ones. This is manipulated by fdisk. The other is the bsd
label and it is manipulated by disklabel. The bsd label lives inside
one of the mbr labels, or it exists without an mbr label.

>- When displaying the disklabel of wd1 (NetBSD is on wd1), it's only
>  showing a-e (which is normal since I only have / and /usr). However
>  I have 4 more NTFS partitions on the disk.

You can define more and they will appear. Unused partitions of 0 size
are not shown. You can use mbrlabel to find the rest of the partitions
and automatically define them.

>  - I know how to change the disklabel with (disklabel -e wd1), but
>    how can I store this changes that the survive the next reboot?

They will when you save and quit. You can use disklabel -r to access
the raw partition, bypassing the in-core copy.

>  - disklabel says that the max. number of labels is 8. However I
>    read in a posting here some tome ago that the new number is 16.
>    What's correct now?

16 is correct.

>- After I edit the in-core disklabel of a disk which has no disk
>  label, I get the following message:
>  disklabel: ioctl DIOCWDINFO: No disk label on disk;
>  use "disklabel -I" to install initial label

Yes, because disklabel has not been ran, so the disk does not have
a bsd label yet. In this case the kernel generates a ficticious
label that lives in core only.

>  What happens exactly when I say "disklabel -I"?
>  I don't want to trash my MBR.

It will not trash your mbr. It will only write a partition table.

>- Is it correct that mbrlabel just reads the MBR and creates the
>  disklabel (in RAM only - not in-core)?

It can do both, depending on the flags you pass it.