Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 May 2020 05:29:46 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Trond =?ISO-8859-1?Q?Endrest=F8l?= <trond.endrestol@ximalas.info>
Cc:        Christoph Kukulies <kuku@kukulies.org>, freebsd-questions@freebsd.org
Subject:   Re: Mounting from ufs:/dev/ad2s1a failed with error 19.
Message-ID:  <20200501052946.961f8147.freebsd@edvax.de>
In-Reply-To: <alpine.BSF.2.22.395.2004302148520.91211@enterprise.ximalas.info>
References:  <4348B2AE-3E30-4345-8883-EAEA53A59220@kukulies.org> <0D1F4392-C646-42C8-9DB3-50F93236A6DC@kukulies.org> <alpine.BSF.2.22.395.2004302136320.91211@enterprise.ximalas.info> <D2AB7430-4FD0-40CA-A409-4045C04BAE34@kukulies.org> <alpine.BSF.2.22.395.2004302148520.91211@enterprise.ximalas.info>

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:
>=20
> > 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?
>=20
> Your system uses MBR, hence the ad0s prefix.
>=20
> 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:

	https://www.freebsd.org/doc/handbook/geom-glabel.html

	http://www.wonkity.com/~wblock/docs/html/disksetup.html

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.



--=20
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20200501052946.961f8147.freebsd>