RHCSA Filesystem and Mount Configuration Flashcards
6 cards from real RHCSA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 RHCSA Filesystem and Mount Configuration flashcards as text
A system administrator has created an XFS filesystem on `/dev/vg01/data_lv` and needs to ensure it is mounted automatically at `/srv/data` upon system boot. Which of the following `/etc/fstab` entries is the most robust and correct way to achieve this?
Answer: UUID=550e8400-e29b-41d4-a716-446655440000 /srv/data xfs defaults 0 0
The correct `/etc/fstab` entry uses the device's UUID to ensure the correct device is mounted, even if its device name (e.g., `/dev/sdX`) changes. The entry must specify the correct mount point (`/srv/data`), filesystem type (`xfs`), and standard mount options (`defaults`). The final two numbers (`0 0`) are for dump and fsck order, respectively.
To add a new device to `/etc/fstab` for automounting, a system administrator needs to determine the UUID and filesystem type of the partition `/dev/sdb1`. Which of the following commands provides this information most directly?
Answer: blkid /dev/sdb1
The `blkid` command is the standard utility for locating and printing block device attributes, including the UUID and filesystem TYPE, without needing the device to be mounted. `fdisk -l` shows partition information but not the filesystem UUID. `df` only works on already mounted filesystems.
A system running a database requires a new high-performance XFS filesystem. A logical volume has been created at `/dev/vg_db/lv_logs`. Which of the following commands will correctly format this logical volume with the XFS filesystem?
Answer: mkfs.xfs /dev/vg_db/lv_logs
The command to create (format) a filesystem is `mkfs`. For specific filesystem types like XFS, a dedicated utility `mkfs.xfs` is used. While `mkfs -t xfs` can also work, `mkfs.xfs` is the direct command for this purpose.
A system is configured in `/etc/fstab` to mount a non-critical network file share at boot time. However, when the network is down, the system boot process fails while waiting for the share to become available. Which mount option should be added to the `/etc/fstab` entry for this share to allow the system to boot successfully even if the share is unavailable?
Answer: nofail
The `nofail` option instructs the systemd init system not to consider this mount a failure if the device is not available during the boot process. The system will continue booting without waiting for the mount to succeed. While `_netdev` is important for network shares, it does not by itself prevent a boot failure.
A system administrator has created a 2GB swap file at `/swapfile` using `fallocate`. What is the correct sequence of commands to properly configure and activate this new swap file?
Answer: chmod 600 /swapfile; mkswap /swapfile; swapon /swapfile
The correct procedure is to first set restrictive permissions on the file (`chmod 600`) for security. Second, format the file as swap space using `mkswap`. Third, activate the swap space using `swapon`. The order of these steps is critical for proper and secure operation.
A filesystem is mounted at `/opt/data` with the `defaults` options. For security reasons, a system administrator needs to remount it with the `noexec` option to prevent binaries from being executed. Which command will achieve this without interrupting access by unmounting the filesystem?
Answer: mount -o remount,noexec /opt/data
The `mount` command with the `-o remount` option allows changing the mount options of an already-mounted filesystem without unmounting it. This prevents service interruption. New options are specified in a comma-separated list following `remount`.