1 | <sect1 id="ch08-fstab">
|
---|
2 | <title>Creating the /etc/fstab file</title>
|
---|
3 | <?dbhtml filename="fstab.html" dir="chapter08"?>
|
---|
4 |
|
---|
5 | <para>In order for certain programs to be able to determine where certain
|
---|
6 | partitions are supposed to be mounted by default, the /etc/fstab file is
|
---|
7 | used. Create a new file <filename>/etc/fstab</filename> containing the
|
---|
8 | following:</para>
|
---|
9 |
|
---|
10 | <para><screen><userinput>cat > /etc/fstab << "EOF"</userinput>
|
---|
11 | # Begin /etc/fstab
|
---|
12 |
|
---|
13 | # filesystem mount-point fs-type options dump fsck-order
|
---|
14 |
|
---|
15 | /dev/*LFS* / *fs-type* defaults 1 1
|
---|
16 | /dev/*swap* swap swap pri=1 0 0
|
---|
17 | proc /proc proc defaults 0 0
|
---|
18 | shm /dev/shm tmpfs defaults 0 0
|
---|
19 |
|
---|
20 | # End /etc/fstab
|
---|
21 | <userinput>EOF</userinput></screen></para>
|
---|
22 |
|
---|
23 | <para><userinput>*LFS*</userinput>,
|
---|
24 | <userinput>*swap*</userinput>
|
---|
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 |
|
---|
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 |
|
---|
35 | <para>For more information on the various fields which are in the fstab
|
---|
36 | file, see <userinput>man 5 fstab</userinput>.</para>
|
---|
37 |
|
---|
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
|
---|
40 | devpts:</para>
|
---|
41 |
|
---|
42 | <para><screen>devpts /dev/pts devpts gid=4,mode=620 0 0</screen></para>
|
---|
43 |
|
---|
44 | <para>Another example is a line to use if you intend to use USB
|
---|
45 | devices:</para>
|
---|
46 | <para><screen>usbfs /proc/bus/usb usbfs defaults 0 0</screen></para>
|
---|
47 |
|
---|
48 | <para>Both of these options will only work if you have the relevant
|
---|
49 | support compiled into your kernel.</para>
|
---|
50 |
|
---|
51 | </sect1>
|
---|
52 |
|
---|