fstab.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <sect1 id="ch08-fstab">
  2. <title>Creating the /etc/fstab file</title>
  3. <?dbhtml filename="fstab.html" dir="chapter08"?>
  4. <para>In order for certain programs to be able to determine where certain
  5. partitions are supposed to be mounted by default, the /etc/fstab file is
  6. used. Create a new file <filename>/etc/fstab</filename> containing the
  7. following:</para>
  8. <para><screen><userinput>cat &gt; /etc/fstab &lt;&lt; "EOF"</userinput>
  9. # Begin /etc/fstab
  10. # filesystem mount-point fs-type options dump fsck-order
  11. /dev/*LFS* / *fs-type* defaults 1 1
  12. /dev/*swap* swap swap pri=1 0 0
  13. proc /proc proc defaults 0 0
  14. shm /dev/shm tmpfs defaults 0 0
  15. # End /etc/fstab
  16. <userinput>EOF</userinput></screen></para>
  17. <para><userinput>*LFS*</userinput>,
  18. <userinput>*swap*</userinput>
  19. and <userinput>*fs-type*</userinput> have to be replaced with the
  20. appropriate values (/dev/hda2, /dev/hda5 and reiserfs for example).</para>
  21. <para>When adding a reiserfs partition, the <userinput>1 1</userinput> at
  22. the end of the line should be replaced with <userinput>0 0</userinput>.</para>
  23. <para>A tmpfs mount is added at /dev/shm to comply with Posix shared memory
  24. requirements. For more information, see the file
  25. Documentation/filesystems/tmpfs.txt in the kernel source tree.</para>
  26. <para>For more information on the various fields which are in the fstab
  27. file, see <userinput>man 5 fstab</userinput>.</para>
  28. <para>There are other lines which you may consider adding to your fstab
  29. file. One example is the line which you must have if you are using
  30. devpts:</para>
  31. <para><screen>devpts /dev/pts devpts gid=4,mode=620 0 0</screen></para>
  32. <para>Another example is a line to use if you intend to use USB
  33. devices:</para>
  34. <para><screen>usbfs /proc/bus/usb usbfs defaults 0 0</screen></para>
  35. <para>Both of these options will only work if you have the relevant
  36. support compiled into your kernel.</para>
  37. </sect1>