Options for Identifying Intended Partition in /etc/fstab

Explicit Device and Alternative Identifiers | Linux Certification Exam

Question

Instead of supplying an explicit device in /etc/fstab for mounting, what other options may be used to identify the intended partition? (Choose TWO correct answers.)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

CE

In Linux, the /etc/fstab file is used to define how filesystems should be mounted during the boot process. When mounting a filesystem, an explicit device name or a combination of options can be used to identify the intended partition.

Here are the two options that can be used instead of supplying an explicit device in /etc/fstab:

  1. LABEL: A label is a user-defined string that is associated with a filesystem. A label can be assigned to a partition using the e2label or tune2fs command. When the filesystem is mounted using the label, the mount command looks up the label in /etc/fstab to determine the device name and mount options.

For example, to mount a filesystem with the label mydata, the /etc/fstab entry would look like this:

bash
LABEL=mydata /mnt/data ext4 defaults 0 2
  1. UUID: A UUID (Universally Unique Identifier) is a unique identifier assigned to a filesystem. UUIDs are assigned by the filesystem when it is created, and they can be displayed using the blkid command. When the filesystem is mounted using the UUID, the mount command looks up the UUID in /etc/fstab to determine the device name and mount options.

For example, to mount a filesystem with the UUID 5d5f5e5c-8863-4d28-bf06-7892c83b795f, the /etc/fstab entry would look like this:

bash
UUID=5d5f5e5c-8863-4d28-bf06-7892c83b795f /mnt/data ext4 defaults 0 2

In summary, the LABEL and UUID options can be used instead of supplying an explicit device in /etc/fstab to identify the intended partition. These options are useful when the device names may change, such as when using removable storage devices or when adding new hard drives to a system.