fstab.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. # End /etc/fstab
  15. <userinput>EOF</userinput></screen></para>
  16. <para><userinput>*LFS*</userinput>,
  17. <userinput>*swap*</userinput>
  18. and <userinput>*fs-type*</userinput> have to be replaced with the
  19. appropriate values (/dev/hda2, /dev/hda5 and reiserfs for example).</para>
  20. <para>When adding a reiserfs partition, the <userinput>1 1</userinput> at
  21. the end of the line should be replaced with <userinput>0 0</userinput>.</para>
  22. <para>For more information on the various fields which are in the fstab
  23. file, see <userinput>man 5 fstab</userinput>.</para>
  24. <para>There are other lines which you may consider adding to your fstab
  25. file. One example is the line which you must have if you are using
  26. devpts:</para>
  27. <para><screen>devpts /dev/pts devpts gid=4,mode=620 0 0</screen></para>
  28. <para>Another example is a line to use if you intend to use USB
  29. devices:</para>
  30. <para><screen>usbdevfs /proc/bus/usb usbdevfs defaults 0 0</screen></para>
  31. <para>Both of these options will only work if you have the relevant
  32. support compiled into your kernel.</para>
  33. </sect1>