<command>man fstab</command> -> &man.fstab.5;

Minor grammar/markup changes.
Placed two groups of paragraphs into <procedure> and <varlist>
Make use of <port> tag

Reviewed by:	murray
This commit is contained in:
Chern Lee 2001-07-28 01:44:52 +00:00
parent 5195ad018c
commit 2de880b5f1
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=10077

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/disks/chapter.sgml,v 1.39 2001/07/19 23:18:06 chern Exp $
$FreeBSD$
-->
<chapter id="disks">
@ -18,7 +18,7 @@
<title>BIOS Drive Numbering</title>
<para>Before you install and configure FreeBSD on your system, there is an
important subject that you should be aware of if, especially if you have
important subject that you should be aware of, especially if you have
multiple hard drives.</para>
<indexterm><primary>DOS</primary></indexterm>
@ -235,11 +235,12 @@
<indexterm><primary>root filesystem</primary></indexterm>
<para>There are various reasons to house some of these
directories on separate filesystems. <filename>/var</filename>
contains <filename>log/</filename>, <filename>spool/</filename>,
contains the directories <filename>log/</filename>,
<filename>spool/</filename>,
and various types of temporary files, and
as such, may get filled up. Filling up the root filesystem
isn't a good idea, so splitting <filename>/var</filename> from
<filename>/</filename> is often a good idea.</para>
<filename>/</filename> is often favorable.</para>
<para>Another common reason to contain certain directory trees on
other filesystems is if they are to be housed on separate
@ -248,7 +249,7 @@
drives.</para>
<sect2 id="disks-fstab">
<title>The fstab File</title>
<title>The <filename>fstab</filename> File</title>
<indexterm>
<primary>filesystems</primary>
<secondary>mounted with fstab</secondary>
@ -264,28 +265,55 @@
<programlisting><replaceable>device</replaceable> <replaceable>/mount-point</replaceable> <replaceable>fstype</replaceable> <replaceable>options</replaceable> <replaceable>dumpfreq</replaceable> <replaceable>passno</replaceable></programlisting>
<para><literal>device</literal> is a device name (which should
exist), as explained in the <link linkend="disks-naming">Disk
naming conventions</link> above.</para>
<variablelist>
<varlistentry>
<term><literal>device</literal></term>
<listitem>
<para>A device name (which should exist), as explained in
the <link linkend="disks-naming">Disk naming
conventions</link> above.</para>
</listitem>
</varlistentry>
<para><literal>mount-point</literal> is a directory (which
should exist), on which to mount the filesystem.</para>
<varlistentry>
<term><literal>mount-point</literal></term>
<para><literal>fstype</literal> is the filesystem type to pass
to &man.mount.8;. The default FreeBSD filesystem is
<literal>ufs</literal>.</para>
<listitem><para>A directory (which should exist), on which
to mount the filesystem.</para>
</listitem>
</varlistentry>
<para><literal>options</literal> is either <option>rw</option>
for read-write filesystems, or <option>ro</option> for
read-only filesystems, followed by any other options that may
be needed. A common option is <option>noauto</option> for
filesystems not normally mounted during the boot sequence.
Other options in the &man.mount.8; manual page.</para>
<varlistentry>
<term><literal>fstype</literal></term>
<para><literal>dumpfreq</literal> is the number of days the
filesystem should be dumped, and <literal>passno</literal> is
the pass number during which the filesystem is checked during
the boot sequence.</para>
<listitem><para>The filesystem type to pass to
&man.mount.8;. The default FreeBSD filesystem is
<literal>ufs</literal>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>options</literal></term>
<listitem><para>Either <option>rw</option> for read-write
filesystems, or <option>ro</option> for read-only
filesystems, followed by any other options that may be
needed. A common option is <option>noauto</option> for
filesystems not normally mounted during the boot sequence.
Other options in the &man.mount.8; manual page.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>dumpfreq</literal></term>
<listitem><para>The number of days the filesystem should be
dumped, and <literal>passno</literal> is the pass number
during which the filesystem is checked during the boot
sequence.</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2 id="disks-mount">
@ -308,7 +336,7 @@
&man.mount.8; manual page, but the most common are:</para>
<variablelist>
<title>mount options</title>
<title>Mount Options</title>
<varlistentry>
<term><option>-a</option></term>
@ -459,9 +487,9 @@
<para>Login as user <username>root</username>. After you've installed the
drive, inspect <filename>/var/run/dmesg.boot</filename> to ensure the new
disk was found. Continuing with our example, the newly added drive will
be <filename>da1</filename> and we want to mount it on
<filename>/1</filename> (if you are adding an IDE drive, it will
be <filename>wd1</filename> in pre-4.0 systems, or
be <devicename>da1</devicename> and we want to mount it on
<filename>/1</filename> (if you are adding an IDE drive, the device name
will be <devicename>wd1</devicename> in pre-4.0 systems, or
<filename>ad1</filename> in most 4.X systems).</para>
<indexterm><primary>partitions</primary></indexterm>
@ -498,68 +526,86 @@
<secondary>adding disks</secondary>
</indexterm>
<para>You may use <command>/stand/sysinstall</command> to
partition and label a new disk using its easy to use menus.
Either login as user <username>root</username> or use the
<command>su</command> command. Run
<command>/stand/sysinstall</command> and enter the
<literal>Configure</literal> menu. Within the
<literal>FreeBSD Configuration Menu</literal>, scroll down and
select the <literal>Partition</literal> item. Next you should
be presented with a list of hard drives installed in your
system. If you do not see <literal>da1</literal> listed, you
need to recheck your physical installation and
<command>dmesg</command> output in the file
<filename>/var/run/dmesg.boot</filename>.</para>
<para>Select <literal>da1</literal> to enter the <literal>FDISK
Partition Editor</literal>. Type <literal>A</literal> to
use the entire disk for FreeBSD. When asked if you want to
<quote>remain cooperative with any future possible operating
systems</quote>, answer <literal>YES</literal>. Write the
changes to the disk using <userinput>W</userinput>. Now exit the
FDISK editor by typing <userinput>q</userinput>. Next you will be
asked about the Master Boot Record. Since you are adding a
disk to an already running system, choose
<literal>None</literal>.</para>
<procedure>
<step>
<title>Navigating <application>Sysinstall</application></title>
<indexterm><primary>BSD partitions</primary></indexterm>
<para>Next, <application>Sysinstall</application> will
enter the <literal>Disk Label Editor</literal>. This
is where you will create the traditional BSD partitions. A
disk can have up to eight partitions, labeled <literal>a-h</literal>.
A few of
the partition labels have special uses. The
<literal>a</literal> partition is used for the root partition
(<filename>/</filename>). Thus only your system disk (e.g,
the disk you boot from) should have an <literal>a</literal>
partition. The <literal>b</literal> partition is used for
swap partitions, and you may have many disks with swap
partitions. The <literal>c</literal> partition addresses the
entire disk in dedicated mode, or the entire FreeBSD slice in
slice mode. The other partitions are for general use.</para>
<para>You may use <command>/stand/sysinstall</command> to
partition and label a new disk using its easy to use menus.
Either login as user <username>root</username> or use the
<command>su</command> command. Run
<command>/stand/sysinstall</command> and enter the
<literal>Configure</literal> menu. Within the
<literal>FreeBSD Configuration Menu</literal>, scroll down and
select the <literal>Partition</literal> item. Next you should
be presented with a list of hard drives installed in your
system. If you do not see <literal>da1</literal> listed, you
need to recheck your physical installation and
<command>dmesg</command> output in the file
<filename>/var/run/dmesg.boot</filename>.</para>
</step>
<para><application>Sysinstall</application>'s Label editor
favors the <literal>e</literal>
partition for non-root, non-swap partitions. Within the
Label editor, create a single file system by typing
<userinput>C</userinput>. When prompted if this will be a FS
(file system) or swap, choose <literal>FS</literal> and type in a
mount point (e.g, <filename>/mnt</filename>). When adding a
disk in post-install mode, <application>Sysinstall</application>
will not create entries
in <filename>/etc/fstab</filename> for you, so the mount point
you specify isn't important.</para>
<step>
<title>FDISK Partition Editor</title>
<para>Select <literal>da1</literal> to enter the <literal>FDISK
Partition Editor</literal>. Type <literal>A</literal> to
use the entire disk for FreeBSD. When asked if you want to
<quote>remain cooperative with any future possible operating
systems</quote>, answer <literal>YES</literal>. Write the
changes to the disk using <userinput>W</userinput>. Now exit the
FDISK editor by typing <userinput>q</userinput>. Next you will be
asked about the Master Boot Record. Since you are adding a
disk to an already running system, choose
<literal>None</literal>.</para>
</step>
<para>You are now ready to write the new label to the disk and
create a file system on it. Do this by typing
<userinput>W</userinput>. Ignore any errors from
<application>Sysinstall</application> that
it could not mount the new partition. Exit the Label Editor
and <application>Sysinstall</application> completely.</para>
<step>
<title>Disk Label Editor</title>
<indexterm><primary>BSD partitions</primary></indexterm>
<para>The last step is to edit <filename>/etc/fstab</filename>
to add an entry for your new disk.</para>
<para>Next, <application>Sysinstall</application> will
enter the <literal>Disk Label Editor</literal>. This
is where you will create the traditional BSD partitions. A
disk can have up to eight partitions, labeled
<literal>a-h</literal>.
A few of
the partition labels have special uses. The
<literal>a</literal> partition is used for the root partition
(<filename>/</filename>). Thus only your system disk (e.g,
the disk you boot from) should have an <literal>a</literal>
partition. The <literal>b</literal> partition is used for
swap partitions, and you may have many disks with swap
partitions. The <literal>c</literal> partition addresses the
entire disk in dedicated mode, or the entire FreeBSD slice in
slice mode. The other partitions are for general use.</para>
<para><application>Sysinstall</application>'s Label editor
favors the <literal>e</literal>
partition for non-root, non-swap partitions. Within the
Label editor, create a single file system by typing
<userinput>C</userinput>. When prompted if this will be a FS
(file system) or swap, choose <literal>FS</literal> and type in a
mount point (e.g, <filename>/mnt</filename>). When adding a
disk in post-install mode, <application>Sysinstall</application>
will not create entries
in <filename>/etc/fstab</filename> for you, so the mount point
you specify isn't important.</para>
<para>You are now ready to write the new label to the disk and
create a file system on it. Do this by typing
<userinput>W</userinput>. Ignore any errors from
<application>Sysinstall</application> that
it could not mount the new partition. Exit the Label Editor
and <application>Sysinstall</application> completely.</para>
</step>
<step>
<title>Finish</title>
<para>The last step is to edit <filename>/etc/fstab</filename>
to add an entry for your new disk.</para>
</step>
</procedure>
</sect2>
<sect2>
@ -579,11 +625,11 @@
<screen>&prompt.root; <userinput>dd if=/dev/zero of=/dev/rda1 bs=1k count=1</userinput>
&prompt.root; <userinput>fdisk -BI da1</userinput> #Initialize your new disk
&prompt.root; <userinput>disklabel -B -w -r da1s1 auto</userinput> #Label it.
&prompt.root; <userinput>disklabel -e da1s1</userinput> # Now edit the disklabel you just created and add any partitions.
&prompt.root; <userinput>disklabel -e da1s1</userinput> # Edit the disklabel just created and add any partitions.
&prompt.root; <userinput>mkdir -p /1</userinput>
&prompt.root; <userinput>newfs /dev/da1s1e</userinput> # Repeat this for every partition you created.
&prompt.root; <userinput>mount -t ufs /dev/da1s1e /1</userinput> # Mount the partition(s)
&prompt.root; <userinput>vi /etc/fstab</userinput> # When satisfied, add the appropriate entry/entries to your <filename>/etc/fstab</filename>.</screen>
&prompt.root; <userinput>vi /etc/fstab</userinput> # Add the appropriate entry/entries to your <filename>/etc/fstab</filename>.</screen>
<para>If you have an IDE disk, substitute <filename>ad</filename>
for <filename>da</filename>. On pre-4.X systems use
@ -647,13 +693,13 @@
linkend="disks-vnconfig">vnconfig</link>.</para>
<sect2 id="disks-vnconfig">
<title>vnconfig: file-backed filesystem</title>
<title>vnconfig: File-Backed Filesystem</title>
<indexterm>
<primary>disks</primary>
<secondary>file-backed</secondary>
</indexterm>
<para>&man.vnconfig.8; configures and enables vnode pseudo disk
<para>&man.vnconfig.8; configures and enables vnode pseudo-disk
devices. A <firstterm>vnode</firstterm> is a representation
of a file, and is the focus of file activity. This means that
&man.vnconfig.8; uses files to create and operate a
@ -770,8 +816,8 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
the quota database properly reflects the data on the file system.
This is a very time consuming process that will significantly
affect the time your system takes to boot. If you would like to
skip this step, a variable is made available for the
purpose:</para>
skip this step, a variable in <filename>/etc/rc.conf</filename>
is made available for the purpose:</para>
<programlisting>check_quotas=<quote>NO</quote></programlisting>
@ -803,8 +849,9 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
<para>By default the quota files are stored in the root directory of
the file system with the names <filename>quota.user</filename> and
<filename>quota.group</filename> for user and group quotas
respectively. See <command>man fstab</command> for more
information. Even though that man page says that you can specify
respectively. See &man.fstab.5; for more
information. Even though the &man.fstab.5; man page says that
you can specify
an alternate location for the quota files, this is not recommended
because the various quota utilities do not seem to handle this
properly.</para>
@ -910,7 +957,7 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
<screen>&prompt.root; <userinput>edquota -p test 10000-19999</userinput></screen>
<para>See <command>man edquota</command> for more detailed
<para>See the &man.edquota.8; for more detailed
information.</para>
</sect2>
@ -1019,8 +1066,8 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
<para>The <command><link linkend="mkisofs">mkisofs</link></command>
program is used to produce a data file containing an ISO 9660 file
system. It has options that support various extensions, and is
described below. You can install it with the <filename>
/usr/ports/sysutils/mkisofs</filename> port.</para>
described below. You can install it with the
<port>sysutils/mkisofs</port> port.</para>
<indexterm>
<primary>CD burner</primary>
@ -1031,7 +1078,12 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
linkend="burncd">burncd</link></command> program that is part of
the base system. SCSI and USB CD burners should use the
<command><link linkend="cdrecord">cdrecord</link></command> from
the <filename>/usr/ports/sysutils/cdrecord</filename> port.</para>
the <port>sysutils/cdrecord</port> port.</para>
<para><command>burncd</command> has a limited number of
supported drives. To find out if a drive is supported, see
<ulink url="http://freebsd.dk/ata/">CD-R/RW supported
drives</ulink>.</para>
</sect2>
<sect2 id="mkisofs">
@ -1052,9 +1104,7 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
<replaceable>/path/to/tree</replaceable>. In the process, it will
map the file names to names that fit the limitations of the
standard ISO 9660 file system, and will exclude files that have
names uncharacteristic of ISO file systems. Read &man.mkisofs.8;
for details of this process, and options that can be used to
control it.</para>
names uncharacteristic of ISO file systems.</para>
<indexterm>
<primary>filesystems</primary>
@ -1069,9 +1119,8 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
Rock Ridge extensions common to Unix systems, <option>-J</option>
enables Joliet extensions used by Microsoft systems, and
<option>-hfs</option> can be used to create HFS file systems used
by Macs. Read &man.mkisofs.8; for more information on the last
two.</para>
by MacOS.</para>
<para>For CDs that are going to be used only on FreeBSD systems,
<option>-U</option> can be used to disable all filename
restrictions. When used with <option>-R</option>, it produces a
@ -1106,8 +1155,9 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
and <filename>/tmp/myboot</filename> are identical.</para>
<para>There are many other options you can use with
<command>mkisofs</command> to fine-tune its behavior. See
&man.mkisofs.8; for details.</para>
<command>mkisofs</command> to fine-tune its behavior. In particular:
modifications to an ISO 9660 layout and the creation of Joilet
and HFS discs. See the &man.mkisofs.8; man page for details.</para>
</sect2>
<sect2 id="burncd">
@ -1137,13 +1187,13 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
<para>If you do not have an ATAPI CD burner, you will have to use
<command>cdrecord</command> to burn your
CDs. <command>cdrecord</command> is not part of the base system;
you must install it from either the port at <filename>
/usr/ports/sysutils/cdrecord</filename> or the appropriate
you must install it from either the port at <port>sysutils/cdrecord</port>
or the appropriate
package. Changes to the base system can cause binary versions of
this program to fail, possibly resulting in a
<quote>coaster</quote>. You should therefore either upgrade the
port when you upgrade your system, or if you are <link
linkend="stable">tracking -stable</link>, upgrade the port when a
linkend="stable">tracking -STABLE</link>, upgrade the port when a
new version becomes available.</para>
<para>While <command>cdrecord</command> has many options, basic usage