fstab.xml 1.7 KB

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