fstab.xml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. <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>[xxx]</replaceable> / <replaceable>[fff]</replaceable> defaults 1 1
  22. /dev/<replaceable>[yyy]</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. shm /dev/shm tmpfs defaults 0 0
  27. # End /etc/fstab</literal>
  28. EOF</userinput></screen>
  29. <para>Replace <replaceable>[xxx]</replaceable>,
  30. <replaceable>[yyy]</replaceable>, and <replaceable>[fff]</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">ext2</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>There are other lines which may be added to the
  47. <filename>/etc/fstab</filename> file. One example is a line for USB
  48. devices:</para>
  49. <screen>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0 </screen>
  50. <para>This option will only work if <quote>Support for Host-side USB</quote>
  51. and <quote>USB device filesystem</quote> are configured in the kernel. If
  52. <quote>Support for Host-side USB</quote> is compiled as a module, then
  53. <filename>usbcore</filename> must be listed in
  54. <filename>/etc/sysconfig/modules</filename>.</para>
  55. </sect1>