[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[b78c747] | 7 |
|
---|
[3be4d97] | 8 | <sect1 id="ch-bootable-fstab">
|
---|
[b78c747] | 9 | <?dbhtml filename="fstab.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Creating the /etc/fstab File</title>
|
---|
[673b0d8] | 12 |
|
---|
[b78c747] | 13 | <indexterm zone="ch-bootable-fstab">
|
---|
| 14 | <primary sortas="e-/etc/fstab">/etc/fstab</primary>
|
---|
| 15 | </indexterm>
|
---|
[81fd230] | 16 |
|
---|
[b78c747] | 17 | <para>The <filename>/etc/fstab</filename> file is used by some programs to
|
---|
| 18 | determine where file systems are to be mounted by default, in which order, and
|
---|
| 19 | which must be checked (for integrity errors) prior to mounting. Create a new
|
---|
| 20 | file systems table like this:</para>
|
---|
[81fd230] | 21 |
|
---|
[0719866] | 22 | <screen><userinput>cat > /etc/fstab << "EOF"
|
---|
[d72e04a] | 23 | <literal># Begin /etc/fstab
|
---|
[6370fa6] | 24 |
|
---|
[e9ba8aa8] | 25 | # file system mount-point type options dump fsck
|
---|
| 26 | # order
|
---|
| 27 |
|
---|
| 28 | /dev/<replaceable><xxx></replaceable> / <replaceable><fff></replaceable> defaults 1 1
|
---|
| 29 | /dev/<replaceable><yyy></replaceable> swap swap pri=1 0 0
|
---|
| 30 | proc /proc proc nosuid,noexec,nodev 0 0
|
---|
| 31 | sysfs /sys sysfs nosuid,noexec,nodev 0 0
|
---|
[654dc0d] | 32 | devpts /dev/pts devpts gid=5,mode=620 0 0
|
---|
[e9ba8aa8] | 33 | tmpfs /run tmpfs defaults 0 0
|
---|
| 34 | devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
|
---|
| 35 |
|
---|
[d72e04a] | 36 | # End /etc/fstab</literal>
|
---|
[0719866] | 37 | EOF</userinput></screen>
|
---|
[6370fa6] | 38 |
|
---|
[0090db5] | 39 | <para>Replace <replaceable><xxx></replaceable>,
|
---|
| 40 | <replaceable><yyy></replaceable>, and <replaceable><fff></replaceable>
|
---|
[b78c747] | 41 | with the values appropriate for the system, for example, <filename
|
---|
[cd591a6] | 42 | class="partition">sda2</filename>, <filename
|
---|
| 43 | class="partition">sda5</filename>, and <systemitem
|
---|
[a92b3e7] | 44 | class="filesystem">ext3</systemitem>. For details on the six
|
---|
[b78c747] | 45 | fields in this file, see <command>man 5 fstab</command>.</para>
|
---|
[81fd230] | 46 |
|
---|
[32fa31b] | 47 | <!--
|
---|
[b78c747] | 48 | <para>The <filename class="directory">/dev/shm</filename> mount point
|
---|
| 49 | for <systemitem class="filesystem">tmpfs</systemitem> is included to
|
---|
| 50 | allow enabling POSIX-shared memory. The kernel must have the required
|
---|
| 51 | support built into it for this to work (more about this is in the next
|
---|
| 52 | section). Please note that very little software currently uses
|
---|
| 53 | POSIX-shared memory. Therefore, consider the <filename
|
---|
| 54 | class="directory">/dev/shm</filename> mount point optional. For more
|
---|
| 55 | information, see
|
---|
| 56 | <filename>Documentation/filesystems/tmpfs.txt</filename> in the kernel
|
---|
| 57 | source tree.</para>
|
---|
[32fa31b] | 58 | -->
|
---|
[81fd230] | 59 |
|
---|
[fa21b3d] | 60 | <para>Filesystems with MS-DOS or Windows origin (i.e.: vfat, ntfs, smbfs, cifs,
|
---|
| 61 | iso9660, udf) need the <quote>iocharset</quote> mount option in order for
|
---|
| 62 | non-ASCII characters in file names to be interpreted properly. The value
|
---|
| 63 | of this option should be the same as the character set of your locale,
|
---|
| 64 | adjusted in such a way that the kernel understands it. This works if the
|
---|
| 65 | relevant character set definition (found under File systems ->
|
---|
| 66 | Native Language Support) has been compiled into the kernel
|
---|
| 67 | or built as a module. The <quote>codepage</quote> option is also needed for
|
---|
[1652151] | 68 | vfat and smbfs filesystems. It should be set to the codepage number used
|
---|
| 69 | under MS-DOS in your country. E.g., in order to mount USB flash drives, a
|
---|
| 70 | ru_RU.KOI8-R user would need the following in the options portion of its
|
---|
| 71 | mount line in <filename>/etc/fstab</filename>:</para>
|
---|
[fa21b3d] | 72 |
|
---|
[c8c2b89] | 73 | <screen><literal>noauto,user,quiet,showexec,iocharset=koi8r,codepage=866</literal></screen>
|
---|
[fa21b3d] | 74 |
|
---|
[1652151] | 75 | <para>The corresponding options fragment for ru_RU.UTF-8 users is:</para>
|
---|
[fa21b3d] | 76 |
|
---|
[c8c2b89] | 77 | <screen><literal>noauto,user,quiet,showexec,iocharset=utf8,codepage=866</literal></screen>
|
---|
[fa21b3d] | 78 |
|
---|
[c226182] | 79 | <note>
|
---|
| 80 | <para>In the latter case, the kernel emits the following message:</para>
|
---|
[fa21b3d] | 81 |
|
---|
[c226182] | 82 | <screen><computeroutput>FAT: utf8 is not a recommended IO charset for FAT filesystems,
|
---|
| 83 | filesystem will be case sensitive!</computeroutput></screen>
|
---|
[fa21b3d] | 84 |
|
---|
[c226182] | 85 | <para>This negative recommendation should be ignored, since all other values
|
---|
| 86 | of the <quote>iocharset</quote> option result in wrong display of filenames in
|
---|
| 87 | UTF-8 locales.</para>
|
---|
| 88 | </note>
|
---|
[fa21b3d] | 89 |
|
---|
| 90 | <para>It is also possible to specify default codepage and iocharset values for
|
---|
| 91 | some filesystems during kernel configuration. The relevant parameters
|
---|
| 92 | are named
|
---|
[c8c2b89] | 93 | <quote>Default NLS Option</quote> (<option>CONFIG_NLS_DEFAULT)</option>,
|
---|
| 94 | <quote>Default Remote NLS Option</quote> (<option>CONFIG_SMB_NLS_DEFAULT</option>),
|
---|
| 95 | <quote>Default codepage for FAT</quote> (<option>CONFIG_FAT_DEFAULT_CODEPAGE</option>), and
|
---|
| 96 | <quote>Default iocharset for FAT</quote> (<option>CONFIG_FAT_DEFAULT_IOCHARSET</option>).
|
---|
[fa21b3d] | 97 | There is no way to specify these settings for the
|
---|
| 98 | ntfs filesystem at kernel compilation time.</para>
|
---|
| 99 | <!-- Personally, I find it more foolproof to always specify the iocharset and
|
---|
| 100 | codepage in /etc/fstab for MS-based filesystems - Alexander E. Patrakov -->
|
---|
| 101 |
|
---|
[af611557] | 102 | <para>It is possible to make the ext3 filesystem reliable across power
|
---|
| 103 | failures for some hard disk types. To do this, add the
|
---|
| 104 | <option>barrier=1</option> mount option to the appropriate entry in
|
---|
| 105 | <filename>/etc/fstab</filename>. To check if the disk drive supports
|
---|
[2ca8941] | 106 | this option, run
|
---|
[af611557] | 107 | <ulink url="http://www.linuxfromscratch.org/blfs/view/cvs/general/hdparm.html">hdparm</ulink>
|
---|
| 108 | on the applicable disk drive. For example, if:</para>
|
---|
| 109 |
|
---|
[5612386] | 110 | <screen role="nodump"><userinput>hdparm -I /dev/sda | grep NCQ</userinput></screen>
|
---|
[af611557] | 111 |
|
---|
| 112 | <para>returns non-empty output, the option is supported.</para>
|
---|
| 113 |
|
---|
| 114 | <para>Note: Logical Volume Management (LVM) based partitions cannot use the
|
---|
| 115 | <option>barrier</option> option.</para>
|
---|
| 116 |
|
---|
[6370fa6] | 117 | </sect1>
|
---|