[519ee45] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-bootable-fstab">
|
---|
| 9 | <?dbhtml filename="fstab.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Creating the /etc/fstab File</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-bootable-fstab">
|
---|
| 14 | <primary sortas="e-/etc/fstab">/etc/fstab</primary>
|
---|
| 15 | </indexterm>
|
---|
| 16 |
|
---|
| 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>
|
---|
| 21 |
|
---|
| 22 | <screen><userinput>cat > /etc/fstab << "EOF"
|
---|
| 23 | <literal># Begin /etc/fstab
|
---|
| 24 |
|
---|
| 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 defaults 0 0
|
---|
| 31 | sysfs /sys sysfs defaults 0 0
|
---|
| 32 | devpts /dev/pts devpts gid=4,mode=620 0 0
|
---|
| 33 | shm /dev/shm tmpfs defaults 0 0
|
---|
| 34 | # End /etc/fstab</literal>
|
---|
| 35 | EOF</userinput></screen>
|
---|
| 36 |
|
---|
| 37 | <para>Replace <replaceable><xxx></replaceable>,
|
---|
| 38 | <replaceable><yyy></replaceable>, and <replaceable><fff></replaceable>
|
---|
| 39 | with the values appropriate for the system, for example, <filename
|
---|
| 40 | class="partition">hda2</filename>, <filename
|
---|
| 41 | class="partition">hda5</filename>, and <systemitem
|
---|
| 42 | class="filesystem">ext3</systemitem>. For details on the six
|
---|
| 43 | fields in this file, see <command>man 5 fstab</command>.</para>
|
---|
| 44 |
|
---|
| 45 | <para>The <filename class="directory">/dev/shm</filename> mount point
|
---|
| 46 | for <systemitem class="filesystem">tmpfs</systemitem> is included to
|
---|
| 47 | allow enabling POSIX-shared memory. The kernel must have the required
|
---|
| 48 | support built into it for this to work (more about this is in the next
|
---|
| 49 | section). Please note that very little software currently uses
|
---|
| 50 | POSIX-shared memory. Therefore, consider the <filename
|
---|
| 51 | class="directory">/dev/shm</filename> mount point optional. For more
|
---|
| 52 | information, see
|
---|
| 53 | <filename>Documentation/filesystems/tmpfs.txt</filename> in the kernel
|
---|
| 54 | source tree.</para>
|
---|
| 55 |
|
---|
| 56 | <para>Filesystems with MS-DOS or Windows origin (i.e.: vfat, ntfs, smbfs, cifs,
|
---|
| 57 | iso9660, udf) need the <quote>iocharset</quote> mount option in order for
|
---|
| 58 | non-ASCII characters in file names to be interpreted properly. The value
|
---|
| 59 | of this option should be the same as the character set of your locale,
|
---|
| 60 | adjusted in such a way that the kernel understands it. This works if the
|
---|
| 61 | relevant character set definition (found under File systems ->
|
---|
| 62 | Native Language Support) has been compiled into the kernel
|
---|
| 63 | or built as a module. The <quote>codepage</quote> option is also needed for
|
---|
| 64 | vfat and smbfs filesystems. It
|
---|
| 65 | should be set to the codepage number used under MS-DOS in your country. E.g.,
|
---|
| 66 | in order to mount USB flash drives, a ru_RU.KOI8-R user would need the
|
---|
| 67 | following line in <filename>/etc/fstab</filename>:</para>
|
---|
| 68 |
|
---|
| 69 | <screen>/dev/sda1 /media/flash vfat noauto,user,quiet,showexec,iocharset=koi8r,codepage=866 0 0</screen>
|
---|
| 70 |
|
---|
| 71 | <para>The corresponding line for ru_RU.UTF-8 users is:</para>
|
---|
| 72 |
|
---|
| 73 | <screen>/dev/sda1 /media/flash vfat noauto,user,quiet,showexec,iocharset=utf8,codepage=866 0 0</screen>
|
---|
| 74 |
|
---|
| 75 | <note><para>In the latter case, the kernel emits the following message:</para>
|
---|
| 76 |
|
---|
| 77 | <screen><computeroutput>FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!</computeroutput></screen>
|
---|
| 78 |
|
---|
| 79 | <para>This negative recommendation should be ignored, since all other values
|
---|
| 80 | of the <quote>iocharset</quote> option result in wrong display of filenames in
|
---|
| 81 | UTF-8 locales.</para></note>
|
---|
| 82 |
|
---|
| 83 | <para>It is also possible to specify default codepage and iocharset values for
|
---|
| 84 | some filesystems during kernel configuration. The relevant parameters
|
---|
| 85 | are named
|
---|
| 86 | <quote>Default NLS Option</quote> (CONFIG_NLS_DEFAULT),
|
---|
| 87 | <quote>Default Remote NLS Option</quote> (CONFIG_SMB_NLS_DEFAULT),
|
---|
| 88 | <quote>Default codepage for FAT</quote> (CONFIG_FAT_DEFAULT_CODEPAGE), and
|
---|
| 89 | <quote>Default iocharset for FAT</quote> (CONFIG_FAT_DEFAULT_IOCHARSET).
|
---|
| 90 | There is no way to specify these settings for the
|
---|
| 91 | ntfs filesystem at kernel compilation time.</para>
|
---|
| 92 | <!-- Personally, I find it more foolproof to always specify the iocharset and
|
---|
| 93 | codepage in /etc/fstab for MS-based filesystems - Alexander E. Patrakov -->
|
---|
| 94 |
|
---|
| 95 | </sect1>
|
---|