2024-01-18 19:53:23 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2007-03-21 18:42:58 +00:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
2004-05-03 11:59:46 +01:00
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
2005-12-18 13:44:24 +00:00
|
|
|
|
2004-01-27 22:29:49 +00:00
|
|
|
<sect1 id="ch-bootable-fstab">
|
2005-12-18 13:44:24 +00:00
|
|
|
<?dbhtml filename="fstab.html"?>
|
|
|
|
|
|
|
|
<title>Creating the /etc/fstab File</title>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2005-12-18 13:44:24 +00:00
|
|
|
<indexterm zone="ch-bootable-fstab">
|
|
|
|
<primary sortas="e-/etc/fstab">/etc/fstab</primary>
|
|
|
|
</indexterm>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2005-12-18 13:44:24 +00:00
|
|
|
<para>The <filename>/etc/fstab</filename> file is used by some programs to
|
|
|
|
determine where file systems are to be mounted by default, in which order, and
|
|
|
|
which must be checked (for integrity errors) prior to mounting. Create a new
|
|
|
|
file systems table like this:</para>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2016-05-24 22:24:59 +01:00
|
|
|
<screen revision="sysv"><userinput>cat > /etc/fstab << "EOF"
|
2005-01-30 12:51:22 +00:00
|
|
|
<literal># Begin /etc/fstab
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2023-07-28 12:59:01 +01:00
|
|
|
# file system mount-point type options dump fsck
|
|
|
|
# order
|
|
|
|
|
|
|
|
/dev/<replaceable><xxx></replaceable> / <replaceable><fff></replaceable> defaults 1 1
|
|
|
|
/dev/<replaceable><yyy></replaceable> swap swap pri=1 0 0
|
|
|
|
proc /proc proc nosuid,noexec,nodev 0 0
|
|
|
|
sysfs /sys sysfs nosuid,noexec,nodev 0 0
|
|
|
|
devpts /dev/pts devpts gid=5,mode=620 0 0
|
|
|
|
tmpfs /run tmpfs defaults 0 0
|
|
|
|
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
|
|
|
|
tmpfs /dev/shm tmpfs nosuid,nodev 0 0
|
|
|
|
cgroup2 /sys/fs/cgroup cgroup2 nosuid,noexec,nodev 0 0
|
2012-01-16 18:34:31 +00:00
|
|
|
|
2016-05-24 22:24:59 +01:00
|
|
|
# End /etc/fstab</literal>
|
|
|
|
EOF</userinput></screen>
|
|
|
|
|
|
|
|
<screen revision="systemd"><userinput>cat > /etc/fstab << "EOF"
|
|
|
|
<literal># Begin /etc/fstab
|
|
|
|
|
|
|
|
# file system mount-point type options dump fsck
|
|
|
|
# order
|
|
|
|
|
|
|
|
/dev/<replaceable><xxx></replaceable> / <replaceable><fff></replaceable> defaults 1 1
|
|
|
|
/dev/<replaceable><yyy></replaceable> swap swap pri=1 0 0
|
|
|
|
|
2005-01-30 12:51:22 +00:00
|
|
|
# End /etc/fstab</literal>
|
2004-06-19 18:46:53 +01:00
|
|
|
EOF</userinput></screen>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2006-04-14 10:37:17 +01:00
|
|
|
<para>Replace <replaceable><xxx></replaceable>,
|
|
|
|
<replaceable><yyy></replaceable>, and <replaceable><fff></replaceable>
|
2005-12-18 13:44:24 +00:00
|
|
|
with the values appropriate for the system, for example, <filename
|
2013-03-24 19:23:53 +00:00
|
|
|
class="partition">sda2</filename>, <filename
|
|
|
|
class="partition">sda5</filename>, and <systemitem
|
2013-05-20 04:00:52 +01:00
|
|
|
class="filesystem">ext4</systemitem>. For details on the six
|
2024-01-25 17:49:29 +00:00
|
|
|
fields in this file, see <ulink role='man' url='&man;fstab.5'>fstab(5)</ulink>.</para>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2018-05-16 21:54:19 +01:00
|
|
|
<para>Filesystems with MS-DOS or Windows origin (i.e. vfat, ntfs, smbfs,
|
|
|
|
cifs, iso9660, udf) need a special option, utf8, in order for non-ASCII
|
|
|
|
characters in file names to be interpreted properly. For non-UTF-8 locales,
|
|
|
|
the value of <option>iocharset</option> should be set to be the same as the
|
|
|
|
character set of the locale, adjusted in such a way that the kernel
|
|
|
|
understands it. This works if the relevant character set definition (found
|
|
|
|
under File systems -> Native Language Support when configuring the kernel)
|
|
|
|
has been compiled into the kernel or built as a module. However, if the
|
|
|
|
character set of the locale is UTF-8, the corresponding option
|
|
|
|
<option>iocharset=utf8</option> would make the file system case sensitive. To
|
|
|
|
fix this, use the special option <option>utf8</option> instead of
|
|
|
|
<option>iocharset=utf8</option>, for UTF-8 locales. The
|
|
|
|
<quote>codepage</quote> option is also needed for vfat and smbfs filesystems.
|
|
|
|
It should be set to the codepage number used under MS-DOS in your country.
|
|
|
|
For example, in order to mount USB flash drives, a ru_RU.KOI8-R user would
|
|
|
|
need the following in the options portion of its mount line in
|
|
|
|
<filename>/etc/fstab</filename>:</para>
|
|
|
|
|
|
|
|
<screen><literal>noauto,user,quiet,showexec,codepage=866,iocharset=koi8r</literal></screen>
|
2006-01-06 01:59:08 +00:00
|
|
|
|
2007-04-05 20:03:40 +01:00
|
|
|
<para>The corresponding options fragment for ru_RU.UTF-8 users is:</para>
|
2006-01-06 01:59:08 +00:00
|
|
|
|
2018-05-16 21:54:19 +01:00
|
|
|
<screen><literal>noauto,user,quiet,showexec,codepage=866,utf8</literal></screen>
|
2006-01-06 01:59:08 +00:00
|
|
|
|
2018-05-16 21:54:19 +01:00
|
|
|
<para>Note that using <option>iocharset</option> is the default for
|
|
|
|
<literal>iso8859-1</literal> (which keeps the file system case
|
|
|
|
insensitive), and the <option>utf8</option> option tells
|
|
|
|
the kernel to convert the file names using UTF-8 so they can be
|
|
|
|
interpreted in the UTF-8 locale.</para>
|
|
|
|
|
|
|
|
<!--note>
|
2006-08-03 20:29:29 +01:00
|
|
|
<para>In the latter case, the kernel emits the following message:</para>
|
2006-01-06 01:59:08 +00:00
|
|
|
|
2006-08-03 20:29:29 +01:00
|
|
|
<screen><computeroutput>FAT: utf8 is not a recommended IO charset for FAT filesystems,
|
|
|
|
filesystem will be case sensitive!</computeroutput></screen>
|
2006-01-06 01:59:08 +00:00
|
|
|
|
2006-08-03 20:29:29 +01:00
|
|
|
<para>This negative recommendation should be ignored, since all other values
|
|
|
|
of the <quote>iocharset</quote> option result in wrong display of filenames in
|
|
|
|
UTF-8 locales.</para>
|
2018-05-16 21:54:19 +01:00
|
|
|
</note-->
|
2006-01-06 01:59:08 +00:00
|
|
|
|
|
|
|
<para>It is also possible to specify default codepage and iocharset values for
|
|
|
|
some filesystems during kernel configuration. The relevant parameters
|
|
|
|
are named
|
2007-04-08 21:10:05 +01:00
|
|
|
<quote>Default NLS Option</quote> (<option>CONFIG_NLS_DEFAULT)</option>,
|
|
|
|
<quote>Default Remote NLS Option</quote> (<option>CONFIG_SMB_NLS_DEFAULT</option>),
|
|
|
|
<quote>Default codepage for FAT</quote> (<option>CONFIG_FAT_DEFAULT_CODEPAGE</option>), and
|
|
|
|
<quote>Default iocharset for FAT</quote> (<option>CONFIG_FAT_DEFAULT_IOCHARSET</option>).
|
2006-01-06 01:59:08 +00:00
|
|
|
There is no way to specify these settings for the
|
|
|
|
ntfs filesystem at kernel compilation time.</para>
|
|
|
|
|
2009-05-17 03:52:18 +01:00
|
|
|
<para>It is possible to make the ext3 filesystem reliable across power
|
|
|
|
failures for some hard disk types. To do this, add the
|
|
|
|
<option>barrier=1</option> mount option to the appropriate entry in
|
|
|
|
<filename>/etc/fstab</filename>. To check if the disk drive supports
|
2013-02-11 20:09:22 +00:00
|
|
|
this option, run
|
2015-01-23 21:28:48 +00:00
|
|
|
<ulink url="&blfs-book;general/hdparm.html">hdparm</ulink>
|
2009-05-17 03:52:18 +01:00
|
|
|
on the applicable disk drive. For example, if:</para>
|
|
|
|
|
2009-05-19 03:49:45 +01:00
|
|
|
<screen role="nodump"><userinput>hdparm -I /dev/sda | grep NCQ</userinput></screen>
|
2009-05-17 03:52:18 +01:00
|
|
|
|
|
|
|
<para>returns non-empty output, the option is supported.</para>
|
|
|
|
|
|
|
|
<para>Note: Logical Volume Management (LVM) based partitions cannot use the
|
|
|
|
<option>barrier</option> option.</para>
|
|
|
|
|
2001-01-24 00:31:17 +00:00
|
|
|
</sect1>
|