fstab.xml 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. # End /etc/fstab</literal>
  24. EOF</userinput></screen>
  25. <para>Replace <replaceable>&lt;xxx&gt;</replaceable>,
  26. <replaceable>&lt;yyy&gt;</replaceable>, and <replaceable>&lt;fff&gt;</replaceable>
  27. with the values appropriate for the system, for example, <filename
  28. class="partition">sda2</filename>, <filename
  29. class="partition">sda5</filename>, and <systemitem
  30. class="filesystem">ext4</systemitem>. For details on the six
  31. fields in this file, see <command>man 5 fstab</command>.</para>
  32. <para>Filesystems with MS-DOS or Windows origin (i.e.: vfat, ntfs, smbfs, cifs,
  33. iso9660, udf) need the <quote>iocharset</quote> mount option in order for
  34. non-ASCII characters in file names to be interpreted properly. The value
  35. of this option should be the same as the character set of your locale,
  36. adjusted in such a way that the kernel understands it. This works if the
  37. relevant character set definition (found under File systems -&gt;
  38. Native Language Support) has been compiled into the kernel
  39. or built as a module. The <quote>codepage</quote> option is also needed for
  40. vfat and smbfs filesystems. It should be set to the codepage number used
  41. under MS-DOS in your country. E.g., in order to mount USB flash drives, a
  42. ru_RU.KOI8-R user would need the following in the options portion of its
  43. mount line in <filename>/etc/fstab</filename>:</para>
  44. <screen><literal>noauto,user,quiet,showexec,iocharset=koi8r,codepage=866</literal></screen>
  45. <para>The corresponding options fragment for ru_RU.UTF-8 users is:</para>
  46. <screen><literal>noauto,user,quiet,showexec,iocharset=utf8,codepage=866</literal></screen>
  47. <note>
  48. <para>In the latter case, the kernel emits the following message:</para>
  49. <screen><computeroutput>FAT: utf8 is not a recommended IO charset for FAT filesystems,
  50. filesystem will be case sensitive!</computeroutput></screen>
  51. <para>This negative recommendation should be ignored, since all other values
  52. of the <quote>iocharset</quote> option result in wrong display of filenames in
  53. UTF-8 locales.</para>
  54. </note>
  55. <para>It is also possible to specify default codepage and iocharset values for
  56. some filesystems during kernel configuration. The relevant parameters
  57. are named
  58. <quote>Default NLS Option</quote> (<option>CONFIG_NLS_DEFAULT)</option>,
  59. <quote>Default Remote NLS Option</quote> (<option>CONFIG_SMB_NLS_DEFAULT</option>),
  60. <quote>Default codepage for FAT</quote> (<option>CONFIG_FAT_DEFAULT_CODEPAGE</option>), and
  61. <quote>Default iocharset for FAT</quote> (<option>CONFIG_FAT_DEFAULT_IOCHARSET</option>).
  62. There is no way to specify these settings for the
  63. ntfs filesystem at kernel compilation time.</para>
  64. <para>It is possible to make the ext3 filesystem reliable across power
  65. failures for some hard disk types. To do this, add the
  66. <option>barrier=1</option> mount option to the appropriate entry in
  67. <filename>/etc/fstab</filename>. To check if the disk drive supports
  68. this option, run
  69. <ulink url="&blfs-book;general/hdparm.html">hdparm</ulink>
  70. on the applicable disk drive. For example, if:</para>
  71. <screen role="nodump"><userinput>hdparm -I /dev/sda | grep NCQ</userinput></screen>
  72. <para>returns non-empty output, the option is supported.</para>
  73. <para>Note: Logical Volume Management (LVM) based partitions cannot use the
  74. <option>barrier</option> option.</para>
  75. </sect1>