fstab.xml 4.7 KB

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