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