Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 May 2020 05:29:46 +0200
From:      Polytropon <>
To:        Trond =?ISO-8859-1?Q?Endrest=F8l?= <>
Cc:        Christoph Kukulies <>,
Subject:   Re: Mounting from ufs:/dev/ad2s1a failed with error 19.
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thu, 30 Apr 2020 22:06:04 +0200 (CEST), Trond Endrest=F8l wrote:
> On Thu, 30 Apr 2020 21:47+0200, Christoph Kukulies wrote:
> > Fine, but where in the installation process would I have had a chance t=
o decide for that option?
> > Can I define UUID labels (is that GPT?) in the hindsight?
> Your system uses MBR, hence the ad0s prefix.
> UFS labels can be set while in singleuser mode, this is particular=20
> important for the root filesystem.

Technically, they are to be set while the partition in question
is _not mounted_ (i. e., this would also work in multi-user mode
if you can unmount the partitions you're going to label in that
particular mode). The restriction of / is that it usually will
work when / is mounted read-only. To be fully safe, you could
always boot from a USB stick or a FreeBSD installation CD or
DVD, and use that environment for the labeling operation. Of
course the single-user mode still is a convenient solution for
this specific requirement.

>  1. Reboot to singleuser mode.
>  2. Hit the enter key when asked about which shell to launch.
>  3. tunefs -L root /dev/ad0s1a
>  4. Ditto for the other *UFS* partitions. Consult your /etc/fstab.
>  5. Verify the labels using dumpfs /dev/ad0s1a
>  6. Reboot to multiuser mode.
>  7. Duplicate the necessary lines in /etc/fstab.
>  8. Comment out the original lines, in case you must revert.
>  9. Change the duplicate lines to refer to /dev/ufs/root, etc.
> 10. Reboot to see if you have succeeded.
> 11. Remove the original lines in /etc/fstab, if desired.

Correct - this will be the UFS labels, one out of three methods
of labeling (glabel and ufsid being the other two). Note that
those relate to UFS filesystems, not to the partitioning scheme
they have been created in; it also works for "dedicated" (i. e.,
when you don't have any partitioning at all).

Documentation and further inspiration can be found here:

However, on modern system you should probably use GPT and add
GPT labels. Use MBR (or dedicated) only if you have a good reason
to do so. :-)

Note that the different labeling mechanisms result in specific
naming conventions in /etc/fstab (/dev/ufs/..., /dev/label/...,
/dev/gpt/..., ufsid/... and so on).

> I recall issues in the past using glabel(8) which stores the label in=20
> the last disk block (sector) of the partition. Hence the labeled=20
> device file should present a device which is one disk block shorter to=20
> avoid the label being overwritten. Maybe someone else can chime in on=20
> this.

Yes, this is something you will have to pay attention to,
especially when you want to re-use a disk for something else.
If I remember correctly, dealing with them also requires the
setting of a debug flag (sysctl) for proper label destruction.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Want to link to this message? Use this URL: <>