fstab.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. A new file <filename>/etc/fstab</filename> is created 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, note that you must also create the /dev/pts directory for this
  26. to work:</para>
  27. <para><screen>none /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. This time, you don't create the directory as it's part of the
  30. proc virtual filesystem:</para>
  31. <para><screen>none /proc/bus/usb usbdevfs defaults 0 0</screen></para>
  32. <para>Both of these options will only work if you have the relevant
  33. support compiled into your kernel.</para>
  34. </sect1>