From owner-p4-projects@FreeBSD.ORG Tue Nov 25 19:00:45 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7426A1065674; Tue, 25 Nov 2008 19:00:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38430106564A for ; Tue, 25 Nov 2008 19:00:45 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 285C58FC17 for ; Tue, 25 Nov 2008 19:00:45 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mAPJ0j53098043 for ; Tue, 25 Nov 2008 19:00:45 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mAPJ0jqg098041 for perforce@freebsd.org; Tue, 25 Nov 2008 19:00:45 GMT (envelope-from rene@FreeBSD.org) Date: Tue, 25 Nov 2008 19:00:45 GMT Message-Id: <200811251900.mAPJ0jqg098041@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Cc: Subject: PERFORCE change 153545 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2008 19:00:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=153545 Change 153545 by rene@rene_self on 2008/11/25 19:00:10 IFC Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/geom/chapter.sgml#4 integrate Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/geom/chapter.sgml#4 (text+ko) ==== @@ -1,6 +1,6 @@ @@ -147,7 +147,7 @@ Creating a stripe of unformatted ATA disks - Load the geom_stripe + Load the geom_stripe.ko module: &prompt.root; kldload geom_stripe @@ -167,13 +167,11 @@ for example /dev/ad2 and /dev/ad3: - &prompt.root; gstripe label -v st0 /dev/ad2 /dev/ad3 + &prompt.root; gstripe label -v st0 /dev/ad2 /dev/ad3 +Metadata value stored on /dev/ad2. +Metadata value stored on /dev/ad3. +Done. - Write a standard label, also known as a partition @@ -206,12 +204,15 @@ To mount this striped file system automatically during the boot process, place the volume information in - /etc/fstab file: + /etc/fstab file. For this purpose, a permanent mount + point, named stripe, is + created: - &prompt.root; echo "/dev/stripe/st0a /mnt ufs rw 2 2" \ + &prompt.root; mkdir /stripe +&prompt.root; echo "/dev/stripe/st0a /stripe ufs rw 2 2" \ >> /etc/fstab - The geom_stripe module must also be automatically loaded during + The geom_stripe.ko module must also be automatically loaded during system initialization, by adding a line to /boot/loader.conf: @@ -290,9 +291,11 @@ Edit the /etc/fstab file, replacing references to the old da0 with the - new device nodes of the gm0 mirror device. - As the root user, edit the - /etc/fstab: + new device nodes of the gm0 mirror device. + + + If &man.vi.1; is your preferred editor, the following is + an easy way to accomplish this task: &prompt.root; vi /etc/fstab @@ -302,6 +305,7 @@ replace all old da0 references with gm0 by typing :%s/da/mirror\/gm/g. + The resulting fstab file should look similar to the following. It does not matter if the disk @@ -380,7 +384,9 @@ OK? boot If this works then for whatever reason the module was not - being loaded properly. Place: + being loaded properly. Check whether the relevant entry in + /boot/loader.conf is correct. If the problem + persists, place: options GEOM_MIRROR @@ -518,27 +524,30 @@ Label Types and Examples There are two types of labels, a generic label and a - file system label. The difference between the labels is - the auto detection associated with permanent labels, and the - fact that this type of label will be persistent across reboots. - These labels are given a special directory in + file system label. Labels can be permanent or temporary. + Permanent labels can be created with the &man.tunefs.8; + or &man.newfs.8; commands. They will then be created + in a sub-directory of /dev, which will be named - based on their file system type. For example, + according to their file system type. For example, UFS2 file system labels will be created in the /dev/ufs - directory. + directory. Permanent labels can also be created with the + glabel label command. These are not file system + specific, and will be created in the /dev/label directory. - A generic label will go away with the next reboot. These + A temporary label will go away with the next reboot. These labels will be created in the /dev/label directory and - are perfect for experimentation. + are perfect for experimentation. A temporary label can be + created using the glabel create command. For more + information, please read the manual page of &man.glabel.8;. - Permanent labels may be placed on the file system using the - tunefs or newfs - utilities. To create a permanent label for a + To create a permanent label for a UFS2 file system without destroying any data, issue the following command: @@ -582,6 +591,65 @@ label: &prompt.root; glabel destroy home + + 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 ATA disk is used, which is currently + recognized by the system as ad0. It is + also assumed that the standard &os; partition scheme is used, with + /, + /var, + /usr and + /tmp file systems, as well + as a swap partition. + + Reboot the system, and at the &man.loader.8; prompt, press + 4 to boot into single user mode. Then enter the + following commands: + + &prompt.root; glabel label rootfs /dev/ad0s1a +GEOM_LABEL: Label for provider /dev/ad0s1a is label/rootfs +&prompt.root; glabel label var /dev/ad0s1d +GEOM_LABEL: Label for provider /dev/ad0s1d is label/var +&prompt.root; glabel label usr /dev/ad0s1f +GEOM_LABEL: Label for provider /dev/ad0s1f is label/usr +&prompt.root; glabel label tmp /dev/ad0s1e +GEOM_LABEL: Label for provider /dev/ad0s1e is label/tmp +&prompt.root; glabel label swap /dev/ad0s1b +GEOM_LABEL: Label for provider /dev/ad0s1b is label/swap +&prompt.root; exit + + The system will continue with multi-user boot. After the boot + completes, edit /etc/fstab and replace the + conventional device names, with their respective labels. The + final /etc/fstab file will look like the + following: + + # 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 mount will show: + + &prompt.root; mount +/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) + @@ -611,8 +679,9 @@ This method is yet 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 - is an image of the file system, an actual log is stored at the - end sector and, in some cases, may be stored on another disk + is an image of the file system, an actual log is stored in disk + space specifically reserved for this task, + and in some cases may be stored on another disk entirely. Unlike other file system journaling implementations, the @@ -626,6 +695,19 @@ options UFS_GJOURNAL + If journaled volumes need to be mounted during startup, the + geom_journal.ko kernel module will also have to be + loaded, by adding the following line in + /boot/loader.conf: + + geom_journal_load="YES" + + Alternatively, this function can also be built into a custom + kernel, by adding the following line in the kernel configuration + file: + + options GEOM_JOURNAL + Creating a journal on a free file system may now be done using the following steps, considering that the da4 is a new SCSI @@ -669,6 +751,11 @@ the actual journal but this does not protect against data loss incurred as a result of misusing tunefs. + + It is also possible to journal the boot disk of a &os; system. + Please refer to the article Implementing UFS Journaling on + a Desktop PC for detailed instructions on this task.