Solved /dev/ufs/FreeBSD_Install

The /etc/fstab entry on a memstick image is /dev/ufs/FreeBSD_Install. Just wondered how that gets assigned to the image.. I'm trying to create an installation partition on a hard disk, but can't figure out if it is possible to create such a label on this partition.. glabel() doesn't appear to be the correct tool... Is it possible to do what I want?
 
Partition is created with gpart(8), it has the option to label the partition.
Code:
 -l label      The label attached to the partition.  This
                                 option is only valid when used on
                                 partitioning schemes that support partition
                                 labels.
 
According to glabel():-

This GEOM class also provides volume label detection for file systems.
Those labels cannot be set with glabel, but must be set with the appro-
priate file system utility, e.g. for UFS the file system label is set
with tunefs(8). Currently supported file systems are:

+o UFS1 volume names (directory /dev/ufs/).
+o UFS2 volume names (directory /dev/ufs/).
don't see any examples though...
 
Is this mandatory?
No, I believe this is specifically done on the official install media to make it compatible with more systems. It's not strictly necessary if you know all your systems are able to boot from GPT.
 
Having just recreated a USB stick, I was wondering where on the device I could find reference to /dev/ufs/FreeBSD_Install. Is it somewhere in the filesystem, in the partition or volume label. Can't seem to find it anywhere.
 
I've mounted a memstick image on md0, it's a 13-STABLE image but this should still be the same for previous versions.

Code:
root@molly:/storage/release/13-stable # tunefs -p /dev/md0s2a
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 disabled
tunefs: soft update journaling: (-j)                       disabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  8192
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            0
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                 FreeBSD_Install

Note the volume label of md0s2a.
Code:
root@molly:/storage/release/13-stable # mount /dev/md0s2a /mnt/
root@molly:/storage/release/13-stable # cat /mnt/etc/fstab
/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1
 
This partition 2 of a GPT disk:-

Code:
root@S09:~ # tunefs -p /dev/da0p2
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: volume label: (-L)                                 FreeBSD_Install

Not exactly sure where volume label are stored but I managed to change this one.
 
So where is it actually stored? With MBR sytle there is only bootsect. Is is stored there or a few bytes beyond that on the disk?
? I do not quite understand the Q. The label is stored in the filesystem, it' a filesystem label.
That BeaSD is open source, we can always RTSL:
fgrep -in label `whereis newfs|awk '{print $4}'`/*
Code:
...
/usr/src/sbin/newfs/newfs.c:440:                    bootarea + (0 /* labeloffset */ +
/usr/src/sbin/newfs/newfs.c:441:                                1 /* labelsoffset */ * sectorsize),
...
 
Back
Top