device and filesystem
Most devices are indicated by a filename (of a block special device),
like /dev/sda1, but there are other possibilities. For example, in the
case of an NFS mount, device may look like knuth.cwi.nl:/dir.
The device names of disk partitions are unstable; hardware
reconfiguration, and adding or removing a device can cause changes in
names. This is the reason why it’s strongly recommended to use
filesystem or partition identifiers like UUID or LABEL. Currently
supported identifiers (tags):
LABEL=label
Human readable filesystem identifier. See also -L.
UUID=uuid
Filesystem universally unique identifier. The format of the UUID is
usually a series of hex digits separated by hyphens. See also -U.
Note that mount uses UUIDs as strings. The UUIDs from the command
line or from fstab(5) are not converted to internal binary
representation. The string representation of the UUID should be
based on lower case characters.
PARTLABEL=label
Human readable partition identifier. This identifier is independent
on filesystem and does not change by mkfs or mkswap operations. It’s
supported for example for GUID Partition Tables (GPT).
PARTUUID=uuid
Partition universally unique identifier. This identifier is
independent on filesystem and does not change by mkfs or mkswap
operations. It’s supported for example for GUID Partition Tables
(GPT).
ID=id
Hardware block device ID as generated by udevd. This identifier is
usually based on WWN (unique storage identifier) and assigned by the
hardware manufacturer. See ls /dev/disk/by-id for more details, this
directory and running udevd is required. This identifier is not
recommended for generic use as the identifier is not strictly
defined and it depends on udev, udev rules and hardware.
The command lsblk --fs provides an overview of filesystems, LABELs and
UUIDs on available block devices. The command blkid -p <device> provides
details about a filesystem on the specified device.
Don’t forget that there is no guarantee that UUIDs and labels are really
unique, especially if you move, share or copy the device. Use lsblk -o
+UUID,PARTUUID to verify that the UUIDs are really unique in your
system.
The recommended setup is to use tags (e.g. UUID=uuid) rather than
/dev/disk/by-{label,uuid,id,partuuid,partlabel} udev symlinks in the
/etc/fstab file. Tags are more readable, robust and portable. The
mount(8) command internally uses udev symlinks, so the use of symlinks
in /etc/fstab has no advantage over tags. For more details see
libblkid(3).
The proc filesystem is not associated with a special device, and when
mounting it, an arbitrary keyword - for example, proc - can be used
instead of a device specification. (The customary choice none is less
fortunate: the error message 'none already mounted' from mount can be
confusing.)
The files /etc/fstab, /etc/mtab and /proc/mounts
The file /etc/fstab (see fstab(5)), may contain lines describing what
devices are usually mounted where, using which options. The default
location of the fstab(5) file can be overridden with the --fstab path
command-line option (see below for more details).
The command
mount -a [-t type] [-O optlist]
(usually given in a bootscript) causes all filesystems mentioned in
fstab (of the proper type and/or having or not having the proper
options) to be mounted as indicated, except for those whose line
contains the noauto keyword. Adding the -F option will make mount fork,
so that the filesystems are mounted in