Source string Read only

(itstool) path: sect2/para
Context English State
The following command can be used to destroy the label:
<prompt>#</prompt> <userinput>glabel destroy home</userinput>
The following example shows how to label the partitions of a boot disk.
Labeling Partitions on the Boot Disk
By permanently labeling the partitions on the boot disk, the system should be able to continue to boot normally, even if the disk is moved to another controller or transferred to a different system. For this example, it is assumed that a single <acronym>ATA</acronym> disk is used, which is currently recognized by the system as <filename>ad0</filename>. It is also assumed that the standard FreeBSD partition scheme is used, with <filename>/</filename>, <filename>/var</filename>, <filename>/usr</filename> and <filename>/tmp</filename>, as well as a swap partition.
Reboot the system, and at the <citerefentry><refentrytitle>loader</refentrytitle><manvolnum>8</manvolnum></citerefentry> prompt, press <keycap>4</keycap> to boot into single user mode. Then enter the following commands:
<prompt>#</prompt> <userinput>glabel label rootfs /dev/ad0s1a</userinput>
GEOM_LABEL: Label for provider /dev/ad0s1a is label/rootfs
<prompt>#</prompt> <userinput>glabel label var /dev/ad0s1d</userinput>
GEOM_LABEL: Label for provider /dev/ad0s1d is label/var
<prompt>#</prompt> <userinput>glabel label usr /dev/ad0s1f</userinput>
GEOM_LABEL: Label for provider /dev/ad0s1f is label/usr
<prompt>#</prompt> <userinput>glabel label tmp /dev/ad0s1e</userinput>
GEOM_LABEL: Label for provider /dev/ad0s1e is label/tmp
<prompt>#</prompt> <userinput>glabel label swap /dev/ad0s1b</userinput>
GEOM_LABEL: Label for provider /dev/ad0s1b is label/swap
<prompt>#</prompt> <userinput>exit</userinput>
The system will continue with multi-user boot. After the boot completes, edit <filename>/etc/fstab</filename> and replace the conventional device names, with their respective labels. The final <filename>/etc/fstab</filename> will look like this:
# Device Mountpoint FStype Options Dump Pass#
/dev/label/swap none swap sw 0 0
/dev/label/rootfs / ufs rw 1 1
/dev/label/tmp /tmp ufs rw 2 2
/dev/label/usr /usr ufs rw 2 2
/dev/label/var /var ufs rw 2 2
The system can now be rebooted. If everything went well, it will come up normally and <command>mount</command> will show:
<prompt>#</prompt> <userinput>mount</userinput>
/dev/label/rootfs on / (ufs, local)
devfs on /dev (devfs, local)
/dev/label/tmp on /tmp (ufs, local, soft-updates)
/dev/label/usr on /usr (ufs, local, soft-updates)
/dev/label/var on /var (ufs, local, soft-updates)
The <citerefentry><refentrytitle>glabel</refentrytitle><manvolnum>8</manvolnum></citerefentry> class supports a label type for <acronym>UFS</acronym> file systems, based on the unique file system id, <literal>ufsid</literal>. These labels may be found in <filename>/dev/ufsid</filename> and are created automatically during system startup. It is possible to use <literal>ufsid</literal> labels to mount partitions using <filename>/etc/fstab</filename>. Use <command>glabel status</command> to receive a list of file systems and their corresponding <literal>ufsid</literal> labels:
<prompt>%</prompt> <userinput>glabel status</userinput>
Name Status Components
ufsid/486b6fc38d330916 N/A ad4s1d
ufsid/486b6fc16926168e N/A ad4s1f
In the above example, <filename>ad4s1d</filename> represents <filename>/var</filename>, while <filename>ad4s1f</filename> represents <filename>/usr</filename>. Using the <literal>ufsid</literal> values shown, these partitions may now be mounted with the following entries in <filename>/etc/fstab</filename>:
/dev/ufsid/486b6fc38d330916 /var ufs rw 2 2
/dev/ufsid/486b6fc16926168e /usr ufs rw 2 2
Any partitions with <literal>ufsid</literal> labels can be mounted in this way, eliminating the need to manually create permanent labels, while still enjoying the benefits of device name independent mounting.
UFS Journaling Through <acronym>GEOM</acronym>
Support for journals on <acronym>UFS</acronym> file systems is available on FreeBSD. The implementation is provided through the <acronym>GEOM</acronym> subsystem and is configured using <command>gjournal</command>. Unlike other file system journaling implementations, the <command>gjournal</command> method is block based and not implemented as part of the file system. It is a <acronym>GEOM</acronym> extension.
Journaling stores a log of file system transactions, such as changes that make up a complete disk write operation, before meta-data and file writes are committed to the disk. This transaction log can later be replayed to redo file system transactions, preventing file system inconsistencies.
This method provides another mechanism to protect against data loss and inconsistencies of the file system. Unlike Soft Updates, which tracks and enforces meta-data updates, and snapshots, which create an image of the file system, a log is stored in disk space specifically for this task. For better performance, the journal may be stored on another disk. In this configuration, the journal provider or storage device should be listed after the device to enable journaling on.
The <filename>GENERIC</filename> kernel provides support for <command>gjournal</command>. To automatically load the <filename>geom_journal.ko</filename> kernel module at boot time, add the following line to <filename>/boot/loader.conf</filename>:
If a custom kernel is used, ensure the following line is in the kernel configuration file:
Once the module is loaded, a journal can be created on a new file system using the following steps. In this example, <filename>da4</filename> is a new <acronym>SCSI</acronym> disk:
<prompt>#</prompt> <userinput>gjournal load</userinput>
<prompt>#</prompt> <userinput>gjournal label /dev/<replaceable>da4</replaceable></userinput>
This will load the module and create a <filename>/dev/da4.journal</filename> device node on <filename>/dev/da4</filename>.
A <acronym>UFS</acronym> file system may now be created on the journaled device, then mounted on an existing mount point:
<prompt>#</prompt> <userinput>newfs -O 2 -J /dev/<replaceable>da4</replaceable>.journal</userinput>
<prompt>#</prompt> <userinput>mount /dev/<replaceable>da4</replaceable>.journal <replaceable>/mnt</replaceable></userinput>
In the case of several slices, a journal will be created for each individual slice. For instance, if <filename>ad4s1</filename> and <filename>ad4s2</filename> are both slices, then <command>gjournal</command> will create <filename>ad4s1.journal</filename> and <filename>ad4s2.journal</filename>.


No matching activity found.

Browse all component changes


English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect2/para
Source string location
String age
a year ago
Source string age
a year ago
Translation file
books/handbook.pot, string 6552