I hate to bitch but bitch I must

Manolis Kiagias sonicy at otenet.gr
Sun Oct 18 16:45:36 UTC 2009

PJ wrote:

(trimmed down)
> Is entirely possible that I mucked up somewhere and did not do the
> shutdown -r quite right... anyway, it is working fine now.
> I still have some minor questions, though...
> Can glabel be done on a dormant file system and then boot that file
> system to change the fstab? 

You mean glabel the file system but still leave it as a normal device
name in fstab?
Sure, no problem there. The file system can either be mounted using it's
/dev/adXX (or /dev/daXX)
device name, it's label, or even the ufsid (assuming it is a UFS
filesystem, see the section below the glabel example)
So basically you can reboot after creating the label without changing
the fstab if you wish and change it later when you are certain that
glabel worked as you expected.

> I would think that that would be about the
> same things ad doing it from a mounted system in SUM.
> Then, the last question... where does tunefs really come in? .. I ask

As others have said (and as explained in Handbook section 19.6.1) tunefs
can only create labels for UFS filesystems. Glabel on the other hand is
not filesystem specific, you can label anything (for example, you have
already labeled the swap space which clearly is not a file system). That
makes glabel more suitable IMHO when the purpose is to completely
replace the device names in fstab.

So in short:

- If you wish to create permanent labels for anything including swap
space and 'alien' filesystems as well as UFS, use 'glabel label'
- If you wish to create temporary labels for anything including swap
space and 'alien' filesystems as well as UFS, use 'glabel create' (I
doubt this is very useful, but it is an option)
- If you wish to create permanent labels for UFS filesystems *only* you
have the option of using tunefs.
- If you do not wish to create labels yourself and you are only
interested in mounting UFS filesystems without using the device names,
you can use the ufsid labels that are created automatically when the
filesystem is first created.

>From all the solutions, the only  one that covers both UFS and the swap
space and is permanent is the 'glabel label' command (hence the example
in the Handbook)

I hope this clears it up :)

More information about the freebsd-questions mailing list