fstab.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-bootable-fstab">
  7. <title>Creating the /etc/fstab File</title>
  8. <?dbhtml filename="fstab.html"?>
  9. <indexterm zone="ch-bootable-fstab"><primary sortas="e-/etc/fstab">/etc/fstab</primary></indexterm>
  10. <para>The <filename>/etc/fstab</filename> file is used by some programs to
  11. determine where file systems are to be mounted by default, in which order, and
  12. which must be checked (for integrity errors) prior to mounting. Create a new
  13. file systems table like this:</para>
  14. <screen><userinput>cat &gt; /etc/fstab &lt;&lt; "EOF"
  15. <literal># Begin /etc/fstab
  16. # file system mount-point type options dump fsck
  17. # order
  18. /dev/<replaceable>[xxx]</replaceable> / <replaceable>[fff]</replaceable> defaults 1 1
  19. /dev/<replaceable>[yyy]</replaceable> swap swap pri=1 0 0
  20. proc /proc proc defaults 0 0
  21. sysfs /sys sysfs defaults 0 0
  22. devpts /dev/pts devpts gid=4,mode=620 0 0
  23. shm /dev/shm tmpfs defaults 0 0
  24. # End /etc/fstab</literal>
  25. EOF</userinput></screen>
  26. <para>Replace <replaceable>[xxx]</replaceable>,
  27. <replaceable>[yyy]</replaceable>, and <replaceable>[fff]</replaceable>
  28. with the values appropriate for the system, for example, <filename
  29. class="partition">hda2</filename>, <filename
  30. class="partition">hda5</filename>, and <systemitem
  31. class="filesystem">ext2</systemitem>. For details on the six
  32. fields in this file, see <command>man 5 fstab</command>.</para>
  33. <para>When using a journalling file system, the <parameter>1
  34. 1</parameter> at the end of the line should be replaced with
  35. <parameter>0 0</parameter> because such a partition does not need to
  36. be dumped or checked.</para>
  37. <para>The <filename class="directory">/dev/shm</filename> mount point
  38. for <systemitem class="filesystem">tmpfs</systemitem> is included to
  39. allow enabling POSIX-shared memory. The kernel must have the required
  40. support built into it for this to work (more about this is in the next
  41. section). Please note that very little software currently uses
  42. POSIX-shared memory. Therefore, consider the <filename
  43. class="directory">/dev/shm</filename> mount point optional. For more
  44. information, see
  45. <filename>Documentation/filesystems/tmpfs.txt</filename> in the kernel
  46. source tree.</para>
  47. <para>There are other lines which may be added to the
  48. <filename>/etc/fstab</filename> file. One example is a line for USB
  49. devices:</para>
  50. <screen>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0 </screen>
  51. <para>This option will only work if <quote>Support for Host-side USB</quote> and
  52. <quote>USB device filesystem</quote> are configured in the kernel. If
  53. <quote>Support for Host-side USB</quote> is compiled as a module, then
  54. <filename>usbcore</filename> must be listed in
  55. <filename>/etc/sysconfig/modules</filename>.</para>
  56. </sect1>