fstab.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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>The <filename class="directory">/dev/shm</filename> mount point
  34. for <systemitem class="filesystem">tmpfs</systemitem> is included to
  35. allow enabling POSIX-shared memory. The kernel must have the required
  36. support built into it for this to work (more about this is in the next
  37. section). Please note that very little software currently uses
  38. POSIX-shared memory. Therefore, consider the <filename
  39. class="directory">/dev/shm</filename> mount point optional. For more
  40. information, see
  41. <filename>Documentation/filesystems/tmpfs.txt</filename> in the kernel
  42. source tree.</para>
  43. <para>There are other lines which may be added to the
  44. <filename>/etc/fstab</filename> file. One example is a line for USB
  45. devices:</para>
  46. <screen>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0 </screen>
  47. <para>This option will only work if <quote>Support for Host-side USB</quote> and
  48. <quote>USB device filesystem</quote> are configured in the kernel. If
  49. <quote>Support for Host-side USB</quote> is compiled as a module, then
  50. <filename>usbcore</filename> must be listed in
  51. <filename>/etc/sysconfig/modules</filename>.</para>
  52. </sect1>