Courseiva

CCNA Create and configure file systems Questions

73 questions · Create and configure file systems · All types, answers revealed

1
Multi-Selectmedium

Which THREE of the following commands can be used to display information about file systems?

Select 3 answers
A.df
B.blkid
C.lsblk
D.fdisk
E.du
AnswersA, B, C

df displays information about mounted filesystems, including total size, used space, available space, and the mount point, by reading filesystem statistics via statfs(2). This makes it the standard command for checking how full a mounted filesystem is. Unlike du, it does not walk the directory tree; it queries the filesystem itself.

Why this answer

The `df` command displays information about mounted file systems, including total size, used space, available space, and mount points. It reads the /proc/mounts file to show file system usage statistics, making it a primary tool for file system information.

Exam trap

Red Hat often tests the distinction between disk partitioning tools (fdisk) and file system information commands, so candidates mistakenly select fdisk because it lists partitions, but it does not display file system details like type or usage.

2
MCQeasy

What is the default filesystem type in Red Hat Enterprise Linux 8?

A.btrfs
B.ZFS
C.ext4
D.XFS
AnswerD

XFS is the correct default filesystem in RHEL 8. Since RHEL 7, XFS has been the default choice, and it continues in RHEL 8 due to its scalability for large storage systems, metadata journaling, and support for online, non-destructive growth. Anaconda, the RHEL installer, preselects XFS for the root filesystem on new installations unless an administrator explicitly changes it.

Why this answer

In Red Hat Enterprise Linux 8, the default filesystem type is XFS. XFS is a high-performance 64-bit journaling filesystem that supports large files and filesystems, and it has been the default since RHEL 7. The Anaconda installer selects XFS by default for the root filesystem during a standard installation.

Exam trap

The trap here is that candidates may confuse the default filesystem in RHEL 8 with ext4, which was the default in RHEL 6 and earlier, or mistakenly think btrfs is the default due to its prominence in other distributions like openSUSE.

How to eliminate wrong answers

Option A is wrong because btrfs is not the default filesystem in RHEL 8; it is available as a technology preview but is not the default choice. Option B is wrong because ZFS is not included in RHEL 8 due to licensing incompatibilities (CDDL vs GPL) and is not a supported filesystem. Option C is wrong because ext4, while supported and commonly used in older RHEL versions, is not the default in RHEL 8; XFS replaced ext4 as the default starting in RHEL 7.

3
MCQeasy

In /etc/fstab, which values in the dump and pass fields enable automatic file system checking at boot?

A.dump=1, pass=0
B.dump=0, pass=0
C.dump=0, pass=1
D.dump=1, pass=1
AnswerC

This is the correct setting. A dump value of 0 is the standard choice on modern Linux systems, as dump(8) is obsolete and almost never used. The pass value of 1 tells fsck(8) to check this filesystem at boot, and 1 is specifically used for the root filesystem; other filesystems use pass=2 to run after the root check completes.

Why this answer

The `pass` field in `/etc/fstab` controls the order of file system checks at boot. A value of 1 means the root file system is checked first, and a value of 2 or higher means other file systems are checked after root. The `dump` field is for backup utility (dump) and is not related to boot-time checking; it must be 0 to disable dump.

Thus, `dump=0, pass=1` enables automatic file system checking (fsck) at boot for the root file system.

Exam trap

Red Hat often tests the misconception that `dump=1` is required for boot-time file system checks, but the `dump` field is unrelated to fsck; the trap is confusing the `dump` field with the `pass` field's role in enabling automatic checks.

How to eliminate wrong answers

Option A is wrong because `dump=1` enables dump backups (not boot-time checking), and `pass=0` disables fsck entirely, so no automatic checking occurs. Option B is wrong because `dump=0` and `pass=0` both disable dump and fsck, meaning no file system check at boot. Option D is wrong because `dump=1` enables dump (unnecessary for boot checking) and `pass=1` enables fsck, but the combination is not required; the correct minimal setting for enabling fsck is `dump=0, pass=1`.

4
MCQhard

You are managing a Red Hat Enterprise Linux 9 server that hosts a critical database application. The database stores its data on an XFS filesystem mounted on /data, backed by a logical volume in a volume group named vg_db. Recently, the database team reported that write operations are failing with 'Disk quota exceeded' errors, but the filesystem still shows 40% free space. You check the filesystem quota configuration and find that no user or group quotas are set on /data. The database runs as user 'dbadmin' with group 'dba'. Which of the following is the most likely cause of the 'Disk quota exceeded' error?

A.The logical volume is thin provisioned and the data pool is full.
B.An XFS project quota is configured on the /data directory, limiting the space used by the database files.
C.SELinux is blocking the database writes due to a denial.
D.The filesystem has run out of inodes.
AnswerB

XFS project quotas are designed to limit usage of a directory subtree by assigning a project ID (e.g., project 42) to /data and setting a hard block limit. All files in /data, including the database files, inherit that project ID, and when the aggregate usage reaches the limit, further writes return the 'Disk quota exceeded' (EDQUOT) error. This is exactly the behavior described in the question, making it the correct explanation.

Why this answer

XFS project quotas can limit the total space used by a directory tree, regardless of the user or group that owns the files. Even though no user or group quotas are set, a project quota on /data restricts the database files, causing 'Disk quota exceeded' errors despite 40% free space on the filesystem.

Exam trap

The trap here is that candidates assume 'Disk quota exceeded' always implies user or group quotas are configured, overlooking XFS project quotas which operate on directory trees and are invisible to standard 'quota' or 'repquota' commands without the '-p' flag.

How to eliminate wrong answers

Option A is wrong because a thin-provisioned logical volume with a full data pool would cause 'No space left on device' errors, not 'Disk quota exceeded', and the filesystem would show 0% free space, not 40%. Option C is wrong because SELinux denials produce 'Permission denied' or AVC denial messages, not 'Disk quota exceeded' errors. Option D is wrong because running out of inodes would cause 'No space left on device' errors when creating files, and the filesystem would still show free space, but the error message would be different and the 'df -i' command would show 100% inode usage.

5
MCQmedium

A partition /dev/sdc1 is formatted as ext4. The administrator needs to check the file system for errors without making any repairs. Which command should be used?

A.xfs_repair -n /dev/sdc1
B.fsck -n /dev/sdc1
C.fsck -y /dev/sdc1
D.e2fsck -p /dev/sdc1
AnswerB

fsck is the generic filesystem check front-end that probes the filesystem type on /dev/sdc1 and invokes the appropriate underlying tool, such as e2fsck for ext4. The -n option forces it to answer 'no' to every repair prompt, making the run strictly read-only and non-destructive. This lets the administrator see errors without changing anything, exactly what a dry-run check needs.

Why this answer

The `fsck -n` command checks the file system for errors without making any repairs, as the `-n` flag forces a non-interactive, read-only check. Since /dev/sdc1 is formatted as ext4, `fsck` automatically calls the appropriate ext4-specific tool (e2fsck) with the no-repair option. This matches the requirement to only check for errors without fixing them.

Exam trap

Red Hat often tests the distinction between checking and repairing file systems, and the trap here is that candidates may confuse `-n` (no repair) with `-y` (auto-repair) or assume `xfs_repair -n` works on ext4, not recognizing that file system-specific tools must match the file system type.

How to eliminate wrong answers

Option A is wrong because `xfs_repair -n` is used for XFS file systems, not ext4; /dev/sdc1 is formatted as ext4, so this command is incompatible and would fail. Option C is wrong because `fsck -y` automatically answers 'yes' to all repair prompts, which would make repairs, contradicting the requirement to check without making repairs. Option D is wrong because `e2fsck -p` runs in 'preen' mode, which automatically repairs minor file system issues without prompting, thus performing repairs rather than just checking.

6
MCQeasy

Which command can be used to display a list of all currently mounted filesystems on a Linux system?

A.fdisk -l
B.lsblk -m
C.cat /proc/filesystems
D.df -a
E.mount
AnswerE

Running mount with no arguments displays the kernel's current mount table, typically sourced from /proc/mounts, in a format showing the device, mount point, filesystem type, and mount options (e.g., /dev/sda1 on / type xfs (rw,relatime)). This output is precisely a list of all currently mounted filesystems, including real devices, pseudo-filesystems like sysfs, and bind mounts. As the standard command for mounting and unmounting filesystems, its bare invocation serves as the canonical way to view the complete active mount configuration.

Why this answer

The `mount` command with no arguments displays a list of all currently mounted filesystems, showing the device, mount point, filesystem type, and mount options. This is the standard and most direct way to view active mounts on a Linux system.

Exam trap

The trap here is that candidates confuse commands that list block devices or filesystem types with the command that shows actual mounted filesystems, leading them to pick `lsblk` or `cat /proc/filesystems` instead of `mount`.

How to eliminate wrong answers

Option A is wrong because `fdisk -l` lists partition tables on block devices, not currently mounted filesystems. Option B is wrong because `lsblk -m` lists block devices with their permissions and owners, but does not show mount status or filesystem type details. Option C is wrong because `cat /proc/filesystems` shows which filesystem types are supported by the kernel, not which are currently mounted.

Option D is wrong because `df -a` reports disk space usage for mounted filesystems, but it does not display all mount details such as mount options or device paths for pseudo-filesystems.

7
Multi-Selecthard

Which THREE of the following mount options are commonly used to enhance security on a filesystem?

Select 3 answers
A.nosuid
B.nodev
C.suid
D.defaults
E.noexec
AnswersA, B, E

Mounting a filesystem with nosuid disables the setuid and setgid bits on all executable files within it, so a binary cannot temporarily assume the UID or GID of its file owner. This is critical for partitions like /tmp that are writable by unprivileged users, because a setuid root binary created there could otherwise be exploited for privilege escalation. Administrators commonly include nosuid when mounting removable media or network shares to prevent untrusted binaries from attaining local higher privileges.

Why this answer

The `nosuid` option prevents the set-user-identifier (setuid) and set-group-identifier (setgid) bits from taking effect on the filesystem. This blocks unprivileged users from executing binaries with elevated privileges, a common vector for privilege escalation attacks.

Exam trap

The trap here is that candidates often confuse `defaults` with a secure baseline, not realizing it includes `suid`, `dev`, and `exec` — the very options that security hardening aims to disable.

8
Multi-Selecteasy

Which TWO of the following commands can be used to create an XFS filesystem on a block device?

Select 2 answers
A.mkfs.ext4 /dev/sdb1
B.mkfs.xfs /dev/sdb1
C.xfs_admin /dev/sdb1
D.mke2fs /dev/sdb1
E.mkfs -t xfs /dev/sdb1
AnswersB, E

mkfs.xfs is the XFS-specific formatting utility provided by the xfsprogs package. Running it against /dev/sdb1 initializes the partition with an XFS superblock, allocation-group headers, and the associated metadata structures. It is the canonical, unambiguous command for creating an XFS filesystem, which makes it a correct answer.

Why this answer

The `mkfs.xfs` command (option B) directly creates an XFS filesystem on a block device. The `mkfs -t xfs` command (option E) is the generic front-end that calls the same XFS-specific tool, making both valid. These are the standard methods for formatting a partition with the XFS filesystem in Red Hat Enterprise Linux.

Exam trap

The trap here is that candidates confuse filesystem creation commands with management commands (like `xfs_admin`) or assume `mke2fs` is a generic tool that can create any filesystem type, when it is strictly for ext2/3/4 families.

9
MCQmedium

Refer to the exhibit. An administrator runs xfs_growfs on /dev/sdc1. What is the most likely reason the command succeeded without prior partition resizing?

A.The partition was automatically resized by xfs_growfs
B.The underlying block device (partition or logical volume) was extended before the command
C.The filesystem was already using the full partition size and the command had no effect
D.The filesystem was mounted with the 'grow' option allowing online growth
AnswerB

xfs_growfs works by expanding the filesystem's data allocation structures to consume the additional space that must already exist on the backing device. Before running the command, the administrator must have extended the partition or logical volume using lvextend or a partition editor. When invoked on a mounted XFS filesystem with no arguments, it grows the filesystem to the maximum size permitted by the underlying block device.

Why this answer

xfs_growfs can only expand an XFS filesystem to fill the available space on the underlying block device. If the command succeeded without prior partition resizing, it means the block device (e.g., a partition or logical volume) was already extended beforehand. The filesystem then uses the new space when xfs_growfs is run.

Exam trap

A common misconception is that xfs_growfs can resize the partition itself, but it only expands the filesystem to match an already extended block device (e.g., LVM volume or disk partition).

How to eliminate wrong answers

Option A is wrong because xfs_growfs does not resize partitions; it only grows the filesystem within the existing block device. Option C is wrong because if the filesystem already used the full partition, xfs_growfs would report that no change was needed, but the question states the command 'succeeded' (implying growth occurred). Option D is wrong because there is no 'grow' mount option in XFS; online growth is handled by xfs_growfs itself, not a mount flag.

10
Multi-Selecteasy

Which TWO commands are needed to set up a swap partition on /dev/sdd1 for immediate use?

Select 2 answers
A.swapon /dev/sdd1
B.parted /dev/sdd mkswap
C.mkswap /dev/sdd1
D.swapon -a
E.mkfs.swap /dev/sdd1
AnswersA, C

The swapon command activates an existing swap device. After a partition has been prepared with mkswap, it is not automatically enabled; running swapon /dev/sdd1 makes the kernel immediately use that partition as paging space. Without this step, the swap space remains available only as a prepared but inactive signature on disk.

Why this answer

The `swapon /dev/sdd1` command activates the swap partition immediately, making it available for the kernel to use as virtual memory. Option C is correct because `mkswap /dev/sdd1` writes the swap signature (UUID and swap superblock) to the partition, which is a prerequisite for any swap device to be recognized by the kernel. Together, these two commands first prepare the partition as a swap area and then enable it for immediate use.

Exam trap

Red Hat often tests the distinction between preparing a swap device (`mkswap`) and activating it (`swapon`), and the trap here is that candidates might think `swapon -a` or a single command like `mkfs.swap` is sufficient, when in fact both steps are required and the correct command names are specific.

11
MCQeasy

A system administrator receives alerts that the /var/log partition is 100% full. The partition is on /dev/mapper/vg_log-lv_var_log, formatted with XFS, and is mounted at /var/log. The volume group vg_log has 10GB of free space available. The administrator runs the command `lvextend -L +10G /dev/mapper/vg_log-lv_var_log` successfully, but then `df -h` still shows 100% full. What is the next step the administrator should take to use the newly added space?

A.Run resize2fs /dev/mapper/vg_log-lv_var_log
B.Run xfs_growfs /var/log
C.Reboot the system to remount the filesystem
D.Run fsck /dev/mapper/vg_log-lv_var_log
AnswerB

xfs_growfs is the proper command to expand an XFS filesystem online, and it can be run while the filesystem is mounted. Passing the mount point /var/log instructs the tool to grow the filesystem to consume all available space in the underlying logical volume after an lvextend operation. This command performs the growth without requiring a reboot or unmounting, making it the correct and immediate solution for a full /var/log partition.

Why this answer

After extending the logical volume with `lvextend`, the underlying block device has more space, but the XFS filesystem does not automatically recognize it. The correct next step is to run `xfs_growfs /var/log` to expand the filesystem to fill the newly available space. Unlike ext4, XFS cannot be resized while mounted with `resize2fs`; it requires the XFS-specific `xfs_growfs` command, which can operate on a mounted filesystem.

Exam trap

The trap here is that candidates familiar with ext4 may instinctively choose `resize2fs`, not realizing that XFS requires its own grow command (`xfs_growfs`) and that the filesystem must be explicitly resized after the logical volume extension.

How to eliminate wrong answers

Option A is wrong because `resize2fs` is used for ext2/ext3/ext4 filesystems, not XFS; using it on an XFS filesystem would fail. Option C is wrong because rebooting is unnecessary and would not cause the filesystem to automatically grow; the filesystem must be explicitly resized with `xfs_growfs`. Option D is wrong because `fsck` checks and repairs filesystem metadata, but the filesystem is healthy and simply needs to be grown; running `fsck` would not add the new space.

12
MCQhard

A Red Hat Enterprise Linux 8 server is used as a file server. It has a 1 TB disk /dev/sdc formatted as XFS and mounted at /srv/files. The /etc/fstab entry uses the device name /dev/sdc. After a hardware replacement, the new disk is detected as /dev/sdd, and the server fails to boot because /srv/files cannot be mounted. The administrator used 'blkid' and found the new disk's filesystem UUID is 'abc-123'. What is the best course of action to ensure reliable mounting after future reboots?

A.Add the 'nofail' option to the /etc/fstab entry and reboot
B.Change the /etc/fstab entry to use UUID=abc-123 and run mount -a
C.Create a symbolic link /dev/sdc pointing to /dev/sdd
D.Use PARTUUID instead of UUID in /etc/fstab
AnswerB

Switching the /etc/fstab entry to use the filesystem's UUID (e.g., UUID=abc-123) makes the mount independent of the kernel's device node naming order, because the UUID is burned into the filesystem superblock and remains constant regardless of which /dev/sdX node the disk acquires. After editing the file, running 'mount -a' mounts all entries listed in /etc/fstab that are not already mounted, applying the new configuration immediately without needing a reboot. This is the standard, reliable way to handle devices whose /dev names are not stable.

Why this answer

Using the filesystem UUID in /etc/fstab provides a persistent identifier that remains constant regardless of the device name assigned by the kernel. After the hardware replacement, the disk is detected as /dev/sdd, but its UUID ('abc-123') is unchanged. Changing the fstab entry to UUID=abc-123 ensures the system can reliably mount the filesystem on every boot, as the UUID is tied to the filesystem itself, not the kernel's device enumeration order.

Exam trap

The trap here is that candidates may think using the device name is sufficient because it worked before, or they may overcomplicate the fix with symlinks or PARTUUID, failing to recognize that the filesystem UUID is the simplest and most robust persistent identifier for mounting filesystems in Red Hat Enterprise Linux 8.

How to eliminate wrong answers

Option A is wrong because adding 'nofail' would allow the system to boot even if the mount fails, but it does not fix the root cause—the fstab entry still references the wrong device name (/dev/sdc), so the filesystem would not be mounted at all. Option C is wrong because creating a symbolic link /dev/sdc pointing to /dev/sdd is not persistent across reboots; device names can change again, and udev rules would be needed for a permanent symlink, which is more complex and not the standard best practice. Option D is wrong because PARTUUID identifies the partition table entry, not the filesystem; if the disk is replaced with a different partition layout, the PARTUUID may change, whereas the filesystem UUID remains stable as long as the filesystem is intact.

13
Matchingmedium

Match each command to its function in managing storage.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Partition table manipulator for MBR and GPT

Create a volume group in LVM

Create an ext4 file system on a partition

Attach a file system to a directory

Why these pairings

The correct matches are: fdisk for partition table manipulation, mkfs for filesystem creation, mount for attaching filesystems, and lvcreate for logical volume creation. Common confusions include associating df or du with filesystem creation, and confusing lvcreate with display commands.

14
MCQmedium

Based on the exhibit, which device is used for swap?

A./dev/mapper/vg00-home
B./dev/sda2
C.The UUID deadbeef-cafe-babe-0000-000000000000
D.The UUID abcdef01-2345-6789-abcd-ef0123456789
E.The UUID 12345678-1234-1234-1234-123456789abc
AnswerC

The UUID deadbeef-cafe-babe-0000-000000000000 is the correct answer because the exhibit's fstab excerpt shows this exact UUID in the line that contains the 'swap' keyword in the options field. This UUID is the device identifier that the system uses to find and activate swap space at boot time, either via swapon or through systemd's fstab generator. In modern Linux, swap devices are reliably referenced by UUID to avoid ambiguity if disk device names change.

Why this answer

The exhibit shows a swap partition with the UUID deadbeef-cafe-babe-0000-000000000000. In Red Hat Enterprise Linux, swap devices are identified by their UUID in /etc/fstab, and the 'sw' or 'swap' keyword in the mount options column confirms this. The other UUIDs correspond to non-swap filesystems or are not present in the exhibit.

Exam trap

Red Hat often tests the distinction between device names (like /dev/sda2) and UUIDs, and candidates may mistakenly choose a device name or a UUID from a non-swap filesystem because they overlook the 'swap' keyword in the fstab options column.

How to eliminate wrong answers

Option A is wrong because /dev/mapper/vg00-home is a logical volume typically used for the /home filesystem, not swap; it would have a filesystem type like xfs or ext4, not swap. Option B is wrong because /dev/sda2 is a device name, not a UUID, and the exhibit explicitly shows UUIDs for swap identification; using a device name would be less reliable and not match the exhibit's format. Option D is wrong because the UUID abcdef01-2345-6789-abcd-ef0123456789 is not listed in the exhibit as a swap device; it likely belongs to another filesystem.

Option E is wrong because the UUID 12345678-1234-1234-1234-123456789abc is not present in the exhibit and does not correspond to any swap entry.

15
MCQeasy

Which command creates an XFS filesystem on /dev/nvme0n1p1 and sets the label to 'data'?

A.mkfs.xfs -l data /dev/nvme0n1p1
B.mkfs.xfs -f /dev/nvme0n1p1
C.mkfs.xfs -L data /dev/nvme0n1p1
D.mkfs.xfs -n data /dev/nvme0n1p1
AnswerC

Uppercase -L is the mkfs.xfs option for setting the XFS volume label, and `data` becomes that label on /dev/nvme0n1p1. This creates a filesystem that can later be referenced via `-L data` in mount options or by symlinks under /dev/disk/by-label/. The command is correct as written and satisfies the requirement to create a labeled XFS filesystem.

Why this answer

The `-L` flag in `mkfs.xfs` is used to set the filesystem label. The command `mkfs.xfs -L data /dev/nvme0n1p1` creates an XFS filesystem on the specified partition and assigns it the label 'data'.

Exam trap

The trap here is confusing the `-L` (label) flag with the `-l` (log) flag, as they look similar but have completely different functions in XFS, and candidates often misremember the option letter from other filesystem tools.

How to eliminate wrong answers

Option A is wrong because the `-l` flag in `mkfs.xfs` is used to specify log device or log parameters, not the label; using `-l data` would attempt to set a log parameter named 'data', which is invalid. Option B is wrong because the `-f` flag forces overwrite of an existing filesystem but does not set a label; it would create an unlabeled filesystem. Option D is wrong because the `-n` flag in `mkfs.xfs` is used to specify naming (directory) parameters, not the filesystem label; `-n data` would attempt to set a naming option, not the label.

16
MCQmedium

A filesystem is reported as 'read-only' after a system crash. The admin runs fsck and sees 'clean' status. What is the most likely reason it remains read-only?

A.fsck cannot fix errors on ext4 filesystems.
B.The filesystem is still mounted; fsck cannot fix it while mounted.
C.The filesystem is XFS, and fsck does not repair XFS.
D.fsck detected errors but did not fix them automatically.
AnswerC

This is correct. XFS is not repairable by fsck; fsck only inspects the XFS log to see whether the filesystem was cleanly unmounted and reports a 'clean' status based on that flag alone, without traversing metadata structures. To actually verify and repair an XFS filesystem you must use the dedicated xfs_repair utility, so a read-only XFS filesystem after a crash would still be reported as 'clean' by fsck while remaining unusable for writes.

Why this answer

If fsck reports 'clean', it means no errors were found in the filesystem's journal, so option D is incorrect. Option C is correct because XFS filesystems cannot be repaired by fsck; they require xfs_repair. Running fsck on an XFS filesystem simply reports the clean flag without performing a real check, leaving the kernel to enforce read-only status if any issues persist.

Exam trap

Candidates often assume that 'clean' means the filesystem is fully healthy and that fsck repairs all filesystem types. The trap is that fsck is for ext four, and XFS requires xfs_repair.

How to eliminate wrong answers

Option A is wrong because fsck can fix errors on ext4 filesystems; it is specifically designed to check and repair ext2/3/4 filesystems. Option B is wrong because the question states the admin runs fsck after a system crash, implying the filesystem is not mounted (or fsck would refuse to run with a warning); even if mounted read-only, fsck can still check it, but the issue here is that fsck did not apply repairs. Option C is wrong because the filesystem is reported as ext4 (fsck is run and shows 'clean'), not XFS; XFS uses xfs_repair, not fsck, and the question explicitly mentions fsck.

17
MCQhard

A system has two logical volumes in the same volume group: 'lv_prod' (100% used) and 'lv_backup' (20% used). The administrator wants to allocate 5 GiB from 'lv_backup' to 'lv_prod' without unmounting any filesystems. Is this possible and why?

A.Yes, use lvreduce and lvextend while mounted; ext4 supports online shrinking.
B.No, because LVM does not allow freeing extents from an LV while it is active.
C.No, because ext4 filesystems cannot be shrunk online; they must be unmounted.
D.Yes, use lvresize to move extents between LVs directly.
AnswerC

ext4 filesystems can only be shrunk while unmounted; the resize2fs tool does not support online shrink. Therefore, to free space from an ext4 LV, the filesystem must be unmounted, shrunk, and then the LV reduced, meaning the operation cannot occur while the volume is in use.

Why this answer

Ext4 filesystems do not support online shrinking; they must be unmounted before reducing the logical volume. Since the administrator wants to shrink lv_backup (which is only 20% used) to free 5 GiB, the ext4 filesystem on that LV must be unmounted first. Without unmounting, the lvreduce operation would fail, making the scenario impossible as described.

Exam trap

The trap here is that candidates confuse LVM's ability to resize logical volumes online (which is true for both growth and reduction at the LVM layer) with the filesystem's ability to shrink online, forgetting that ext4 requires unmounting for shrink operations.

How to eliminate wrong answers

Option A is wrong because ext4 does not support online shrinking; lvreduce on an ext4 filesystem requires the filesystem to be unmounted first, so the statement that ext4 supports online shrinking is false. Option B is wrong because LVM does allow freeing extents from an LV while it is active (the LV can be reduced online), but the filesystem on top (ext4) does not support online shrinking, so the limitation is at the filesystem level, not LVM. Option D is wrong because lvresize cannot move extents directly between LVs; it can only resize individual LVs, and extents must be freed from one LV and then allocated to another using separate lvreduce and lvextend steps, and the filesystem must be unmounted for the shrink.

18
MCQhard

A server has an LVM volume group 'vg_data' with a logical volume 'lv_data' formatted as ext4. The administrator needs to increase the filesystem size by 2 GB without unmounting. Which set of commands should be used?

A.lvresize -L +2G /dev/vg_data/lv_data && xfs_growfs /mountpoint
B.lvextend -L +2G /dev/vg_data/lv_data
C.umount /dev/vg_data/lv_data && lvextend -L +2G /dev/vg_data/lv_data && mount /dev/vg_data/lv_data /mountpoint
D.lvextend -L +2G /dev/vg_data/lv_data && resize2fs /dev/vg_data/lv_data
AnswerD

lvextend -L +2G extends the logical volume by 2 GiB, giving the underlying block device more capacity, and resize2fs then grows the ext4 filesystem online to occupy the newly available space. When invoked without a size argument, resize2fs expands the filesystem to fill the entire LV, and ext4 permits this while the filesystem is mounted, so no unmount is needed.

Why this answer

The filesystem is ext4, which supports online resizing. The `lvextend` command first expands the logical volume by 2 GB, and then `resize2fs` grows the ext4 filesystem to fill the newly allocated space—all without unmounting.

Exam trap

The trap here is that candidates often confuse the filesystem-specific resize commands—using `xfs_growfs` for ext4 or forgetting to run any filesystem resize command after extending the logical volume.

How to eliminate wrong answers

Option A is wrong because `xfs_growfs` is used for XFS filesystems, not ext4; using it on an ext4 filesystem would fail. Option B is wrong because it only extends the logical volume but does not resize the filesystem, leaving the extra space unusable. Option C is wrong because it unnecessarily unmounts and remounts the filesystem; ext4 supports online resizing, so unmounting is not required and adds downtime.

19
MCQeasy

Which command displays the UUID of a filesystem on /dev/sda1?

A.blkid /dev/sda1
B.df -h
C.mount
D.fdisk -l /dev/sda
AnswerA

blkid /dev/sda1 is correct because blkid is a util-linux command that scans the specified block device and prints its detected attributes, including the filesystem UUID, along with the filesystem type and partition label. It reads the superblock directly via libblkid, so the device does not need to be mounted. This is the standard tool for looking up a filesystem's UUID in a scriptable, field-friendly format.

Why this answer

The `blkid` command is specifically designed to locate and print block device attributes, including the UUID (Universally Unique Identifier) of a filesystem. Running `blkid /dev/sda1` queries the device's superblock and outputs the UUID, filesystem type, and other metadata, making it the correct tool for this task.

Exam trap

The trap here is that candidates confuse `blkid` with `fdisk` or `df`, assuming partition tools or mount commands can reveal filesystem UUIDs, when in fact only `blkid` (or `lsblk -f`) directly queries the filesystem superblock for this attribute.

How to eliminate wrong answers

Option B is wrong because `df -h` displays disk space usage for mounted filesystems (human-readable sizes), not UUIDs or low-level device attributes. Option C is wrong because `mount` shows currently mounted filesystems and their mount options, but it does not display the UUID of a device unless the device was mounted by UUID (and even then, it shows the mount source, not a direct UUID query). Option D is wrong because `fdisk -l /dev/sda` lists partition tables (sectors, sizes, types) for the entire disk, but it does not show filesystem UUIDs; it only shows partition UUIDs (PTUUID) and partition type GUIDs on GPT disks, not the filesystem UUID stored in the superblock.

20
MCQmedium

Refer to the exhibit. An administrator tries to mount the partition /dev/sdc1 and gets a superblock error. What is the most likely cause?

A.The filesystem is not recognized; need to install xfsprogs
B.The partition table is corrupted
C.The filesystem has not been created; mkfs.xfs was not run
D.The mount point /mnt/backup does not exist
AnswerC

Although blkid shows a UUID and type, the superblock error indicates the filesystem is not valid. This can happen if the partition was created but not formatted, yet blkid might show leftover metadata. Typically, you must run mkfs.xfs to create the filesystem.

Why this answer

The superblock error indicates that the kernel cannot read the filesystem metadata at the start of the partition. This most commonly occurs when no filesystem has been created on the partition — i.e., mkfs.xfs was never run on /dev/sdc1. Without a valid filesystem superblock, the mount command fails with a 'wrong fs type, bad option, bad superblock' message.

Exam trap

Red Hat often tests the distinction between a partition existing (created with fdisk/gdisk) and a filesystem existing on that partition (created with mkfs), leading candidates to confuse partition table corruption with a missing filesystem.

How to eliminate wrong answers

Option A is wrong because if the xfsprogs package were missing, the system would not have the xfs kernel module or mount helper, but the error would be 'mount: unknown filesystem type' rather than a superblock error. Option B is wrong because a corrupted partition table would prevent the kernel from recognizing the partition at all (e.g., 'no such device' or 'invalid partition table'), not produce a superblock error on a recognized block device. Option D is wrong because if /mnt/backup did not exist, the error would be 'mount point /mnt/backup does not exist', not a superblock error.

21
Multi-Selectmedium

Which TWO commands can be used to check the UUID of a filesystem on /dev/sda1?

Select 2 answers
A.e2label /dev/sda1
B.findmnt /dev/sda1
C.lsblk -o UUID /dev/sda1
D.blkid /dev/sda1
E.file -s /dev/sda1
AnswersC, D

lsblk -o UUID /dev/sda1 is correct because lsblk enumerates block devices and can output any column you request, including UUID. This works without mounting the filesystem and is a direct, efficient way to list the UUID for a specific device like /dev/sda1.

Why this answer

The `blkid` command directly queries the UUID of a block device from the libblkid cache or by reading the filesystem superblock, and `lsblk -o UUID` filters the lsblk output to show only the UUID column for the specified device. Both commands reliably retrieve the UUID of /dev/sda1.

Exam trap

The trap here is that candidates confuse `e2label` (which only handles labels) with UUID retrieval, or assume `findmnt` shows UUIDs by default when it actually requires explicit column selection.

22
MCQmedium

A system administrator runs 'mount -a' and receives an error: 'mount: /mnt/nfs: mount point does not exist'. The /etc/fstab entry is: server:/export /mnt/nfs nfs defaults 0 0. What is the most likely cause?

A.The directory /mnt/nfs does not exist
B.The 'defaults' option does not include '_netdev'
C.The filesystem type should be 'nfs4'
D.The NFS server is unreachable
AnswerA

The error explicitly states the mount point is missing, so the NFS export path is irrelevant until the local directory exists. Creating /mnt/nfs with mkdir -p satisfies the mount point requirement, after which mount -a will succeed provided the server is reachable and the export is permitted.

Why this answer

The error message 'mount: /mnt/nfs: mount point does not exist' explicitly indicates that the directory /mnt/nfs is missing. The 'mount -a' command processes all entries in /etc/fstab, and for each filesystem, it requires the mount point directory to exist before the mount can succeed. Since the directory is absent, the mount fails immediately, regardless of the NFS server status or filesystem type.

Exam trap

Red Hat often tests the distinction between mount point existence errors and network connectivity errors, trapping candidates who assume the issue is with NFS configuration or server reachability when the error message clearly points to a missing local directory.

How to eliminate wrong answers

Option B is wrong because the '_netdev' option is used to indicate that the filesystem requires network access, which is relevant for systemd ordering but does not affect the mount point existence check; the error is about a missing directory, not network dependency. Option C is wrong because 'nfs' is a valid filesystem type that auto-negotiates the NFS version (including NFSv4) with the server; specifying 'nfs4' is not required and would not resolve a missing mount point. Option D is wrong because an unreachable NFS server would produce a different error, such as 'mount.nfs: Connection timed out' or 'No route to host', not a 'mount point does not exist' error.

23
Multi-Selectmedium

An administrator is configuring a new filesystem for a database server that requires high performance and reliability. Which two features should be considered when choosing between ext4 and XFS? (Choose two.)

Select 2 answers
A.Ext4 supports larger files than XFS
B.XFS is optimized for parallel I/O
C.Ext4 has better online resizing capabilities
D.Ext4 supports subvolume snapshots
E.XFS has robust metadata integrity features
AnswersB, E

XFS's on-disk structures, particularly its multiple allocation groups and B-tree-based extent maps, allow concurrent allocations and reads/writes to different file regions without a single global lock. This makes XFS scale nearly linearly with CPU count and mixed parallel workloads, which is exactly what a database server with many concurrent sessions demands. The allocation group design is the key reason XFS outperforms ext4 on parallel I/O patterns.

Why this answer

B is correct because XFS is designed for high-performance, parallel I/O workloads, using allocation groups that allow concurrent operations, making it ideal for database servers. E is correct because XFS employs checksums in its metadata (since RHEL 7) and self-healing capabilities via the reflink feature, providing robust integrity against corruption.

Exam trap

Red Hat often tests the misconception that ext4 is superior for all general-purpose workloads, but the trap here is that candidates overlook XFS's parallel I/O optimization and metadata integrity features, which are specifically required for high-performance database servers.

24
MCQmedium

A technician runs 'mkfs.xfs /dev/sdb1' and later mounts it. The file system is reported as having a block size of 1024 bytes. What is the most likely reason?

A.The administrator used the -b size=1024 option.
B.The block size setting was ignored due to a kernel limitation.
C.The default block size for XFS is 1024 bytes.
D.The partition size is less than 1GB, so mkfs.xfs automatically used a 1024-byte block size.
AnswerD

When the partition on /dev/sdb1 is smaller than 1 GiB, mkfs.xfs automatically uses 1024-byte blocks instead of the usual 4096-byte blocks. This tuning improves space efficiency on small volumes by reducing the overhead associated with larger blocks, such as internal fragmentation and per-block metadata structures. The administrator did not need to specify any option; this is the default behavior for sub-1 GiB XFS filesystems.

Why this answer

Mkfs.xfs automatically selects a 1024-byte block size when the underlying partition is smaller than 1 GB. This is a built-in heuristic in the XFS filesystem to optimize metadata overhead and space utilization on small volumes. The technician did not specify a block size, so the tool applied this default behavior based on partition size.

Exam trap

Red Hat often tests the misconception that XFS always uses a 4096-byte block size, leading candidates to overlook the automatic block size reduction on small partitions.

How to eliminate wrong answers

Option A is wrong because the technician did not use the -b size=1024 option; the question states the command was run without any block size argument. Option B is wrong because there is no kernel limitation that ignores or overrides the block size setting; the kernel fully supports the specified block size. Option C is wrong because the default block size for XFS is 4096 bytes, not 1024 bytes; the 1024-byte block size is only used automatically for partitions smaller than 1 GB.

25
MCQeasy

A system administrator needs to create a file system on a new 10GB partition /dev/sdb1 for use with a database that requires high reliability and supports snapshots. Which file system type should be chosen?

A.xfs
B.ext4
C.vfat
D.btrfs
AnswerA

XFS is the correct choice because it is the default filesystem on RHEL 9, and Red Hat fully supports it for production workloads. While XFS itself does not have native snapshot capabilities, it works seamlessly with LVM, which provides snapshot functionality for consistent backups and recovery. Its allocation groups, scalable inode handling, and high concurrency support make it ideal for large database files, exactly what the administrator needs.

Why this answer

XFS is the correct choice because it is a high-performance, 64-bit journaling file system that supports snapshots via LVM or external tools, and is designed for large files and partitions. For a database requiring high reliability and snapshot capabilities, XFS provides robust data integrity features and is the default file system in Red Hat Enterprise Linux 8 and later, making it the recommended option for this scenario.

Exam trap

The trap here is that candidates may choose btrfs because it natively supports snapshots, but the EX200 exam expects XFS as the default RHEL file system for high-reliability production use, and btrfs is not covered as a standard option in the exam objectives.

How to eliminate wrong answers

Option B (ext4) is wrong because while ext4 is a reliable journaling file system, it does not natively support snapshots; snapshots require LVM or other external mechanisms, and ext4 is less optimized for very large partitions and high-concurrency database workloads compared to XFS. Option C (vfat) is wrong because vfat is a simple, non-journaling file system designed for compatibility with legacy systems and removable media; it lacks journaling, reliability features, and snapshot support, making it unsuitable for a database. Option D (btrfs) is wrong because although btrfs supports snapshots and checksumming, it is not the default file system in RHEL and is considered less mature for production database use; the EX200 exam focuses on XFS as the standard choice for high-reliability scenarios.

26
Multi-Selecteasy

Which TWO commands can be used to create a new directory that will serve as a mount point?

Select 2 answers
A.install -d /mnt/newmount
B.touch /mnt/newmount
C.ln -s /mnt /mnt/newmount
D.mkdir /mnt/newmount
E.ln /mnt /mnt/newmount
AnswersA, D

install -d /mnt/newmount is correct because it creates the directory /mnt/newmount, and unlike plain mkdir, it also creates any missing parent components. Even though install is often used to copy files and set modes, with the -d option it acts purely as a directory-creation utility. Because the command succeeds and the result is a real directory, it satisfies the requirement.

Why this answer

`install -d /mnt/newmount` creates the directory `/mnt/newmount` if it does not already exist, setting it up as a mount point. Option D is correct because `mkdir /mnt/newmount` is the standard command to create a directory, which can then be used as a mount point for a filesystem.

Exam trap

Red Hat often tests the distinction between creating a file (`touch`) and creating a directory (`mkdir` or `install -d`), leading candidates to mistakenly think any new filesystem object can serve as a mount point.

27
MCQmedium

The administrator wants to mount a new filesystem on /dev/sdb1 with the label 'backup' and mount it at /mnt/backup. Which commands achieve this?

A.parted /dev/sdb mkpart primary xfs 0% 100% && mkfs.xfs -L backup /dev/sdb1
B.mkfs.xfs /dev/sdb1 && xfs_admin -L backup /dev/sdb1 && mount -L backup /mnt/backup
C.mkfs.xfs -L backup /dev/sdb1 && mount /dev/sdb1 /mnt/backup
D.mkfs.ext4 -L backup /dev/sdb1 && echo '/dev/sdb1 /mnt/backup ext4 defaults 0 0' >> /etc/fstab
AnswerB, C

This sequence correctly creates an XFS filesystem on the existing /dev/sdb1, assigns it the label 'backup' using xfs_admin -L, and mounts it by label with 'mount -L backup /mnt/backup'. Mounting by label resolves through /dev/disk/by-label, avoiding dependence on unstable device names, and works without needing an /etc/fstab entry for immediate use. It assumes the partition already exists and that /mnt/backup is a valid mount point, both of which are prerequisites.

Why this answer

Both options B and C correctly create an XFS filesystem with the label 'backup' on /dev/sdb1 and mount it to /mnt/backup. Option B uses mkfs.xfs, then sets the label with xfs_admin, then mounts by label (mount -L works without fstab). Option C creates the filesystem with the label in one step and mounts by device path.

Options A and D are incorrect: A includes an unnecessary parted command and uses ext4? Actually A creates an XFS partition but then mounts? Wait A: parted ... mkpart primary xfs ... && mkfs.xfs -L backup /dev/sdb1. It doesn't mount, so incomplete. D uses ext4, not XFS.

Thus B and C are both valid.

Exam trap

The trap is that candidates may think mounting by label requires an /etc/fstab entry (as initially stated in the explanation for B), but mount -L works without fstab. Also, they might overlook that both B and C are valid sequences.

How to eliminate wrong answers

Option A is wrong because parted does not create a filesystem; it only creates a partition, and the mkpart command syntax is incomplete (missing filesystem type and partition type). Option B is wrong because xfs_admin -L backup cannot change the label of an XFS filesystem that is already mounted or without the filesystem being unmounted first, and mount -L backup uses the label but the label hasn't been set correctly before mounting. Option D is wrong because it creates an ext4 filesystem instead of XFS, and while it adds an fstab entry, it does not actually mount the filesystem immediately, failing the requirement to mount it at /mnt/backup.

28
MCQeasy

During boot, a custom application fails because the /data file system is not mounted. Upon investigation, the administrator sees an error 'UUID=abc123 not found' in the logs. Which command should the administrator use to correct the /etc/fstab entry?

A.blkid /dev/sdb1
B.mount -a
C.xfs_info /dev/sdb1
D.fdisk -l /dev/sdb1
E.lsblk -f /dev/sdb1
AnswerA

blkid reads the filesystem metadata on a block device and prints the UUID, TYPE, and LABEL directly from the superblock; it does not require the device to be mounted or an entry in /etc/fstab. Running blkid /dev/sdb1 is the correct first step to capture the exact UUID to place in an fstab line, ensuring the mount uses a stable identifier rather than a transient device node.

Why this answer

The error 'UUID=abc123 not found' indicates that the /etc/fstab entry for /data references a UUID that does not match any block device. The administrator needs to find the correct UUID of the actual partition (e.g., /dev/sdb1) and update the fstab entry. The `blkid /dev/sdb1` command displays the UUID (and filesystem type) of that specific device, allowing the administrator to copy the correct UUID into /etc/fstab.

Exam trap

Red Hat often tests the distinction between commands that display partition table information (fdisk) versus those that display filesystem metadata (blkid, lsblk -f), and candidates mistakenly choose `fdisk -l` or `lsblk -f` because they see 'UUID' in the output, but `blkid` is the direct, intended tool for retrieving a UUID to fix an fstab entry.

How to eliminate wrong answers

Option B is wrong because `mount -a` attempts to mount all filesystems listed in /etc/fstab, but if the UUID is incorrect, it will fail again — it does not fix the UUID mismatch. Option C is wrong because `xfs_info /dev/sdb1` displays XFS filesystem geometry and superblock details, not the UUID; it is used for tuning or checking XFS metadata, not for retrieving a UUID. Option D is wrong because `fdisk -l /dev/sdb1` shows partition table information (start/end sectors, type) for a specific partition, but it does not display the filesystem UUID; it is a partitioning tool, not a filesystem UUID tool.

Option E is wrong because `lsblk -f /dev/sdb1` lists filesystem information including UUID for all block devices, but it is a listing command; while it could show the UUID, the question asks for the command to 'correct the /etc/fstab entry' — `blkid` is the standard, precise tool for retrieving the UUID of a specific device to use in fstab, whereas `lsblk -f` is more for overview and does not output in a format as directly usable for fstab editing.

29
MCQmedium

An administrator has an XFS filesystem on a logical volume /dev/vg_data/lv_data mounted at /data. To extend the filesystem by 10GB, which sequence of commands is correct?

A.lvextend -L +10G /dev/vg_data/lv_data; resize2fs /dev/vg_data/lv_data
B.xfs_growfs /data; lvextend -L +10G /dev/vg_data/lv_data
C.resize2fs /dev/vg_data/lv_data; lvextend -L +10G /dev/vg_data/lv_data
D.lvextend -L +10G /dev/vg_data/lv_data; xfs_growfs /data
AnswerD

This is the correct sequence for expanding an XFS filesystem on an LVM logical volume: lvextend first allocates the additional disk space by extending the logical volume, and then xfs_growfs /data expands the filesystem to fill the newly available space. XFS can only be grown while mounted, and specifying the mount point /data tells the tool exactly which filesystem to target. Running commands in this order ensures no space is wasted and the filesystem remains consistent throughout the operation.

Why this answer

For XFS filesystems, the logical volume must be extended first with `lvextend`, then the filesystem must be grown online using `xfs_growfs` with the mount point as the argument. XFS does not support shrinking and requires this specific order; `resize2fs` is only for ext2/3/4 filesystems.

Exam trap

Red Hat often tests the misconception that `resize2fs` works for all filesystem types, or that the order of operations (extend LV vs. grow filesystem) is interchangeable, leading candidates to choose options that use the wrong tool or reverse the sequence.

How to eliminate wrong answers

Option A is wrong because `resize2fs` is used for ext2/3/4 filesystems, not XFS; using it on an XFS filesystem will fail. Option B is wrong because `xfs_growfs` must be run after extending the logical volume, not before; running it first will have no effect since the underlying block device hasn't been enlarged. Option C is wrong because `resize2fs` is incorrect for XFS, and the logical volume must be extended before the filesystem resize operation.

30
MCQmedium

Based on the exhibit, which mount point is mounted with the 'noexec' option?

A./data
B./
C./var
D./tmp
E./boot
AnswerD

The /tmp mount point is the correct answer because the exhibit explicitly shows it as an ext4 filesystem mounted with the noexec option. This mount flag instructs the Linux kernel to refuse execve() calls for files located on that filesystem, preventing binaries from being launched directly from the world-writable /tmp directory. No other mount point listed in the exhibit displays the noexec flag, making /tmp the only matching option.

Why this answer

The /tmp mount point is configured with the 'noexec' option, as shown in the exhibit (e.g., in /etc/fstab or the output of mount or findmnt). This prevents execution of binaries directly from the /tmp filesystem, which is a common security hardening practice to mitigate the risk of attackers running malicious scripts or binaries from a world-writable directory.

Exam trap

Red Hat often tests the 'noexec' option on /tmp because candidates may overlook that /tmp is a separate mount point in many Red Hat Enterprise Linux installations, and they might incorrectly assume it inherits the root filesystem's mount options.

How to eliminate wrong answers

Option A is wrong because /data is not listed in the exhibit as having 'noexec'; it likely uses default exec permissions. Option B is wrong because / (root) typically does not have 'noexec' set, as it would break system binaries and scripts. Option C is wrong because /var is usually mounted with default exec permissions to allow services to run scripts or binaries from /var.

Option E is wrong because /boot is mounted without 'noexec' to allow kernel and bootloader updates that require execution of binaries.

31
MCQhard

Refer to the exhibit. After mounting /dev/sdb1 with the noexec option, a script located at /mnt/data/test.file cannot be executed. What change will allow execution while maintaining security?

A.Copy the script to /tmp and run from there
B.Use chmod +x /mnt/data/test.file
C.Change the mount option to exec in /etc/fstab and remount
D.Remount without noexec and add setuid bit
AnswerC

Alter the /etc/fstab entry for /dev/sdb1 to include exec (or remove noexec), then run mount -o remount /mnt/data to re-read the options without a full unmount. This tells the kernel that the filesystem is allowed to serve as a source of executable programs. Using fstab ensures the change survives a reboot, and the remount applies it immediately to the mounted filesystem.

Why this answer

The noexec mount option prevents execution of any binaries or scripts on the filesystem, regardless of file permissions. To allow execution while maintaining security, you must change the mount option to exec in /etc/fstab and remount the filesystem (e.g., mount -o remount,exec /mnt/data). This approach preserves other mount options and avoids the security risks of removing noexec globally.

Exam trap

In RHEL, the noexec mount option overrides any execute permissions set on files, regardless of chmod. The common mistake is trying to fix permissions instead of modifying the mount options via /etc/fstab and remounting with exec.

How to eliminate wrong answers

Option A is wrong because copying the script to /tmp does not change the mount options on /mnt/data; /tmp may also be mounted with noexec, and even if it is not, this workaround bypasses the intended security policy without addressing the underlying filesystem configuration. Option B is wrong because chmod +x sets the executable permission bit on the file, but the noexec mount option overrides file permissions entirely—execution is blocked at the kernel level regardless of the file's mode. Option D is wrong because remounting without noexec and adding the setuid bit introduces a significant security risk (setuid allows the script to run with the privileges of its owner, often root), and the question asks to maintain security while allowing execution, not to escalate privileges.

32
MCQmedium

A system administrator needs to create a file system on /dev/sdb1 with a size of 10 GB and mount it persistently at /data. The file system should support extended attributes and be suitable for large files. Which command sequence achieves this?

A.mkfs.xfs /dev/sda1 && mkdir /data && echo '/dev/sda1 /data xfs defaults 0 0' >> /etc/fstab
B.mkfs.xfs /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && echo '/dev/sdb1 /data xfs defaults 0 0' >> /etc/fstab
C.mkfs.ext4 /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && echo '/dev/sdb1 /data ext4 defaults 0 0' >> /etc/fstab
D.mkswap /dev/sdb1 && mkdir /data && swapon /dev/sdb1 && echo '/dev/sdb1 /data swap defaults 0 0' >> /etc/fstab
AnswerB

This is the correct sequence because it creates an XFS filesystem on the intended /dev/sdb1, creates the /data mount point, immediately mounts the device with the mount command, and appends a persistent fstab entry using the xfs type. The && chain stops if any step fails, preventing a broken configuration. XFS is the default and supported filesystem for RHEL/CentOS 8+ and supports extended attributes.

Why this answer

Both XFS and ext4 support extended attributes by default in RHEL. However, XFS is optimized for large files and high performance, making it the recommended choice for this scenario. Option B correctly creates an XFS file system on /dev/sdb1, creates the mount point, mounts it immediately, and adds an fstab entry for persistence.

Option C uses ext4, which is not as suitable for large files as XFS. Options A and D are incorrect due to wrong device or file system type.

Exam trap

Red Hat often tests the requirement to mount the file system immediately after creation, not just add it to fstab, and the specific file system type (XFS vs. ext4) based on suitability for large files and extended attributes.

How to eliminate wrong answers

Option A is wrong because it uses /dev/sda1 instead of /dev/sdb1, and it does not mount the file system before adding the fstab entry, which means the mount point will not be active until a reboot. Option C is wrong because it uses mkfs.ext4 to create an ext4 file system; while ext4 supports extended attributes, it is not as suitable for very large files as XFS, and the question specifies a file system suitable for large files. Option D is wrong because mkswap creates a swap area, not a file system, and the fstab entry uses 'swap' as the file system type, which is incorrect for mounting a data directory.

33
Multi-Selecthard

Which TWO LVM commands can be used to reduce the size of a logical volume?

Select 2 answers
A.lvresize
B.lvchange
C.lvreduce
D.lvdisplay
E.lvextend
AnswersA, C

lvresize is the general-purpose LVM command for altering a logical volume's size, and it can both increase and decrease the volume equally well. When reducing an LV, you specify a smaller size (absolute, by extent count, or as a percentage), and it will adjust the LV accordingly, optionally resizing the underlying filesystem with the -r/--resizefs flag if the filesystem supports it. Because it handles both directions, it is one of the two valid commands for shrinking an LV.

Why this answer

Both `lvresize` and `lvreduce` can reduce the size of a logical volume. `lvresize` is the general-purpose command for resizing LVs, and when used with the `-L` or `--size` option to specify a smaller size, it shrinks the volume. `lvreduce` is a dedicated command that specifically reduces the size of a logical volume, offering the same functionality as `lvresize --size` but with a more explicit name. Both commands require the filesystem to be shrunk first (if it contains data) using tools like `resize2fs` or `xfs_growfs` (though XFS cannot be shrunk).

Exam trap

The trap here is that candidates often assume only `lvreduce` can shrink a volume, forgetting that `lvresize` is a universal tool that can both increase and decrease size, making both correct answers.

34
MCQmedium

Refer to the exhibit. An administrator wants to mount /dev/sdc1 on /mnt/storage. What must be done first?

A.Mount /dev/sdc directly
B.Add an entry to /etc/fstab
C.Create a partition on /dev/sdc
D.Run mkfs.xfs /dev/sdc1
AnswerC

The exhibit shows /dev/sdc as a whole disk with no recognized partitions (e.g., no /dev/sdc1). Before you can format and mount storage, you must create a partition table and a partition on the disk using a tool such as parted or fdisk. This step creates the necessary block device /dev/sdc1, which can then be formatted with mkfs.xfs and mounted. Without a partition, neither the device name referenced in the question nor a filesystem exists.

Why this answer

The exhibit shows that /dev/sdc has no partition table (it is a raw disk). Before you can mount a filesystem on /dev/sdc1, you must first create a partition on /dev/sdc using a tool like fdisk or parted. Without a partition, the block device /dev/sdc1 does not exist, so any mount attempt would fail with a 'no such device' error.

Exam trap

A common pitfall in the Red Hat RHCSA exam is thinking you can directly mount a raw disk or create a filesystem on a non-existent partition, leading candidates to select mkfs.xfs or /etc/fstab before partitioning.

How to eliminate wrong answers

Option A is wrong because mounting /dev/sdc directly would attempt to mount the whole disk without a partition table, which is not a standard practice and would fail unless the disk contains a filesystem written directly to it (which is not the case here). Option B is wrong because adding an entry to /etc/fstab is only useful after the partition and filesystem exist; it does not create the partition or the block device. Option D is wrong because running mkfs.xfs /dev/sdc1 requires that /dev/sdc1 already exists as a valid block device; you cannot create a filesystem on a non-existent partition.

35
MCQmedium

A system administrator needs to extend an existing logical volume 'lv_data' in volume group 'vg_data'. The administrator has already added a new physical volume /dev/sdd1 to the volume group. Which sequence of commands should be used to complete the extension and ensure the filesystem is usable?

A.lvextend -L +10G /dev/vg_data/lv_data; mount /dev/vg_data/lv_data; resize2fs /dev/vg_data/lv_data
B.lvextend -L +10G /dev/vg_data/lv_data; resize2fs /dev/vg_data/lv_data
C.lvextend -L +10G /dev/vg_data/lv_data; mkfs.ext4 /dev/vg_data/lv_data
D.lvresize -L +10G /dev/vg_data/lv_data; fsck /dev/vg_data/lv_data
E.vgextend vg_data /dev/sdd1; lvextend -L +10G /dev/vg_data/lv_data; resize2fs /dev/vg_data/lv_data
AnswerB

This is the correct procedure: lvextend -L +10G first expands the LV by 10 GiB, making additional physical extents available to the LV. Then resize2fs grows the ext4 filesystem to fill the enlarged block device, either online or offline, without unmounting. Because both commands operate in place and preserve the existing data, this safely completes the extension.

Why this answer

After adding a physical volume to the volume group, the logical volume must be extended with `lvextend`, and then the filesystem must be resized with `resize2fs` to use the new space. The filesystem remains mounted and usable throughout; no remount or filesystem recreation is needed.

Exam trap

The trap here is that candidates may think they need to remount the filesystem (Option A) or recreate it (Option C) after extending the logical volume, but in Red Hat Enterprise Linux, `resize2fs` can grow an ext4 filesystem online without unmounting.

How to eliminate wrong answers

Option A is wrong because `mount` is unnecessary and incorrect here — the filesystem is already mounted and does not need to be remounted after extension. Option C is wrong because `mkfs.ext4` would destroy the existing filesystem, not extend it. Option D is wrong because `fsck` checks filesystem integrity but does not resize the filesystem; also `lvresize` alone without `resize2fs` leaves the filesystem unaware of the new space.

Option E is wrong because `vgextend` has already been performed (as stated in the question), so repeating it is redundant and not part of the required sequence.

36
MCQhard

A server has an LVM volume group vg01 with a physical volume /dev/sdb. The administrator wants to move all physical extents from /dev/sdb to /dev/sdd which is also in the same volume group. Which command sequence is correct?

A.pvmove /dev/sdb; vgreduce vg01 /dev/sdb
B.vgreduce vg01 /dev/sdb; pvmove
C.pvmove /dev/sdb; pvremove /dev/sdb
D.pvmove /dev/sdb /dev/sdd
AnswerA

The correct sequence starts with `pvmove /dev/sdb`, which relocates every allocated physical extent on that disk to any available free extent elsewhere in the same volume group (vg01). Once the source PV is completely empty, `vgreduce vg01 /dev/sdb` safely removes it from the volume group's metadata, allowing the disk to be repurposed or detached without risking data loss or LVM corruption.

Why this answer

The correct sequence is to first use `pvmove /dev/sdb` to relocate all physical extents from /dev/sdb to other physical volumes in the same volume group (vg01), and then use `vgreduce vg01 /dev/sdb` to remove the now-empty physical volume from the volume group. This ensures no data loss and that the volume group metadata is properly updated.

Exam trap

The trap here is that candidates often think `pvmove` requires a target PV or that `pvremove` can be used directly after moving extents, but they forget that the PV must first be removed from the VG with `vgreduce` before it can be fully decommissioned.

How to eliminate wrong answers

Option B is wrong because `vgreduce` before `pvmove` would attempt to remove /dev/sdb from the volume group while it still contains data, causing an error or data loss. Option C is wrong because after `pvmove`, the physical volume /dev/sdb is empty but still part of the volume group; `pvremove` would fail because the PV is still in a VG, and it does not remove the PV from the VG metadata. Option D is wrong because `pvmove /dev/sdb /dev/sdd` attempts to move extents directly to a specific target PV, but if /dev/sdd does not have enough free extents, the command will fail; the correct approach is to use `pvmove` without a target to let LVM distribute extents across all available PVs in the VG.

37
MCQhard

Refer to the exhibit. A system administrator wants to add an additional mount option 'noexec' to the /boot filesystem permanently. Which step is necessary before remounting?

A.Run mount -o remount,noexec /boot without editing /etc/fstab
B.Edit /etc/fstab to add 'noexec' to the /boot entry, then run mount -o remount /boot
C.Run umount /boot, edit /etc/fstab to add 'noexec', then mount /boot
D.Edit /etc/fstab to add 'noexec' to the /boot entry, then run mount -a
AnswerB

Editing /etc/fstab to add noexec to the /boot entry updates the persistent source of truth for that filesystem's options. Running mount -o remount /boot then asks the kernel to reapply the mount flags from fstab without requiring an unmount, so the new noexec setting takes effect while the system stays running. This is the correct way to change mount options permanently and immediately.

Why this answer

To make the 'noexec' mount option persistent for /boot, you must first edit /etc/fstab to add the option to the /boot entry. Then, running 'mount -o remount /boot' will remount the filesystem with the new options from fstab without needing to unmount it. This ensures the change survives reboots and is applied correctly.

Exam trap

A common trap on the RHCSA exam is confusing a temporary remount (which applies options only until the next reboot) with a permanent change via /etc/fstab. Candidates often choose option A thinking a simple remount is sufficient for permanence, but only editing /etc/fstab makes the mount option persistent across reboots.

How to eliminate wrong answers

Option A is wrong because running 'mount -o remount,noexec /boot' without editing /etc/fstab applies the option only for the current session; the change is lost after a reboot. Option C is wrong because you cannot unmount /boot while the system is running (it is a critical filesystem containing the kernel and bootloader), and the procedure unnecessarily unmounts when a remount suffices. Option D is wrong because 'mount -a' mounts all filesystems listed in /etc/fstab that are not already mounted; it does not remount an already-mounted filesystem, so the new 'noexec' option would not be applied to /boot until a reboot.

38
MCQeasy

A system administrator needs to create an XFS filesystem on /dev/sdb1 with the label 'data'. Which command should be used?

A.mkfs.ext4 -L data /dev/sdb1
B.mkfs.xfs -l data /dev/sdb1
C.xfs_admin -L data /dev/sdb1
D.mkfs.xfs -L data /dev/sdb1
AnswerD

This command creates a new XFS filesystem on /dev/sdb1 and assigns the volume label 'data' in a single step using the uppercase -L option. The -L flag is the correct way to set a label during XFS creation, unlike the lowercase -l which configures the log. This exactly matches the requirement to create an XFS filesystem with the specified label, so it is the correct answer.

Why this answer

The `mkfs.xfs` command creates an XFS filesystem, and the `-L` flag assigns a label to the filesystem during creation. The command `mkfs.xfs -L data /dev/sdb1` correctly creates an XFS filesystem on the specified partition with the label 'data'.

Exam trap

The trap here is confusing the lowercase `-l` (used for log parameters in mkfs.xfs) with the uppercase `-L` (used for labels), or thinking that `xfs_admin` can create a filesystem when it only modifies existing ones.

How to eliminate wrong answers

Option A is wrong because `mkfs.ext4` creates an ext4 filesystem, not XFS, and the `-L` flag is used for labels on ext4, but the question specifically requires an XFS filesystem. Option B is wrong because `mkfs.xfs -l data /dev/sdb1` uses a lowercase `-l`, which in mkfs.xfs is used to specify the log section parameters (e.g., log size or device), not the filesystem label; the correct flag for a label is uppercase `-L`. Option C is wrong because `xfs_admin` is used to change parameters of an existing XFS filesystem (like the label or UUID), not to create a new one; it cannot be used to create a filesystem.

39
MCQhard

An administrator wants to enable user disk quotas on an XFS filesystem mounted at /home. Which steps are required?

A.Add 'usrquota' to /etc/fstab, remount, then run quotacheck and edquota
B.Quotas are not supported on XFS filesystems
C.Use mount -o uquota /home, then setquota -u user1 500M 1G /home
D.Add 'uquota' to /etc/fstab, remount, then run xfs_quota -x -c 'limit -u bsoft=500m bhard=1g user1' /home
AnswerD

This is the correct procedure for enabling user quotas on XFS. Adding uquota to the mount options in /etc/fstab ensures the option persists across reboots, and remounting applies it to the live filesystem. The xfs_quota command in expert mode (-x) with the -c option runs a quota command non-interactively; 'limit -u' sets the user's block soft and hard limits, with suffixes like 'm' and 'g' for megabytes and gigabytes. This is the standard, supported method for XFS quota enforcement.

Why this answer

XFS uses its own quota management tools, not the traditional `quotacheck`/`edquota` tools used by ext4. The correct procedure is to add the `uquota` mount option to `/etc/fstab`, remount the filesystem, and then use `xfs_quota` to set limits. The `xfs_quota` command with the `-x` (expert) flag and `-c` (command) flag allows setting user quotas directly, and the path `/home` specifies the filesystem.

Exam trap

The trap here is that candidates familiar with ext4 quotas assume the same `quotacheck`/`edquota` workflow applies to XFS, but Red Hat EX200 expects knowledge of XFS-specific tools like `xfs_quota` and the `uquota` mount option.

How to eliminate wrong answers

Option A is wrong because `quotacheck` and `edquota` are tools for ext2/ext3/ext4 filesystems, not XFS; XFS manages quotas internally and does not require a separate `quotacheck` step. Option B is wrong because XFS fully supports user and group quotas via the `uquota`/`gquota` mount options and the `xfs_quota` utility. Option C is wrong because `mount -o uquota /home` only enables quota accounting but does not set any limits; additionally, `setquota` is an ext4 command and is not used with XFS.

40
MCQmedium

An IT department runs a web server that stores user uploads on an ext4 filesystem on /dev/sdb1 mounted at /uploads. Recently, the partition has run out of space. The administrator checks with df -h and sees 100% usage. However, du -sh /uploads shows only 2GB used. The administrator suspects deleted files still held open by processes. Which command should be used to identify and resolve the issue?

A.rm -rf /uploads/* to clean all files
B.fsck /dev/sdb1 to repair filesystem
C.resize2fs /dev/sdb1 to shrink filesystem
D.lsof +L1 /uploads to find deleted open files, then kill processes
AnswerD

`lsof +L1 /uploads` enumerates open files whose link count is zero — exactly the deleted-but-still-in-use files that are consuming space. Once identified, you can either close the file gracefully (e.g., by restarting the application) or terminate the offending process, causing the kernel to drop the last reference and free the inode's blocks. This is the targeted, surgical remedy: it doesn't touch valid uploads and it directly releases the missing space. After the process is killed, the directory will show no trace of the file, but df will report the reclaimed capacity.

Why this answer

The discrepancy between `df -h` showing 100% usage and `du -sh /uploads` showing only 2GB indicates that deleted files are still held open by running processes. The `lsof +L1 /uploads` command lists files with a link count of zero (deleted but still open), and killing the associated processes releases the disk space. This is a classic scenario on ext4 filesystems where file descriptors prevent space reclamation until the process closes the file.

Exam trap

Red Hat often tests the misconception that `rm` or filesystem repair tools can recover space from deleted-but-open files, when in fact only closing the file descriptor (by killing the process) releases the blocks.

How to eliminate wrong answers

Option A is wrong because `rm -rf /uploads/*` would attempt to remove files that are already deleted (unlinked) and thus cannot free the space held by open file descriptors; it may also delete active uploads. Option B is wrong because `fsck` checks and repairs filesystem metadata, but the filesystem is not corrupted—the issue is with in-use file handles, not structural damage. Option C is wrong because `resize2fs` resizes the filesystem, but shrinking it would not recover space from deleted-but-open files and could cause data loss if the filesystem is full.

41
MCQmedium

Refer to the exhibit. An administrator needs to create a new 5GB filesystem for /var/log. Which step is required?

A.Create a new partition on /dev/sdc and format with xfs
B.Shrink /home to free space in vg00 and create a new LV
C.Add /dev/sdc as a physical volume, extend vg00, create a logical volume, and format
D.Create a new volume group using /dev/sdb
AnswerC

The exhibit shows VG vg00 has no free physical extents, so you cannot create a new logical volume in that volume group without first adding capacity. Adding /dev/sdc as a physical volume via pvcreate or vgextend expands the VG's available space, after which a new logical volume can be created with lvcreate and then formatted with a filesystem such as xfs using mkfs.xfs. This is the standard approach when a dedicated disk is available and the goal is to allocate a new filesystem from an existing volume group.

Why this answer

To create a new filesystem for /var/log using available space on /dev/sdc, the disk must first be added as a physical volume (pvcreate), then added to the existing volume group vg00 (vgextend). After extending the VG, a new logical volume can be created (lvcreate) and formatted with a filesystem (e.g., mkfs.xfs). This approach leverages LVM's flexibility to allocate space from multiple physical volumes without requiring a separate volume group or partition manipulation.

Exam trap

For RHCSA, the key trap is that candidates often forget to add the new disk as a physical volume (pvcreate) before extending the volume group. They may try to directly create a logical volume on the raw disk or add it to the VG without the pvcreate step.

How to eliminate wrong answers

Option A is wrong because creating a new partition on /dev/sdc and formatting it with xfs would create a standalone filesystem not managed by LVM, which contradicts the requirement to use the existing volume group vg00 and does not integrate with the existing logical volume management. Option B is wrong because shrinking /home to free space in vg00 is unnecessary and risky; the question specifies a new 5GB filesystem for /var/log, and the available disk /dev/sdc should be added to vg00 rather than resizing existing LVs, which could cause data loss or complexity. Option D is wrong because creating a new volume group using /dev/sdb is irrelevant; the exhibit shows /dev/sdc as the available disk, and the goal is to extend the existing vg00, not create a separate VG.

42
MCQeasy

An administrator is configuring an NFS mount in /etc/fstab to mount from server:/export to /mnt/data. The mount must use the 'hard' and 'nosuid' options. Which line is correct?

A.server:/export /mnt/data nfs defaults,noexec,nodev 0 0
B.server:/export /mnt/data nfs nosuid,hard,defaults 0 0
C.server:/export /mnt/data ext4 defaults 0 0
D.server:/export /mnt/data nfs suid,soft 0 0
E.server:/export /mnt/data nfs nosuid,hard 0 0
AnswerE

Correct: for an NFS mount in /etc/fstab, the nfs filesystem type is used and the options nosuid,hard provide the required security and reliability. nosuid disables setuid bit processing on the remote filesystem, and hard ensures client processes hang and retry if the server goes down, avoiding premature I/O errors. This entry is the only one that satisfies both requirements without conflicting options.

Why this answer

It specifies the NFS filesystem type and includes both required mount options: 'nosuid' (disallows set-user-identifier/set-group-identifier bits) and 'hard' (retries NFS requests indefinitely until the server responds). The syntax follows the correct /etc/fstab format: <server>:/<export> <mountpoint> <fstype> <options> <dump> <pass>.

Exam trap

Red Hat often tests the misconception that 'defaults' can be combined with other options without conflict, but in reality 'defaults' includes 'suid', which directly contradicts the required 'nosuid' option.

How to eliminate wrong answers

Option A is wrong because it uses 'noexec' and 'nodev' instead of the required 'nosuid' and 'hard' options, and it omits 'hard' entirely. Option B is wrong because it includes 'defaults' after 'nosuid,hard', which is redundant and may cause unexpected behavior (defaults includes 'suid', conflicting with 'nosuid'). Option C is wrong because it specifies 'ext4' as the filesystem type, which is incorrect for an NFS mount.

Option D is wrong because it uses 'suid' (the opposite of the required 'nosuid') and 'soft' (which can cause silent data corruption on NFS timeouts) instead of 'hard'.

43
MCQhard

Refer to the exhibit. The filesystem /var/www/html is mounted, but after a reboot, the directory is empty. What is the most likely cause?

A.The filesystem type is incorrectly specified as ext4 in fstab
B.The mount point /var/www/html does not exist after reboot
C.The device path /dev/vg_data/lv_web is not persistent across reboots
D.The logical volume is not activated at boot because the volume group is not set to auto-activate
AnswerD

The logical volume /dev/vg_data/lv_web is not activated at boot because the volume group vg_data is not set to auto-activate. In RHEL, LVM auto-activation is controlled by the volume_list setting in /etc/lvm/lvm.conf or by the LVM systemd units; if vg_data is excluded, the /dev/mapper/vg_data-lv_web device node is not created at boot, so /etc/fstab's mount attempt fails with a 'special device does not exist' error. Running vgchange -ay vg_data or enabling auto-activation would make the mount succeed. This precisely matches the symptom in the exhibit, so this is the correct answer.

Why this answer

If the volume group containing the logical volume is not set to auto-activate, the logical volume will not be available after reboot, causing the mount to fail silently or the filesystem to appear empty. The `auto_activation_volume_list` in `/etc/lvm/lvm.conf` controls which volume groups are activated automatically at boot; if the VG is excluded, the LV never becomes visible to the system.

Exam trap

Red Hat often tests the misconception that a missing mount point or incorrect fstab entry is the cause, when the real issue is LVM volume group auto-activation being disabled or misconfigured.

How to eliminate wrong answers

Option A is wrong because an incorrect filesystem type in fstab would cause a mount failure with an error message, not an empty directory after a successful mount. Option B is wrong because the mount point `/var/www/html` is a directory that persists across reboots unless explicitly deleted; if it did not exist, the mount would fail with a 'mount point does not exist' error. Option C is wrong because the device path `/dev/vg_data/lv_web` is a persistent LVM logical volume path that remains valid across reboots as long as the volume group is activated; the issue is not path persistence but volume group activation.

44
MCQeasy

An administrator needs to enable swap on a newly created partition /dev/sdc1. Which two commands should be executed in order?

A.mkswap /dev/sdc1; mount /dev/sdc1
B.swapon /dev/sdc1; mkswap /dev/sdc1
C.swapon /dev/sdc1; mount /dev/sdc1
D.mkfs.swap /dev/sdc1; swapon /dev/sdc1
E.mkswap /dev/sdc1; swapon /dev/sdc1
AnswerE

This is the correct two-step sequence: first mkswap /dev/sdc1 writes the swap signature (version 2 header with UUID and page count) onto the partition, making it a valid swap area. Then swapon /dev/sdc1 reads that signature, validates it, and registers the device with the kernel's swap subsystem, adding it to the active swap list visible under /proc/swaps. This immediately enables kernel memory paging to the device without requiring a mount point. The order is mandatory because swapon will reject a device that does not already contain a valid swap header.

Why this answer

Enabling swap on a new partition requires first formatting it as swap space with `mkswap`, then activating it with `swapon`. The `mkswap` command writes a swap signature to the partition, and `swapon` enables the kernel to use it as swap. Without `mkswap`, the partition lacks the proper swap filesystem structure and cannot be used for swapping.

Exam trap

The trap here is that candidates confuse the order of operations or mistakenly think `mount` can be used for swap, or that `mkfs.swap` is a valid command, when in fact swap requires `mkswap` followed by `swapon` and never uses `mount`.

How to eliminate wrong answers

Option A is wrong because `mount` cannot mount a swap partition; swap is not a regular filesystem and must be activated with `swapon`, not mounted. Option B is wrong because `swapon` is executed before `mkswap`, which fails since the partition has no swap signature yet; the order must be reversed. Option C is wrong because `swapon` on an unformatted partition fails, and `mount` is invalid for swap.

Option D is wrong because `mkfs.swap` is not a valid command; the correct command to create a swap filesystem is `mkswap`.

45
Multi-Selecteasy

Which TWO commands can mount an ISO file /tmp/rhel.iso to /mnt/iso?

Select 2 answers
A.mount -o loop /tmp/rhel.iso /mnt/iso
B.isomount /tmp/rhel.iso /mnt/iso
C.mount -t iso9660 -o loop /tmp/rhel.iso /mnt/iso
D.losetup /tmp/rhel.iso && mount /dev/loop0 /mnt/iso
E.mount /tmp/rhel.iso /mnt/iso
AnswersA, C

The -o loop option is what makes this command correct. Without an explicit filesystem type, mount probes the file and detects the ISO 9660 filesystem automatically. The kernel associates the regular file /tmp/rhel.iso with an available loop device (e.g., /dev/loop0), then mounts that device at /mnt/iso. This is the standard, minimal way to mount an ISO file.

Why this answer

Option A is correct because `mount -o loop /tmp/rhel.iso /mnt/iso` uses the loop option to associate the ISO file with a loop device and mount it; on modern Linux, mount auto-detects the ISO9660 filesystem, so no explicit type is required. Option C is also correct because `mount -t iso9660 -o loop /tmp/rhel.iso /mnt/iso` explicitly specifies the ISO9660 filesystem type while still using the loop option, which is the traditional and fully explicit way to mount an ISO image. Option B is wrong because `isomount` is not a standard Linux command.

Option D is wrong as written because `losetup /tmp/rhel.iso` without `-f` does not reliably create/attach a loop device and the chained mount assumes /dev/loop0, which may not be the device assigned. Option E is wrong because `mount /tmp/rhel.iso /mnt/iso` lacks the loop option and will fail to mount a regular file as a block device.

Exam trap

The trap here is that candidates may think `mount` can directly handle a file without the loop option (Option E), or they may confuse `losetup` syntax (Option D) with the correct procedure, leading to errors in a real exam scenario.

46
Multi-Selecthard

Which TWO commands are valid for resizing an XFS file system? (Choose exactly two.)

Select 2 answers
A.xfs_admin -L /mnt
B.xfs_growfs /mnt
C.resize2fs /dev/sda1
D.xfs_growfs -D 10g /mnt
E.xfs_repair /dev/sda1
AnswersB, D

xfs_growfs is the standard tool for resizing an XFS filesystem, and running it with a mount point grows the filesystem to occupy all available space in the underlying device or logical volume. This command works online—meaning the filesystem can remain mounted and in use during the operation—which is a key advantage in production environments. Therefore, xfs_growfs /mnt is a valid and correct answer for resizing an XFS filesystem.

Why this answer

`xfs_growfs` is the dedicated command for resizing (growing) an XFS file system while it is mounted. It expands the file system to fill the available space in the underlying device or logical volume, making it the primary tool for XFS resizing operations.

Exam trap

Red Hat often tests the distinction between file system-specific tools, so the trap here is that candidates confuse `resize2fs` (for ext4) with `xfs_growfs` (for XFS), or mistakenly think `xfs_admin` can resize the file system when it only manages labels and UUIDs.

47
MCQhard

The administrator attempts to run 'xfs_growfs /dev/vg00/lvol1' but receives an error. What is the most likely cause?

A.The file system is not XFS
B.Unmet dependencies
C.The volume group is full
D.The logical volume is not mounted
AnswerD

xfs_growfs requires the target XFS filesystem to be mounted because it performs an online growth operation, reading the current geometry via the mounted filesystem and updating the superblock without unmounting. The lvs attributes for lvol1 lack the 'o' flag (open), which indicates that the logical volume is not currently open/mounted. Since xfs_growfs is invoked on a device that is not mounted, it cannot determine the filesystem's mountpoint and returns an error indicating the filesystem is not mounted. Mounting the LV first and then re-running xfs_growfs with the mountpoint or device would resolve the issue.

Why this answer

The `xfs_growfs` command requires the XFS filesystem to be mounted in order to resize it. If the logical volume `/dev/vg00/lvol1` is not mounted, the kernel cannot access the filesystem's superblock and allocation group information, causing the command to fail with an error such as 'XFS filesystem not mounted' or 'No such file or directory'.

Exam trap

The trap here is that candidates often assume `xfs_growfs` works like `resize2fs` for ext4, which can resize unmounted filesystems, but XFS requires the filesystem to be mounted for online growth, and the error message may be misinterpreted as a missing package or wrong filesystem type.

How to eliminate wrong answers

Option A is wrong because the command `xfs_growfs` is specifically designed for XFS filesystems; if the filesystem were not XFS, the error would typically be 'wrong fs type' or the command would not be found, but the question states the command runs and receives an error, implying the filesystem is XFS. Option B is wrong because `xfs_growfs` is a standalone utility from the `xfsprogs` package and does not have runtime dependencies that would cause a failure during execution; unmet dependencies would prevent installation, not command execution. Option C is wrong because a full volume group would prevent extending the logical volume, but `xfs_growfs` only resizes the filesystem to match the already-extended logical volume; the error occurs before any resize attempt, and the volume group's free space is irrelevant if the logical volume itself is not mounted.

48
MCQhard

After adding the last line to /etc/fstab, the system fails to boot with an error. What is the most likely cause?

A.The UUID for /boot is invalid
B.The mount point /mydata does not exist
C.The device /dev/sdb1 is not formatted
D.The filesystem type ext4 is incorrect for /dev/sdb1
AnswerB

The scenario explicitly states that /mydata does not exist, and systemd requires the mount point directory to be present before mounting any filesystem defined in /etc/fstab. For each fstab entry, systemd generates a mount unit that will fail if the target directory is absent, reporting an error like "mount: mount point /mydata does not exist." Because this directory is missing, the mount unit for /mydata fails, causing the boot to enter emergency mode. The solution is to create the directory with mkdir -p /mydata and then run mount -a to verify.

Why this answer

When a mount point directory specified in /etc/fstab does not exist, the systemd mount unit will fail during boot because the mount operation cannot find the target directory. This is a common misconfiguration: the fstab entry references /mydata, but the directory has not been created with mkdir. The boot process halts with an error indicating the mount point is missing, not that the device or filesystem is invalid.

Exam trap

The trap here is that candidates often focus on device or filesystem issues (UUID, formatting, type) and overlook the simple prerequisite that the mount point directory must exist, which is a fundamental step tested in the EX200.

How to eliminate wrong answers

Option A is wrong because an invalid UUID for /boot would cause a different error (e.g., 'UUID=... does not exist') and would prevent the root filesystem from mounting, not specifically a missing mount point error. Option C is wrong because an unformatted device would produce a 'wrong fs type, bad option, bad superblock' error, not a 'mount point does not exist' error. Option D is wrong because an incorrect filesystem type (e.g., ext4 on an XFS partition) would also yield a 'wrong fs type' error, not a missing directory error.

49
MCQhard

A system has two 500GB disks in a RAID1 (mirror) using mdadm. One disk fails. After replacement, what is the correct procedure to restore redundancy?

A.Run 'mdadm --manage /dev/md0 --add /dev/sdb'
B.Remove the failed disk with 'mdadm /dev/md0 --fail /dev/sdb1' then add new.
C.Run 'mdadm --assemble --scan' to rebuild the array automatically.
D.Use sfdisk to copy partition table from /dev/sda to /dev/sdb, then 'mdadm --manage /dev/md0 --add /dev/sdb1'
AnswerD

Use 'sfdisk' to clone the partition table from /dev/sda to /dev/sdb, ensuring the new disk has a matching partition layout with the correct RAID partition type and UUIDs. After that, 'mdadm --manage /dev/md0 --add /dev/sdb1' enrolls the freshly partitioned partition as a spare, causing the array to start rebuilding the mirror data. This sequence properly introduces the new disk into the existing RAID1 without disrupting the active array.

Why this answer

When replacing a failed disk in a RAID1 array managed by mdadm, the new disk must have a partition table that matches the surviving disk. Using sfdisk to copy the partition table from /dev/sda to /dev/sdb ensures that the partition layout (e.g., partition type 0xFD for Linux RAID autodetect) is identical, which is required before adding the partition (e.g., /dev/sdb1) to the array with mdadm --manage --add. Simply adding the raw disk without a proper partition table would fail because mdadm expects a partition with the correct RAID superblock and partition type.

Exam trap

The trap here is that candidates assume adding a new disk directly with 'mdadm --add' is sufficient, overlooking the critical prerequisite of having an identical partition table on the replacement disk, which is a common oversight in RAID recovery procedures.

How to eliminate wrong answers

Option A is wrong because 'mdadm --manage /dev/md0 --add /dev/sdb' attempts to add the entire disk device, but mdadm requires a partition (e.g., /dev/sdb1) that has a valid partition table and RAID superblock; adding a raw disk without a partition table will not work and may corrupt the array. Option B is wrong because 'mdadm /dev/md0 --fail /dev/sdb1' is used to mark an existing device as failed, but the question states the disk has already failed; the failed device should be removed with 'mdadm --remove' after marking it failed, and the new disk still needs a partition table before adding, which this option omits. Option C is wrong because 'mdadm --assemble --scan' is used to reassemble an existing array from its components after a system reboot or if the array is stopped, not to add a replacement disk to an already active array; it does not handle the partition table requirement for a new disk.

50
MCQeasy

A system administrator needs to create a new ext4 filesystem on /dev/sdb1 and mount it persistently at /data. Which set of commands should be used?

A.mkfs -t ext4 /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && echo '/dev/sdb1 /data ext4 defaults 0 0' >> /etc/fstab
B.mkfs.ext4 /dev/sdb1 && mount /dev/sdb1 /data
C.mkfs -t ext4 /dev/sdb1 && echo '/dev/sdb1 /data ext4 defaults 0 0' >> /etc/fstab && mount /data
D.mkfs.ext4 /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && blkid /dev/sdb1 >> /etc/fstab
AnswerA

This is the only complete sequence: mkfs -t ext4 /dev/sdb1 (equivalent to mkfs.ext4) creates a fresh ext4 filesystem, mkdir /data provides the required directory mount point, mount /dev/sdb1 /data attaches the filesystem for immediate use, and appending a correctly formatted fstab line ('/dev/sdb1 /data ext4 defaults 0 0') ensures the filesystem is mounted automatically at boot. The fstab line contains the six required fields in the correct order, making this the correct answer.

Why this answer

It creates the ext4 filesystem with `mkfs -t ext4 /dev/sdb1`, creates the mount point directory with `mkdir /data`, mounts the filesystem immediately with `mount /dev/sdb1 /data`, and then adds an entry to `/etc/fstab` using the correct format (device, mount point, filesystem type, options, dump, pass) to ensure the mount persists across reboots. The `&&` operator ensures each command only runs if the previous one succeeds, which is a safe practice for scripting this task.

Exam trap

The trap here is that candidates often forget to create the mount point directory or attempt to use `blkid` output directly in fstab, assuming it will work, when in fact the fstab file requires a specific columnar format with the device, mount point, filesystem type, options, dump, and pass fields.

How to eliminate wrong answers

Option B is wrong because it does not create the mount point directory (`/data`) before mounting, which will cause the mount command to fail if `/data` does not already exist, and it does not add an entry to `/etc/fstab`, so the mount is not persistent. Option C is wrong because it attempts to mount using `mount /data` without specifying the device, which is invalid syntax; the mount command requires either a device or an existing fstab entry to reference, and the fstab entry is added after the mount command in this sequence, so the mount would fail. Option D is wrong because it uses `blkid /dev/sdb1 >> /etc/fstab` to append the output of blkid (which includes the UUID and filesystem type in a non-fstab format) instead of a properly formatted fstab line; this would corrupt /etc/fstab and not result in a persistent mount.

51
Multi-Selecthard

Which THREE commands are required to create a logical volume named lv_data of size 10G in volume group vg_data, format it as XFS, and mount it at /mnt/data?

Select 3 answers
A.vgcreate vg_data /dev/sde1
B.lvcreate -L 10G -n lv_data vg_data
C.mount /dev/vg_data/lv_data /mnt/data
D.pvcreate /dev/sde1
E.mkfs.xfs /dev/vg_data/lv_data
AnswersB, C, E

This is the primary command that carves out a logical volume named lv_data from the existing volume group vg_data with a size of 10 GiB. The -L flag specifies the size and -n assigns the name, making this an essential step in creating the LV device node under /dev/vg_data/. Without this command, no logical volume would exist to format or mount.

Why this answer

The `lvcreate -L 10G -n lv_data vg_data` command creates a logical volume named lv_data with a size of 10 GB within the volume group vg_data. This is the standard LVM command for creating logical volumes, where `-L` specifies the size and `-n` specifies the name.

Exam trap

The trap here is that candidates often include `pvcreate` and `vgcreate` as required steps, but the question specifies that the volume group vg_data already exists, so only the LV creation, formatting, and mounting commands are needed.

52
MCQeasy

The administrator wants to create a new ext4 file system on /dev/sdb1 with a block size of 1024 bytes. Which command should be used?

A.mkfs.ext4 -b 1024 /dev/sdb1
B.mkfs.ext4 -B 1024 /dev/sdb1
C.mkfs.ext4 -s 1024 /dev/sdb1
D.mkfs.ext4 --block-size 1024 /dev/sdb1
AnswerA

The -b option in mkfs.ext4 sets the filesystem block size in bytes, overriding the default of 4096 bytes. With -b 1024, the filesystem uses 1 KiB blocks, which reduces internal fragmentation for volumes that will hold many small files, though it also reduces the maximum supported filesystem size. This is the correct syntax for creating a valid ext4 filesystem with a non-default block size.

Why this answer

The `-b` flag in `mkfs.ext4` specifies the block size in bytes. To create an ext4 filesystem with 1024-byte blocks on /dev/sdb1, the command `mkfs.ext4 -b 1024 /dev/sdb1` is used. This is the standard syntax for setting the logical block size when formatting an ext4 filesystem.

Exam trap

The trap here is that candidates confuse the `-b` flag with other common flags like `-B` (used by XFS) or `-s` (used for stride), or assume GNU-style long options like `--block-size` are supported by `mkfs.ext4` when they are not.

How to eliminate wrong answers

Option B is wrong because `-B` is not a valid flag for `mkfs.ext4`; it is used by `mkfs.xfs` to specify block size, but for ext4 the correct flag is lowercase `-b`. Option C is wrong because `-s` in `mkfs.ext4` is used to specify the number of bytes per inode (stride), not the block size. Option D is wrong because `--block-size` is not a recognized long option for `mkfs.ext4`; the utility does not support GNU-style long options for block size, only the short `-b` flag.

53
MCQhard

A logical volume 'lv_share' in volume group 'vg_share' has no free extents. The administrator needs to increase the size of '/dev/vg_share/lv_share' by 5 GB. There is another logical volume 'lv_archive' in the same volume group that has 10 GB free space within its filesystem. What must the administrator do to allocate space from 'lv_archive' to 'lv_share'?

A.Reduce the filesystem on 'lv_archive' with resize2fs, then reduce the logical volume with lvreduce, then extend 'lv_share'.
B.Shrink the filesystem on 'lv_archive' to free space, then use vgsplit to move the space to 'lv_share'.
C.Use lvreduce directly on 'lv_archive' without changing the filesystem, then lvextend on 'lv_share'.
D.Use lvresize to reduce 'lv_archive' and extend 'lv_share' in one command.
E.Add a new physical volume to the volume group instead.
AnswerA

The safe sequence is to first shrink the filesystem with resize2fs so its data structures fit within a smaller block device, then use lvreduce to shrink the logical volume to match (or slightly exceed) the new filesystem size, ensuring no filesystem metadata is truncated. After that, the freed extents become available in the volume group, allowing lvextend to grow lv_share without any data loss. This ordering is mandatory because the kernel/filesystem must be told about a smaller size before the underlying block device is reduced.

Why this answer

You must first shrink the filesystem on 'lv_archive' using resize2fs (or e2fsck -f / resize2fs) to free space within the filesystem, then reduce the logical volume with lvreduce to release the underlying physical extents back to the volume group. Only after those steps can you extend 'lv_share' with lvextend and then resize its filesystem. This sequence ensures data integrity and avoids filesystem corruption.

Exam trap

Red Hat often tests the misconception that you can reduce a logical volume without first shrinking the filesystem, leading candidates to choose option C, but the correct sequence always requires filesystem resizing before LV reduction to prevent corruption.

How to eliminate wrong answers

Option B is wrong because vgsplit is used to move entire physical volumes between volume groups, not to reallocate free space within the same volume group; it would break the volume group structure. Option C is wrong because using lvreduce directly on 'lv_archive' without first shrinking the filesystem will corrupt the filesystem, as the logical volume shrink truncates the block device before the filesystem is aware. Option D is wrong because lvresize cannot simultaneously reduce one LV and extend another in a single command; it operates on one logical volume at a time.

Option E is wrong because adding a new physical volume does not utilize the existing free space within 'lv_archive' and is unnecessary when space can be reclaimed from the same volume group.

54
MCQeasy

An administrator wants to ensure that a file system is automatically mounted at boot. Which file should be edited?

A./etc/rc.local
B./etc/fstab
C./boot/grub2/grub.cfg
D./etc/mtab
AnswerB

/etc/fstab is the filesystem table that the system reads at boot to determine which filesystems must be mounted, where, and with what options. It contains fields for the device or UUID, mount point, filesystem type, mount options, dump flag, and fsck pass order. Both the mount command and systemd's fstab generator use this file to create mount units, making it the definitive configuration for automatic mount-at-boot behavior on a Linux system.

Why this answer

The /etc/fstab file is the standard configuration file that defines how disk partitions, block devices, and remote filesystems should be mounted into the filesystem tree, including options for automatic mounting at boot time. The system reads this file during the boot process (via systemd or the traditional mount -a command) to mount all filesystems listed with the 'auto' or nofail option.

Exam trap

Red Hat often tests the distinction between configuration files (/etc/fstab) and runtime or bootloader files, leading candidates to mistakenly choose /etc/rc.local or /boot/grub2/grub.cfg because they associate 'boot' with bootloader or startup scripts.

How to eliminate wrong answers

Option A is wrong because /etc/rc.local is a legacy script executed at the end of the boot process, not a configuration file for automatic filesystem mounting; it is not designed for managing mount points and is often empty or disabled on modern Red Hat systems. Option C is wrong because /boot/grub2/grub.cfg is the GRUB2 bootloader configuration file that controls the kernel and initramfs selection, not filesystem mounting; editing it would not affect mount behavior. Option D is wrong because /etc/mtab is a dynamically updated file that lists currently mounted filesystems, maintained by the kernel or mount command; it is not a configuration file and changes to it are not persistent across reboots.

55
MCQmedium

Refer to the exhibit. An administrator extends an XFS filesystem on /data. Which prerequisite step is missing from the output?

A.The filesystem must be mounted before xfs_growfs
B.The filesystem must be checked with xfs_repair before growing
C.The filesystem must be unmounted before xfs_growfs
D.The logical volume must be deactivated before xfs_growfs
AnswerA

xfs_growfs is an online resizing tool that operates on a mounted XFS filesystem; it takes the mount point as its argument and uses the live filesystem's geometry to determine the new size. If the filesystem is not mounted, xfs_growfs cannot obtain the necessary superblock and allocation group information via the kernel, so the operation fails. This requirement is the exact opposite of the old ext2/3/4 resize2fs workflow, which typically requires unmounting, and is a key differentiator for XFS administration.

Why this answer

The xfs_growfs command requires the XFS filesystem to be mounted because it operates on a live filesystem, resizing it to match the underlying block device. The exhibit shows the administrator running xfs_growfs without first mounting /data, which is the missing prerequisite step. Without mounting, xfs_growfs cannot access the filesystem's superblock to perform the resize.

Exam trap

A common misconception is that filesystems must be unmounted before resizing, but XFS specifically supports online growing. The trap is assuming a traditional unmount requirement applies here.

How to eliminate wrong answers

Option B is wrong because xfs_repair is used to repair a corrupted filesystem, not as a prerequisite for growing; xfs_growfs does not require a prior check. Option C is wrong because XFS filesystems must be mounted to be grown with xfs_growfs; unmounting would prevent the command from working. Option D is wrong because the logical volume must be active (not deactivated) to be accessible; deactivating it would make the block device unavailable for the filesystem.

56
MCQmedium

After adding a new disk /dev/sdc, a system administrator wants to mount it persistently at /mnt/backup. Which entry in /etc/fstab is most reliable?

A.LABEL=data /mnt/backup xfs defaults 0 0
B.PARTUUID=def456... /mnt/backup xfs defaults 0 0
C./dev/sdc /mnt/backup xfs defaults 0 0
D.UUID=abc123... /mnt/backup xfs defaults 0 0
AnswerD

The filesystem UUID is a unique identifier generated at mkfs time and stored in the filesystem superblock. It remains constant even if the disk moves to a different port or the device name changes. Using UUID= in /etc/fstab ensures the correct filesystem is mounted at boot. This is the standard, reliable method for persistent mount configuration.

Why this answer

Using the UUID (Universally Unique Identifier) ensures the filesystem is mounted persistently regardless of device name changes (e.g., /dev/sdc could become /dev/sdd after a reboot or disk addition). The UUID is generated when the filesystem is created and remains constant, making it the most reliable method for persistent mounts in /etc/fstab.

Exam trap

Red Hat often tests the misconception that device names like /dev/sdc are stable, but the trap here is that device names can change after reboots or hardware changes, while UUIDs remain constant and are the recommended method for persistent mounts in /etc/fstab.

How to eliminate wrong answers

Option A is wrong because it uses a LABEL, which is not set by default on a new disk; if the label 'data' does not exist on /dev/sdc, the mount will fail, and labels can be accidentally duplicated or changed. Option B is wrong because PARTUUID identifies the partition table entry, not the filesystem itself; it is used for partition identification (e.g., with GPT) and does not guarantee the filesystem is present or consistent. Option C is wrong because /dev/sdc is a device name that can change dynamically (e.g., after a reboot or adding other disks), leading to mount failures or mounting the wrong device.

57
Multi-Selecthard

Which three of the following actions are required when adding a new swap device to the system? (Choose three.)

Select 3 answers
A.Mount the device to a swap directory
B.Create a filesystem using mkfs
C.Use mkswap to set up the swap signature
D.Use swapon to activate swap
E.Add an entry in /etc/fstab with the swap option
AnswersC, D, E

mkswap initializes a disk partition or file by writing a swap signature and labeling information, preparing it for use as virtual memory. Without this step, the kernel does not recognize the device as swap, so mkswap is a mandatory prerequisite for any swap area. It is a distinct operation separate from filesystem creation, because swap uses a raw layout rather than a filesystem.

Why this answer

`mkswap` writes a swap signature (UUID and label) to the device, which is required before the kernel can use it as swap space. Without this signature, the device is not recognized as a swap area.

Exam trap

Red Hat often tests the misconception that swap devices must be mounted or formatted with a filesystem, leading candidates to incorrectly select options A or B.

58
MCQhard

A RHEL 9 server uses LVM with volume group vg_app on a single physical volume /dev/sdc. The logical volume lv_home, formatted as XFS and mounted at /home, is running out of space, but the volume group has no free extents and no additional disks can be added. A colleague notes that /dev/sdc is a 200 GB device, yet only 120 GB of it is currently allocated to vg_app. Which single command will make the remaining space available to grow lv_home?

A.pvresize /dev/sdc
B.pvcreate /dev/sdc
C.vgextend vg_app /dev/sdc
D.lvextend -l +100%FREE /dev/vg_app/lv_home
AnswerA

pvresize re-reads the size of an existing physical volume and grows its metadata so that newly available sectors at the end of the device become usable physical extents. Because /dev/sdc is already a PV in vg_app, this is the correct single step to reclaim the unused 80 GB. After pvresize, vg_app gains free extents that can be assigned to lv_home with lvextend.

Why this answer

The physical volume /dev/sdc is larger than the extents currently recorded in its LVM metadata, so the volume group cannot see the unused tail of the disk. Resizing the existing PV with pvresize updates that metadata and makes the additional space available as free physical extents. Once the VG has free extents, lvextend and xfs_growfs can be used to enlarge and grow the XFS file system on lv_home.

Exam trap

The trap here is assuming that a volume group automatically detects extra capacity on a physical volume after the underlying device is enlarged, when in fact the PV metadata must be refreshed with pvresize first.

59
Multi-Selecthard

Which TWO of the following are valid mount options for enabling quotas on an ext4 file system?

Select 2 answers
A.grpquota
B.quota
C.userquota
D.noquota
E.usrquota
AnswersA, E

The `grpquota` mount option instructs the kernel to enable per-group quota accounting and enforcement on an ext4 filesystem. When placed in `/etc/fstab` or passed via `mount -o remount,grpquota`, the kernel tracks block and inode usage by group ID and can enforce limits when the `quotaon` utility activates them. This option is used alongside `usrquota` when both user and group limits are required, but it is equally valid by itself.

Why this answer

`grpquota` is a valid mount option for enabling group quotas on an ext4 file system. Option E is correct because `usrquota` is the valid mount option for enabling user quotas. Both options are recognized by the `mount` command and the ext4 driver to activate quota tracking at mount time.

Exam trap

The trap here is that candidates confuse the generic `quota` command with a mount option, or misremember the exact option names (e.g., `userquota` instead of `usrquota`), leading them to select incorrect options like `quota` or `userquota`.

60
MCQeasy

A system administrator needs to verify that the filesystem on /dev/sdb1 is ext4 before adding it to /etc/fstab. Which command provides this information?

A.mount -a
B.df -Th /dev/sdb1
C.fdisk -l /dev/sdb1
D.lsblk -f /dev/sdb1
AnswerD

lsblk -f /dev/sdb1 is correct because the -f (--fs) option makes lsblk output the filesystem type, label, UUID, and mount point for the specified block device. It reads this information from udev and kernel device da, which ultimately come from the filesystem superblock, so it works whether the device is mounted or not. This makes it ideal for verifying that /dev/sdb1 was formatted with the expected filesystem before attempting to mount it.

Why this answer

The `lsblk -f /dev/sdb1` command displays the filesystem type (FSTYPE) for the specified block device, such as ext4. This is the most direct and reliable way to verify the filesystem on a specific partition before adding it to /etc/fstab.

Exam trap

The trap here is that candidates often choose `df -Th` because it shows filesystem type, but they forget that it only works on mounted filesystems, whereas `lsblk -f` works on unmounted devices as well.

How to eliminate wrong answers

Option A is wrong because `mount -a` mounts all filesystems listed in /etc/fstab that are not already mounted; it does not display filesystem type information. Option B is wrong because `df -Th /dev/sdb1` shows the filesystem type of mounted filesystems, but if /dev/sdb1 is not mounted, it will not show the type or may produce an error. Option C is wrong because `fdisk -l /dev/sdb1` displays partition table information (size, type, start/end sectors) but does not show the filesystem type (e.g., ext4) — it only shows the partition type ID (e.g., 83 for Linux).

61
MCQmedium

A file server is experiencing slow write performance. The admin suspects the filesystem is nearly full. Which command should be used to check disk usage per partition?

A.df -h
B.df -i
C.du -h --max-depth=1 /
D.du -sh /
AnswerA

df -h — Correct: this command invokes df with human-readable units and reports actual disk space usage per mounted filesystem. It shows total capacity, used space, available space, and use percentage, which is exactly what you need to determine if a slow file server is hitting a full partition. Since full filesystems are a top cause of write performance degradation, df -h is the right first diagnostic.

Why this answer

The `df -h` command displays disk space usage for all mounted filesystems in human-readable format (e.g., GB, MB). This directly answers the admin's need to check per-partition usage and identify if a filesystem is nearly full, which can cause slow write performance due to lack of free space.

Exam trap

The trap here is that candidates confuse `df` (disk free, per-partition) with `du` (disk usage, per-directory), or they mistake inode usage (`df -i`) for space usage, leading them to pick a command that does not show partition-level free space.

How to eliminate wrong answers

Option B is wrong because `df -i` shows inode usage, not disk space usage; a filesystem can have free space but run out of inodes, which is a different issue. Option C is wrong because `du -h --max-depth=1 /` shows disk usage of directories under the root, not per-partition usage, and it does not report free space or partition boundaries. Option D is wrong because `du -sh /` shows the total disk usage of the root directory only, not per-partition breakdown, and it cannot identify which partition is nearly full.

62
MCQhard

A company policy requires that all new logical volumes be created with a physical extent size of 16 MiB to optimize performance for large sequential I/O. During the creation of a new volume group, what parameter should be used?

A.vgcreate -p 16M vg_data /dev/sdc1
B.vgcreate -L 16M vg_data /dev/sdc1
C.vgcreate -e 16M vg_data /dev/sdc1
D.vgcreate -c 16M vg_data /dev/sdc1
E.vgcreate -s 16M vg_data /dev/sdc1
AnswerE

The -s option is the correct way to set the physical extent size for a new volume group. In vgcreate -s 16M vg_data /dev/sdc1, the 16M argument defines each physical extent as 16 MiB, so all subsequent logical volumes are allocated in 16 MiB chunks. This ensures that new logical volumes align with the company policy of 16M extents from the moment the VG is created.

Why this answer

The `-s` parameter in `vgcreate` sets the physical extent (PE) size for the volume group. A PE size of 16 MiB is specified with `-s 16M`, which ensures all subsequent logical volumes in that VG use 16 MiB extents, optimizing performance for large sequential I/O by reducing metadata overhead.

Exam trap

The trap here is confusing the `-s` (extent size) option with other common LVM parameters like `-L` (size) or `-p` (max PVs), leading candidates to select a wrong option that sets a different attribute entirely.

How to eliminate wrong answers

Option A is wrong because `-p` sets the maximum number of physical volumes allowed in the volume group, not the extent size. Option B is wrong because `-L` sets the maximum logical volume size, not the extent size. Option C is wrong because `-e` is not a valid parameter for `vgcreate`; it is used with `pvcreate` to set the PE start offset.

Option D is wrong because `-c` sets the cluster mode for the volume group, not the extent size.

63
MCQhard

A server running RHEL 9 has an LVM logical volume /dev/vg00/lvol0 formatted with XFS, mounted at /data. The administrator needs to increase the file system size from 100GB to 150GB. Which command sequence should be used?

A.xfs_info /data; lvextend -L 150G /dev/vg00/lvol0
B.umount /data; lvextend -L +50G /dev/vg00/lvol0; mount /data; xfs_growfs /data
C.resize2fs /dev/vg00/lvol0
D.lvextend -L +50G /dev/vg00/lvol0; xfs_growfs /data
AnswerD

This is the correct sequence: the lvextend -L +50G /dev/vg00/lvol0 command first extends the logical volume by 50GB, giving the underlying block device more space; then xfs_growfs /data online-grows the mounted XFS filesystem to fill the expanded LV. XFS can only grow, not shrink, and growth must happen after the LV is enlarged, not before. Because xfs_growfs defaults to using all available space, no size argument is required after extending the LV.

Why this answer

It first extends the logical volume by the exact amount needed (+50G) using lvextend, then grows the XFS filesystem to match using xfs_growfs. XFS filesystems can be grown online (no unmount required), and xfs_growfs expands the filesystem to fill the available space in the logical volume.

Exam trap

The trap here is that candidates may assume all filesystems require unmounting before resizing (as with some older tools), or they may confuse XFS with ext4 and try to use resize2fs, or they may think xfs_info is a growth command instead of an info command.

How to eliminate wrong answers

Option A is wrong because xfs_info only displays filesystem information and does not perform any growth operation; the sequence lacks the actual grow command. Option B is wrong because unmounting the XFS filesystem is unnecessary and disruptive; xfs_growfs works on a mounted filesystem, and the -L +50G syntax is correct but the umount/mount steps are redundant and incorrect. Option C is wrong because resize2fs is the tool for ext2/3/4 filesystems, not XFS; using it on an XFS filesystem would fail or cause corruption.

64
MCQhard

The root filesystem is at 90% capacity. Which command increases available space without unmounting?

A.fstrim /
B.lvextend -L +5G /dev/mapper/vg_root-lv_root && xfs_growfs /
C.resize2fs /dev/mapper/vg_root-lv_root
D.lvextend -L +5G /dev/mapper/vg_root-lv_root
AnswerB

Extending the logical volume then growing the XFS filesystem online satisfies the no-unmount constraint, since XFS supports live growth via xfs_growfs on a mounted filesystem. The lvextend command adds 5 GB from the volume group, immediately increasing available space on the root filesystem.

Why this answer

It first extends the logical volume with `lvextend -L +5G`, then grows the XFS filesystem online with `xfs_growfs /` to utilize the new space without unmounting. This is the proper procedure for XFS filesystems, which require `xfs_growfs` (not `resize2fs`) to expand while mounted.

Exam trap

Red Hat often tests the distinction between filesystem-specific resizing tools (xfs_growfs vs. resize2fs) and the need to run both the LVM extension and the filesystem grow command; the trap here is that candidates may think `lvextend` alone is sufficient or that `resize2fs` works on all filesystems.

How to eliminate wrong answers

Option A is wrong because `fstrim /` only discards unused blocks on SSD-backed filesystems to reclaim free space from the storage device, but it does not increase the actual capacity of the filesystem; it only optimizes existing free space. Option C is wrong because `resize2fs` is used for ext2/ext3/ext4 filesystems, not XFS; running it on an XFS filesystem will fail or cause corruption. Option D is wrong because `lvextend` alone extends the logical volume but does not resize the filesystem; without `xfs_growfs`, the additional space remains invisible to the filesystem and the root filesystem remains at 90% capacity.

65
Multi-Selectmedium

A system administrator has added a new disk /dev/sdb to a Red Hat Enterprise Linux 9 server. The directory /data already exists. Which two steps must be performed to prepare the disk for mounting as an XFS file system at /data?

Select 2 answers
A.Run mkfs.xfs on the partition (e.g., mkfs.xfs /dev/sdb1)
B.Mount the partition to /data (mount /dev/sdb1 /data)
C.Create a partition on /dev/sdb (e.g., fdisk /dev/sdb)
D.Create the /data directory (mkdir -p /data)
E.Add an entry to /etc/fstab for the new mount
AnswersA, C

Without a filesystem, the partition is just raw block storage; the kernel cannot mount it because there is no superblock or inode structure to manage files. Running mkfs.xfs writes the XFS superblock, allocation groups, and journaling structures onto /dev/sdb1, making it a valid, mountable filesystem. This step is mandatory after partitioning and before attempting any mount operation.

Why this answer

After creating a partition on /dev/sdb, you must format it with the XFS file system using mkfs.xfs. This writes the XFS superblock and metadata structures to the partition, making it ready for mounting. Without this step, the partition has no file system and cannot be mounted.

Exam trap

The trap here is that candidates often think mounting or adding an fstab entry is a preparatory step, but the question specifically asks for steps to prepare the disk for mounting, which are partitioning and creating the file system.

66
MCQeasy

A junior administrator needs to create a new Ext4 file system on the device /dev/sdb1. Which command should be used?

A.fdisk /dev/sdb1
B.parted /dev/sdb1
C.tune2fs /dev/sdb1
D.mkfs.ext4 /dev/sdb1
E.fsck /dev/sdb1
AnswerD

mkfs.ext4 /dev/sdb1 is correct because mkfs.ext4 is a front-end to mke2fs -t ext4, which initializes a fresh ext4 filesystem on the partition. It writes the essential on-disk metadata—superblock, descriptor blocks, inode table, and journal—so the partition can be mounted and used by the Linux kernel. This is the standard command a junior administrator would run after a partition like /dev/sdb1 has been created.

Why this answer

The `mkfs.ext4` command is the standard utility for creating an ext4 filesystem on a block device. It formats the partition with the ext4 journaling filesystem, writing the superblock, inode table, and journal metadata. Option D is correct because it directly invokes the mke2fs program with the ext4 filesystem type.

Exam trap

The trap here is that candidates confuse partition management tools (fdisk, parted) with filesystem creation tools, or mistake maintenance utilities (tune2fs, fsck) for creation commands, leading them to select a wrong option that operates on a different layer of storage management.

How to eliminate wrong answers

Option A is wrong because `fdisk` is a partition table manipulation tool (MBR/GPT) and cannot create a filesystem; it only manages partitions on a disk, not on a partition like /dev/sdb1. Option B is wrong because `parted` is also a partition table editor, not a filesystem creation tool; it can resize or create partitions but not format them with a filesystem. Option C is wrong because `tune2fs` is used to adjust tunable filesystem parameters on an existing ext2/ext3/ext4 filesystem, not to create a new one.

Option E is wrong because `fsck` is a filesystem consistency check and repair tool, not a creation utility; it operates on an already-formatted filesystem.

67
MCQeasy

An administrator needs to add a 1GB swap partition on /dev/sdd1. Which series of commands accomplishes this?

A.mkswap /dev/sdd1 && echo '/dev/sdd1 swap swap defaults 0 0' >> /etc/fstab
B.mkfs.swap /dev/sdd1 && swapon /dev/sdd1
C.mkswap /dev/sdd1 && swapon /dev/sdd1
D.fdisk /dev/sdd, create partition, then mkswap /dev/sdd1, swapon /dev/sdd1, and add to /etc/fstab.
AnswerD

This is the complete and correct procedure: fdisk creates a 1 GB partition on /dev/sdd (assigned as /dev/sdd1), mkswap writes the swap signature to that partition, swapon activates the swap for immediate use, and adding the line to /etc/fstab ensures automatic activation at boot. The fstab entry alone or the swapon alone would be incomplete, but combining them covers both current-session and persistent swap. The fdisk step also ensures the partition actually exists with the desired size, unlike the other options that assume a preexisting /dev/sdd1.

Why this answer

It includes all necessary steps: first create the partition with fdisk (since /dev/sdd1 does not exist yet), then format it as swap with mkswap, activate it with swapon, and finally add an entry to /etc/fstab to ensure persistence across reboots. The other options omit the critical partition creation step or fail to make the swap permanent.

Exam trap

Red Hat often tests the requirement to create the partition first before formatting it as swap, leading candidates to mistakenly choose options that assume the partition already exists or skip the fstab entry for persistence.

How to eliminate wrong answers

Option A is wrong because it runs mkswap on /dev/sdd1 without first creating the partition, so the device node does not exist and the command will fail; also, while it adds an fstab entry, it does not activate the swap with swapon. Option B is wrong because mkfs.swap is not a valid command (the correct command is mkswap), and it lacks both partition creation and fstab persistence. Option C is wrong because it assumes /dev/sdd1 already exists and does not create the partition, nor does it add an entry to /etc/fstab, so the swap would not survive a reboot.

68
MCQeasy

Which command displays the UUID of all file systems on the system?

A.blkid
B.dumpe2fs -h
C.lsblk
D.fdisk -l
AnswerA

blkid is the dedicated utility that enumerates all block devices visible to the system and prints each file system's UUID, TYPE, LABEL, PARTUUID, and other attributes by default. Since it scans every block device under /dev via libblkid, a bare `blkid` command displays the UUIDs of all file systems without needing a device argument or a filesystem-specific tool.

Why this answer

The `blkid` command is the correct choice because it is specifically designed to locate and display block device attributes, including the UUID, filesystem type, and label, for all filesystems on the system. It reads data from the `/dev/disk/by-uuid/` directory and the `udev` database, making it the most direct and reliable tool for querying UUIDs without requiring root privileges for basic output.

Exam trap

Red Hat often tests the distinction between partition-level identifiers (shown by `fdisk -l` for GPT partition UUIDs) and filesystem-level UUIDs (shown by `blkid`), leading candidates to mistakenly choose `fdisk -l` when the question specifically asks for filesystem UUIDs.

How to eliminate wrong answers

Option B is wrong because `dumpe2fs -h` only displays filesystem information for ext2/ext3/ext4 filesystems, not for all filesystem types (e.g., XFS, Btrfs, or swap), and it requires a specific device argument rather than showing all filesystems system-wide. Option C is wrong because `lsblk` lists block devices and their mount points, but it does not display UUIDs by default; while it can show UUIDs with the `-f` or `-o UUID` options, the plain `lsblk` command omits UUIDs, making it incorrect for this specific requirement. Option D is wrong because `fdisk -l` is a partitioning tool that displays partition tables (e.g., MBR or GPT), not filesystem UUIDs; it shows partition UUIDs (for GPT) or partition types, but not the filesystem-level UUID that `blkid` reports.

69
MCQmedium

Based on the exhibit, how much free space is available in the volume group vg00?

A.19.98 GiB
B.10235 MiB
C.20.00 GiB
D.19.99 GiB
E.5115 MiB
AnswerA

In vgdisplay, the Free PE count is 5115 and the PE size is 4.00 MiB, so the unallocated capacity equals 5115 × 4 = 20,460 MiB. Converting MiB to GiB by dividing by 1024 yields 19.98 GiB, which is the available free space. This is the exact value that vgdisplay reports as the remaining space in the volume group.

Why this answer

The VG free space is calculated from the total number of Physical Extents (PEs) and the PE size. The output shows 5115 PEs and a PE size of 4.00 MiB, so total free space = 5115 × 4 MiB = 20460 MiB = 19.98 GiB (since 20460 ÷ 1024 = 19.98046875). No Logical Volumes are allocated, so all PEs are free.

Option B (10235 MiB) is exactly half of 20470 MiB, a common miscalculation. Option C (20.00 GiB) is the raw PV size, ignoring the PE overhead. Option D (19.99 GiB) is a rounding error.

Option E (5115 MiB) confuses the PE count with the free space in MiB.

Exam trap

Red Hat often tests the distinction between raw PV size and usable VG space, trapping candidates who assume the PV size equals the VG free space without accounting for PE size and rounding.

How to eliminate wrong answers

Option B is wrong because 10235 MiB is exactly half of the total usable space (20460 MiB / 2), which might be a miscalculation if one mistakenly divides by 2 or confuses with a different metric. Option C is wrong because 20.00 GiB is the raw PV size, but the VG uses a PE size of 4 MiB, which introduces rounding and metadata overhead, so the actual free space is slightly less (19.98 GiB). Option D is wrong because 19.99 GiB is a rounding error; the precise calculation yields 19.98 GiB (20460 MiB / 1024 = 19.98046875 GiB).

Option E is wrong because 5115 MiB is the total number of PEs, not the free space in MiB; the free space in MiB is 20460 MiB (5115 PE × 4 MiB/PE).

70
MCQhard

The administrator wants to reduce the file system size to 40GB. Which command sequence should be used?

A.It is not possible to shrink an XFS file system
B.xfs_repair; lvreduce
C.umount /mnt/data; lvreduce -L 40G; mount; xfs_growfs
D.lvreduce -L 40G /dev/vg00/lvol0; xfs_growfs
AnswerA

XFS file systems are designed to be grow-only. The on-disk structures, especially the B+tree metadata and dynamic inode allocation, do not support in-place shrinkage, and there is neither an xfs_shrink command nor an option in xfs_growfs to reduce the size. To reduce the size, you must back up the data with tools such as xfsdump, destroy or remove the logical volume, recreate it at the desired size, create a new XFS file system, and restore the data. Attempting to shrink a live XFS file system with any tool is unsupported and will lead to corruption.

Why this answer

XFS is a high-performance 64-bit journaling file system that does not support online or offline shrinking. Once an XFS file system is created, its size cannot be reduced; the only way to reclaim space is to back up the data, destroy the file system, recreate it at the desired size, and restore the data. Therefore, any attempt to shrink an XFS file system using lvreduce or similar tools will corrupt the file system.

Exam trap

Red Hat often tests the misconception that any file system can be shrunk using logical volume management tools like lvreduce, but XFS is a notable exception that requires full data migration to reduce its size.

How to eliminate wrong answers

Option A is correct because XFS does not support shrinking. Option B is wrong because xfs_repair is used to repair an XFS file system, not to prepare it for shrinking, and lvreduce would shrink the logical volume without shrinking the XFS file system, causing corruption. Option C is wrong because unmounting and using lvreduce to shrink the logical volume still attempts to shrink an XFS file system, which is impossible; the subsequent mount and xfs_growfs would only grow the file system, not fix the corruption.

Option D is wrong because lvreduce -L 40G shrinks the logical volume without shrinking the XFS file system, and xfs_growfs is used to expand an XFS file system, not to shrink it; this sequence would corrupt the file system.

71
MCQeasy

A Red Hat Enterprise Linux system has a second disk /dev/sdb with a single partition /dev/sdb1 that was formatted as XFS and mounted at /mnt/backup. The administrator wants to change the filesystem on /dev/sdb1 to ext4 without losing existing data. Which steps should be taken in order?

A.Unmount, mkfs.ext4 /dev/sdb1, then mount
B.Use xfs_admin to change type
C.Use fsck.ext4 to convert in place
D.Backup data, unmount, mkfs.ext4, remount, restore data
AnswerD

The correct procedure is to first copy all data from /dev/sdb1 to a safe location (e.g., tar, rsync, or cp to another disk), then unmount the partition, run mkfs.ext4 /dev/sdb1 to create a new ext4 filesystem, remount the partition, and finally restore the data from the backup. This sequence preserves user files and directory structure because the destructive mkfs operation is performed only after a verified backup exists, and the restore repopulates the freshly formatted ext4 filesystem with the original content.

Why this answer

You cannot convert an XFS filesystem to ext4 in place; the only safe method is to back up the data, unmount the partition, create a new ext4 filesystem with mkfs.ext4, remount, and then restore the data. XFS and ext4 have fundamentally different on-disk structures (e.g., allocation groups vs. block groups, different journaling formats), so no in-place conversion tool exists.

Exam trap

The trap here is that candidates assume a filesystem can be 'converted' in place using a command like fsck or a tuning tool, when in fact only a backup-and-restore cycle is safe for changing between fundamentally different filesystem types like XFS and ext4.

How to eliminate wrong answers

Option A is wrong because running mkfs.ext4 on a partition that currently contains an XFS filesystem will overwrite the existing filesystem metadata, destroying all data without any conversion. Option B is wrong because xfs_admin is a tool for tuning XFS filesystem parameters (e.g., changing the UUID or label), not for changing the filesystem type to ext4. Option C is wrong because fsck.ext4 is a filesystem check and repair tool for ext4; it cannot convert an XFS filesystem to ext4, and attempting to run it on an XFS partition would fail or cause corruption.

72
MCQmedium

An administrator needs to create a new 500MB swap partition on a disk that already has an extended partition. The disk /dev/sda has partitions: /dev/sda1 (primary, /boot), /dev/sda2 (extended), /dev/sda5 (logical, swap, 2GB). The administrator wants to add another swap partition, but fdisk shows no free space. Which approach should be used?

A.Use LVM to create a logical volume for swap
B.Use a file-based swap file
C.Shrink the filesystem on /dev/sda1 to create free space
D.Delete /dev/sda5 and recreate it with larger size
AnswerB

A file-based swap file is the correct choice here because it can be created on any existing mounted filesystem without repartitioning the disk. You create a file (e.g., with fallocate or dd), then format it with mkswap and activate it with swapon, optionally adding an entry to /etc/fstab for persistence. This completely avoids the disk-space constraints and partition-table limitations that block the other options, making it the only immediately viable method to add 500MB of swap.

Why this answer

The disk has no free space (the extended partition consumes all remaining space after /dev/sda1, and logical partitions are contained within it). Adding a swap file is the simplest and safest approach: it does not require repartitioning, works with any filesystem, and is fully supported by systemd and swapon. The administrator can create a 500MB file, format it as swap with mkswap, and enable it with swapon.

Exam trap

The trap here is that candidates assume a new partition must be created, overlooking that swap files are a fully supported and simpler alternative when no free partition space exists.

How to eliminate wrong answers

Option A is wrong because the scenario does not mention LVM being in use; converting a non-LVM disk to LVM would require significant reconfiguration and is not the simplest solution. Option C is wrong because shrinking /dev/sda1 (a primary partition containing /boot) would not create free space outside the extended partition; the extended partition already occupies all remaining space, so any freed space would still be inside the extended partition and would require complex partition table manipulation. Option D is wrong because deleting /dev/sda5 and recreating it larger would still be limited by the size of the extended partition; it does not add a second swap partition, and it would destroy the existing swap without solving the need for additional swap space.

73
MCQmedium

A logical volume /dev/vg_data/lv_data formatted as XFS is full. The administrator extends the LV by 1 GB using 'lvextend -L +1G /dev/vg_data/lv_data'. Which additional command is required to use the new space?

A.xfs_repair /dev/vg_data/lv_data
B.xfs_growfs /mount/point
C.resize2fs /mount/point
D.lvresize -L +1G /dev/vg_data/lv_data
AnswerB

xfs_growfs is the intended command to expand an XFS filesystem to fill the newly available space in the underlying logical volume. It operates on a mounted filesystem and uses the VFS layer to increase data and inode block counts without offline downtime. The command's argument is the mount point (or device) and it extends the filesystem to the LV's current size. Because XFS can only grow (not shrink), this is the single missing step after the LV has already been enlarged.

Why this answer

After extending the logical volume, the XFS file system must be grown to recognize the new space. The `xfs_growfs` command resizes an XFS file system to fill the available space in the underlying block device, and it requires the mount point as an argument (not the device). This is necessary because XFS does not support online resizing via a simple block device extension; the file system must be explicitly told to expand.

Exam trap

The trap here is that candidates confuse the file system type and apply the wrong resize command (e.g., `resize2fs` for ext4) or think that extending the logical volume automatically grows the file system, which is not true for XFS.

How to eliminate wrong answers

Option A is wrong because `xfs_repair` is used to check and repair XFS file system corruption, not to resize it; running it on a healthy file system would be unnecessary and could cause downtime. Option C is wrong because `resize2fs` is the tool for ext2/ext3/ext4 file systems, not XFS; using it on an XFS file system would fail or cause damage. Option D is wrong because `lvresize` is the command to resize the logical volume itself, which has already been done with `lvextend`; repeating it would either do nothing or attempt to extend again, but it does not resize the file system.

Ready to test yourself?

Try a timed practice session using only Create and configure file systems questions.