CCNA Block Devices, Filesystems and Advanced Storage Questions

47 questions · Block Devices, Filesystems and Advanced Storage · All types, answers revealed

1
MCQeasy

Refer to the exhibit. A system administrator wants to replace disk sdb1 in the RAID1 array. After physically removing sdb, which sequence of commands should be used?

A.mdadm /dev/md0 --remove /dev/sdb1; mdadm /dev/md0 --add /dev/sdd1
B.mdadm /dev/md0 --fail /dev/sdb1; mdadm /dev/md0 --remove /dev/sdb1; mdadm /dev/md0 --add /dev/sdd1
C.mdadm /dev/md0 --fail /dev/sdb1; mdadm /dev/md0 --remove /dev/sdb1; mdadm --grow /dev/md0 --add /dev/sdd1; mdadm --manage /dev/md0 --run
D.mdadm /dev/md0 --fail /dev/sdb1; mdadm /dev/md0 --remove /dev/sdb1; mdadm /dev/md0 --add /dev/sdd1; mdadm --manage /dev/md0 --run
AnswerD

Proper sequence: fail, remove, add, run.

Why this answer

Option D is correct because after physically removing the failed disk (sdb), the administrator must first mark the device as failed using `--fail`, then remove it with `--remove`, add the new disk (sdd1) with `--add`, and finally run `--run` to ensure the array is activated if it was stopped or degraded. The `--run` flag is necessary because a RAID1 array with a missing device may not automatically start; this command forces the array to become active so the rebuild can begin.

Exam trap

The trap here is that candidates often forget the `--run` step, assuming the array will automatically start after adding a new disk, or they mistakenly use `--grow` for adding a replacement disk instead of `--add`.

How to eliminate wrong answers

Option A is wrong because it attempts to remove a device without first marking it as failed; `mdadm --remove` on an active device will fail unless the device is already failed or spare. Option B is wrong because it omits the `--run` command; after removing the failed disk and adding a new one, the array may remain in a stopped or degraded state and will not automatically start, preventing the rebuild. Option C is wrong because it incorrectly uses `--grow` instead of `--add` for adding a disk to a RAID1 array; `--grow` is used for reshaping arrays (e.g., changing RAID level or number of devices), not for adding a replacement disk, and the `--manage` flag with `--run` is redundant since `mdadm /dev/md0 --run` is the correct syntax.

2
MCQmedium

Refer to the exhibit. The administrator wants to mount /dev/sdb1 at /data using its UUID. Which /etc/fstab entry is correct?

A./dev/sdb1 /data ext4 defaults 0 0
B.PARTUUID=ijkl-9012 /data ext4 defaults 0 0
C.UUID=12345678-01 /data ext4 defaults 0 0
D.UUID=ijkl-9012 /data ext4 defaults 0 0
AnswerD

This entry uses the correct filesystem UUID from blkid.

Why this answer

Option D is correct because the administrator wants to mount /dev/sdb1 using its UUID, and the exhibit (not shown) indicates that the UUID of /dev/sdb1 is 'ijkl-9012'. The correct /etc/fstab syntax uses the 'UUID=' prefix followed by the actual UUID value, the mount point, filesystem type, options, dump, and pass fields. This ensures the filesystem is identified by its universally unique identifier, which remains stable even if the device name changes.

Exam trap

The trap here is that candidates often confuse UUID (filesystem identifier) with PARTUUID (partition identifier) or mistakenly use the wrong UUID value from the exhibit, leading them to select an option with an incorrect or mismatched identifier.

How to eliminate wrong answers

Option A is wrong because it uses the device path /dev/sdb1, not the UUID, which defeats the purpose of mounting by UUID and makes the mount vulnerable to device name changes. Option B is wrong because it uses 'PARTUUID=' which refers to a partition table UUID (GPT partition identifier), not the filesystem UUID; this would mount the partition by its partition identifier rather than the filesystem UUID. Option C is wrong because it uses 'UUID=12345678-01', which is not the correct UUID for /dev/sdb1 as indicated in the exhibit (the correct UUID is 'ijkl-9012').

3
MCQmedium

After adding a new LUN to an existing SAN, the administrator runs multipath -ll but sees the new LUN as 'failed'. The multipathd service is running. What is the most likely cause?

A.The multipathd daemon needs to be restarted
B.The new LUN has not been presented to the host from the SAN
C.The /etc/multipath.conf needs to be edited to include the new LUN
D.The scsi device needs to be manually created with mknod
AnswerB

If the LUN is not presented, the host cannot see it, causing all paths to show 'failed'.

Why this answer

When a new LUN appears as 'failed' in `multipath -ll` output, the most common cause is that the LUN has not been properly presented to the host from the SAN. Even if the multipathd service is running, multipathd can only manage devices that the SCSI layer has already discovered. If the SAN administrator has not zoned or masked the LUN to the host, the host's SCSI subsystem never sees the device, so multipathd reports it as 'failed' because it cannot find the underlying paths.

Exam trap

LPI often tests the misconception that multipathd needs a restart or configuration change for new LUNs, but the real issue is almost always the SCSI layer not having discovered the device due to incomplete SAN presentation or missing bus rescan.

How to eliminate wrong answers

Option A is wrong because restarting multipathd is unnecessary; multipathd automatically detects new devices via uevents, and a restart would not fix a missing SCSI device. Option C is wrong because /etc/multipath.conf does not need editing for a new LUN unless you require custom aliases or blacklisting; multipathd can manage any LUN discovered by the SCSI layer by default. Option D is wrong because modern Linux kernels automatically create SCSI device nodes via udev; manually using mknod is obsolete and would not resolve a missing LUN presentation.

4
MCQhard

A storage administrator sees the following output from multipath -ll: 'dm-3 (3600605b0038f1f0019f1f7e00000000) size=10G features='0' hwhandler='0' wp=rw' but the paths are all 'failed'. The scsi devices are listed in /proc/scsi/scsi. What is the most likely cause?

A.The device mapper is not configured
B.The multipathd daemon is not running
C.The SAN fiber cables are disconnected
D.The multipath configuration uses user_friendly_names but the bindings file is missing
AnswerC

If cables are disconnected, paths show 'failed' even though the scsi devices are detected.

Why this answer

The output from multipath -ll shows the multipath device dm-3 with its WWID and size, but all paths are 'failed'. Since /proc/scsi/scsi lists the SCSI devices, the host bus adapters (HBAs) and drivers are functioning at the OS level. The most common cause for all paths to fail simultaneously is a physical connectivity issue, such as disconnected SAN fiber cables, which prevents the initiator from reaching the target LUNs.

Exam trap

The trap here is that candidates see 'failed' paths and assume a software configuration issue (like multipathd not running or missing bindings), but the presence of the multipath device and SCSI devices in /proc/scsi/scsi points to a physical layer problem instead.

How to eliminate wrong answers

Option A is wrong because the device mapper is clearly configured and active, as evidenced by the multipath device dm-3 being listed in the output. Option B is wrong because if the multipathd daemon were not running, the multipath -ll command would not produce any output or would show an error; the fact that it returns device details indicates the daemon is operational. Option D is wrong because user_friendly_names and the bindings file affect only the naming of multipath devices (e.g., mpatha), not the path status; the output shows the WWID, so this feature is not in use or irrelevant to path failures.

5
Drag & Dropmedium

Order the steps to configure a Linux system as a DHCP client using dhclient.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order

Why this order

First configure the interface for DHCP, then run dhclient, check address, verify route, and test.

6
MCQhard

An administrator observes that only one path is shown as active for mpathb. What is the most likely cause?

A.The find_multipaths setting is incorrect.
B.The SCSI devices are not properly connected.
C.The multipathd service is not running.
D.The blacklist rule excludes the other path.
AnswerD

All sd devices are blacklisted, so only one path (maybe not blacklisted due to something else) appears.

Why this answer

When only one path is active for a multipath device (mpathb), the most likely cause is that the other path is being excluded by a blacklist rule in the multipath configuration. The blacklist can filter out devices based on WWID, device name, or vendor/product, preventing them from being aggregated into the multipath map. This results in the path being visible to the system but not used by multipathd.

Exam trap

The trap here is that candidates often assume a missing path is due to hardware or service issues, but LPIC-2 tests the understanding that multipath configuration files (especially blacklist rules) are a common cause of path exclusion, even when all physical connections are intact.

How to eliminate wrong answers

Option A is wrong because the find_multipaths setting controls whether multipathd automatically creates maps only for devices with multiple paths; it does not cause a single active path when multiple paths exist. Option B is wrong because if SCSI devices were not properly connected, neither path would appear, or both would show as faulty, not just one active path. Option C is wrong because if the multipathd service were not running, no multipath devices would be created at all, and the administrator would not see mpathb with a single active path.

7
MCQmedium

A system administrator needs to create a new 500 MB ext4 filesystem on /dev/sdb1 and mount it persistently at /data. Which set of commands accomplishes this task?

A.mkfs -t ext4 /dev/sdb1 && mount /dev/sdb1 /data
B.blkid /dev/sdb1 && echo 'UUID=... /data ext4 defaults 0 2' >> /etc/fstab && mount -a
C.mkfs.xfs /dev/sdb1 && echo '/dev/sdb1 /data xfs defaults 0 2' >> /etc/fstab && mount -a
D.mkfs.ext4 /dev/sdb1 && echo '/dev/sdb1 /data ext4 defaults 0 2' >> /etc/fstab && mount -a
AnswerD

Correctly creates ext4 filesystem and adds fstab entry for persistent mount.

Why this answer

Option D is correct because it first creates an ext4 filesystem on /dev/sdb1 using mkfs.ext4, then appends a mount entry to /etc/fstab with the correct filesystem type (ext4) and mount point (/data), and finally runs mount -a to mount all filesystems from fstab, including the new one. This sequence ensures the filesystem is created, persistently configured, and immediately mounted.

Exam trap

The trap here is that candidates may choose Option A because it seems to create and mount the filesystem, but they overlook the requirement for persistent mounting via /etc/fstab, or they may pick Option C because they confuse ext4 with XFS, not reading the filesystem type specification carefully.

How to eliminate wrong answers

Option A is wrong because it only creates the filesystem and mounts it temporarily; it does not add an entry to /etc/fstab, so the mount will not persist across reboots. Option B is wrong because it uses blkid to retrieve the UUID but then only shows a placeholder 'UUID=...' without actually inserting the real UUID into the fstab entry, and it does not create the filesystem (no mkfs command), so /dev/sdb1 may not have a filesystem at all. Option C is wrong because it creates an XFS filesystem (mkfs.xfs) and adds an XFS entry to fstab, but the question specifically requires an ext4 filesystem, not XFS.

8
Multi-Selecthard

Which TWO statements about LVM thin provisioning are correct?

Select 2 answers
A.Thin pools automatically extend when they reach 80% usage.
B.It allows creating logical volumes that can be larger than the available physical storage.
C.A thin pool cannot be extended once created.
D.It is only supported on SSDs.
E.Thin snapshots are space-efficient because they share data blocks.
AnswersB, E

Thin provisioning enables over-commitment.

Why this answer

Option B is correct because LVM thin provisioning allows creating logical volumes that appear larger than the available physical storage (overcommitment). This is achieved by allocating data blocks on demand from a thin pool, rather than reserving them at creation time. The thin pool itself must have sufficient physical storage to accommodate actual writes, but the logical volume size can exceed the pool's capacity.

Exam trap

The trap here is that candidates confuse thin provisioning with automatic extension or assume thin pools are static, when in fact thin pools can be extended and automatic extension requires explicit configuration.

9
MCQeasy

A server running Linux with an ext4 filesystem on /dev/sda1 has experienced an unexpected power loss due to a faulty power supply. After replacing the power supply and rebooting, the system fails to mount /dev/sda1 with an error message indicating 'wrong superblock magic number' or 'superblock corrupted'. The administrator recalls that ext4 filesystems have backup superblocks created during mkfs. Using the command 'dumpe2fs /dev/sda1 | grep -i backup' is not possible because the device is not mountable. However, the administrator remembers that for this specific filesystem, a backup superblock is located at block offset 32768 based on the output of 'mke2fs -n' from the original creation. What is the correct course of action to recover the filesystem and mount it?

A.Run `fsck.ext4 -b 32768 /dev/sda1` to restore the superblock, then mount the filesystem.
B.Run `e2fsck -fy /dev/sda1` to force a filesystem check.
C.Run `dd if=/dev/zero of=/dev/sda1 bs=4k count=1` to zero the superblock, then create a new filesystem with mkfs.ext4.
D.Run `tune2fs -j /dev/sda1` to add a journal to the filesystem.
AnswerA

This uses the backup superblock at block 32768 to repair the filesystem, allowing it to mount.

Why this answer

Option A is correct because fsck.ext4 with the -b option specifies the backup superblock location, allowing the filesystem to be repaired and mounted. Option B destroys the superblock and data. Option C adds a journal but does not recover the superblock.

Option D attempts to use the default superblock, which is corrupted, and will likely fail.

10
MCQhard

A system's root filesystem on /dev/sda1 is offline. The administrator boots into rescue mode and needs to check the filesystem integrity. Which command should be used first?

A.dumpe2fs /dev/sda1
B.fsck.ext4 -f /dev/sda1
C.e2fsck -p /dev/sda1
D.fsck -N /dev/sda1
AnswerC

The -p (preen) option automatically fixes safe problems without prompting.

Why this answer

Option C is correct because `e2fsck -p` runs an automatic, non-interactive filesystem check on the ext2/ext3/ext4 filesystem, which is the safest first step when the root filesystem is offline and the administrator is in rescue mode. The `-p` flag automatically repairs any problems that can be safely fixed without user intervention, minimizing risk of further damage. This command is specifically designed for ext-family filesystems and is the recommended initial integrity check before attempting any manual repairs.

Exam trap

The trap here is that candidates confuse `dumpe2fs` (metadata display) or `fsck -N` (dry-run) with actual integrity checking, or they choose `fsck.ext4 -f` thinking a forced check is always best, overlooking that the `-p` (preen) mode is the standard first-step for safe, automated repair in rescue environments.

How to eliminate wrong answers

Option A is wrong because `dumpe2fs` only displays superblock and block group information (metadata) from the filesystem; it does not perform any integrity check or repair, so it cannot verify filesystem integrity. Option B is wrong because `fsck.ext4 -f` forces a full check even if the filesystem appears clean, but it runs interactively by default and may prompt for user input, which is undesirable in a rescue scenario where automation and safety are prioritized; the `-p` flag in option C is more appropriate for a first pass. Option D is wrong because `fsck -N` merely shows what would be done (a dry-run) without actually checking or repairing the filesystem, so it provides no integrity verification.

11
MCQhard

Refer to the exhibit. The /data filesystem is nearly full. The administrator has added a new disk /dev/sdc with 10GB capacity. The VG currently has no free space. Which steps will increase the available space for /data using LVM and ext4?

A.vgextend vg /dev/sdc; lvextend -L +10G /dev/vg/data; resize2fs /dev/vg/data
B.pvcreate /dev/sdc; lvextend -L +10G /dev/vg/data; resize2fs /dev/vg/data
C.pvcreate /dev/sdc; vgextend vg /dev/sdc; lvextend -l +50%FREE /dev/vg/data; resize2fs /dev/vg/data
D.pvcreate /dev/sdc; vgextend vg /dev/sdc; lvextend -l +100%FREE /dev/vg/data; resize2fs /dev/vg/data
AnswerD

Correctly adds the PV, extends VG, extends LV with all free space, and resizes the filesystem.

Why this answer

Option D is correct because it follows the proper LVM workflow: create a physical volume (pvcreate), add it to the volume group (vgextend), extend the logical volume using all free space in the VG (lvextend -l +100%FREE), and then resize the ext4 filesystem (resize2fs). This ensures the new 10GB disk is fully utilized for /data.

Exam trap

The trap here is that candidates often forget the mandatory pvcreate step or confuse the extent-based -l option with the size-based -L option, leading them to choose options that either skip a critical step or allocate only partial capacity.

How to eliminate wrong answers

Option A is wrong because it skips pvcreate, which is required to initialize /dev/sdc as a physical volume before it can be added to a VG; vgextend alone will fail. Option B is wrong because it omits vgextend, so the new PV is never added to the VG, and lvextend cannot allocate space from an unassociated PV. Option C is wrong because -l +50%FREE only allocates half of the available free space (5GB), not the full 10GB, leaving the filesystem undersized.

12
MCQeasy

Which command can be used to display all UUIDs of block devices that contain filesystems?

A.lsblk -f
B.both A and B
C.blkid
D.fdisk -l
AnswerB

Both blkid and lsblk -f display UUIDs.

Why this answer

Both `lsblk -f` and `blkid` are designed to display UUIDs for block devices that contain filesystems. `lsblk -f` shows filesystem information including UUIDs in a tree-like format, while `blkid` directly queries the UUID and filesystem type from block device metadata. Option B is correct because both commands fulfill the requirement.

Exam trap

The trap here is that candidates often think only one command (usually `blkid`) can display UUIDs, forgetting that `lsblk -f` also shows this information, leading them to pick a single option instead of the combined answer.

How to eliminate wrong answers

Option A is wrong because `lsblk -f` is actually a valid command that displays UUIDs, so it is not incorrect on its own; the question asks for a single command but both A and C work, making B the correct answer. Option C is wrong because `blkid` is also a valid command that displays UUIDs, so it is not incorrect on its own; the trap is that candidates might think only one command works. Option D is wrong because `fdisk -l` lists partition tables (sizes, types, start/end sectors) but does not display filesystem UUIDs; it only shows partition type IDs (e.g., 83 for Linux) and never queries the filesystem superblock for UUIDs.

13
MCQhard

A database server uses LVM with an XFS filesystem on /dev/vg_data/lv_db, mounted at /var/lib/mysql. The LV is at 95% capacity. A new 50GB disk /dev/sdd has been added and initialized as a physical volume, then added to the volume group vg_data. The database is running and cannot be stopped. The administrator must extend the LV and filesystem. What is the correct course of action?

A.Run `lvextend -L +50G /dev/vg_data/lv_db` followed by `resize2fs /dev/vg_data/lv_db`.
B.Run `lvextend -L +50G /dev/vg_data/lv_db` followed by `xfs_growfs /var/lib/mysql`.
C.Unmount /var/lib/mysql, run `lvextend -L +50G /dev/vg_data/lv_db`, run `resize2fs /dev/vg_data/lv_db`, then remount.
D.Run `lvresize -L +50G /dev/vg_data/lv_db`.
AnswerB

Correct: lvextend extends the LV online, and xfs_growfs resizes the XFS filesystem while mounted.

Why this answer

Option D is correct because lvextend extends the logical volume without unmounting, and xfs_growfs can online resize an XFS filesystem. Option A uses resize2fs, which is only for ext2/3/4 filesystems. Option B does not resize the filesystem at all.

Option C includes an unmount step, which would cause unacceptable downtime for a running database.

14
Multi-Selecthard

Which THREE of the following are correct statements about LVM thin provisioning? (Select THREE)

Select 3 answers
A.Snapshots of thin volumes use the same pool.
B.Thin provisioning allows overcommitment of physical storage.
C.A thin pool can be resized smaller without data loss.
D.A thin volume can be larger than the pool.
E.Thin volumes must be created before the thin pool.
AnswersA, B, D

Both thin volumes and snapshots share pool space.

Why this answer

Option A is correct because LVM thin provisioning uses a shared thin pool to store data for all thin volumes and their snapshots. When a snapshot of a thin volume is created, it does not allocate separate physical storage; instead, it references the same thin pool, allowing efficient space usage and copy-on-write semantics.

Exam trap

The trap here is that candidates confuse thin pool resizing with standard logical volume resizing, assuming lvreduce can shrink a thin pool safely, when in fact LVM does not support shrinking thin pools without risking data loss.

15
MCQmedium

An administrator creates a new XFS filesystem on /dev/vg/data and needs to mount it at /data with noatime and a stripe unit of 1 MiB. Which /etc/fstab entry is correct?

A./dev/vg/data /data xfs defaults,noatime,sunit=2048 0 0
B./dev/vg/data /data xfs defaults,noatime,swidth=2048 0 0
C./dev/vg/data /data xfs defaults,noatime,allocsize=1m 0 0
D./dev/vg/data /data xfs defaults,noatime,sunit=1024 0 0
AnswerA

sunit=2048 sectors = 1 MiB stripe unit, with noatime.

Why this answer

Option A is correct because the `sunit` mount option specifies the stripe unit in 512-byte blocks. A stripe unit of 1 MiB equals 2048 blocks (1 MiB = 1024 KiB = 2048 * 512 bytes). The `noatime` option disables access time updates.

This entry correctly mounts the XFS filesystem at /data with the required parameters.

Exam trap

The trap here is confusing the unit of measurement: candidates often forget that `sunit` is in 512-byte blocks, not bytes or kilobytes, leading them to choose `sunit=1024` (which is only 512 KiB) instead of the correct `sunit=2048` for 1 MiB.

How to eliminate wrong answers

Option B is wrong because `swidth` specifies the stripe width (total stripe size across all data disks), not the stripe unit; it would be used in addition to `sunit` for RAID configurations, not alone. Option C is wrong because `allocsize=1m` sets the pre-allocation size for file writes, not the stripe unit; it does not affect RAID stripe alignment. Option D is wrong because `sunit=1024` corresponds to a stripe unit of 512 KiB (1024 * 512 bytes), not the required 1 MiB.

16
MCQmedium

An administrator runs the command shown. However, when a user tries to execute a binary from /mnt/tmp, it fails with 'Permission denied'. What is the most likely cause?

A.The noexec mount option prevents execution.
B.The binary is not executable.
C.The tmpfs filesystem does not support execution.
D.The nosuid option prevents setuid binaries.
AnswerA

noexec explicitly disallows execution.

Why this answer

The `noexec` mount option explicitly prevents execution of any binaries on the filesystem, regardless of their permission bits. When a filesystem is mounted with `noexec`, the kernel will refuse to execute any file on that mount point, returning 'Permission denied' even if the file has execute permissions set. This is the most likely cause because the administrator's command likely mounted `/mnt/tmp` with `noexec` (e.g., via `mount -o noexec` or a default mount option).

Exam trap

The trap here is that candidates often focus on file permissions (Option B) or filesystem type (Option C) without considering mount options, which override lower-level permissions and are a frequent LPIC-2 exam topic.

How to eliminate wrong answers

Option B is wrong because if the binary were not executable, the error would typically be 'Permission denied' only if the user lacks execute permission on the file itself, but the question states the user tries to execute a binary from /mnt/tmp, implying the binary exists and has execute bits set; the noexec mount option overrides file permissions. Option C is wrong because tmpfs does support execution by default; it is a RAM-based filesystem that can execute binaries unless explicitly mounted with noexec. Option D is wrong because the nosuid option only prevents setuid/setgid bits from taking effect, not regular execution; a binary without setuid would still run.

17
MCQeasy

An administrator needs to create an ext4 filesystem on /dev/sdb1 with a block size of 4096 bytes and reserve 2% of blocks for root. Which command accomplishes this?

A.mkfs.ext4 --block-size 4096 -m 2 /dev/sdb1
B.mkfs.ext4 -B 4096 -m 2 /dev/sdb1
C.mkfs.ext4 -b 4096 -m 2 /dev/sdb1
D.mkfs.ext4 -b 4096 -M 2 /dev/sdb1
AnswerC

-b sets block size to 4096 bytes; -m sets reserved percentage to 2.

Why this answer

Option C is correct because mkfs.ext4 uses the `-b` option to specify the block size in bytes (4096) and `-m` to set the reserved blocks percentage for root (2%). The `-b` flag is the standard short form for block size in the mke2fs family of tools, and `-m` accepts a percentage value directly.

Exam trap

The trap here is that candidates confuse the `-b` (block size) and `-m` (reserved blocks percentage) flags with similar-looking but incorrect flags like `-B` or `-M`, or mistakenly use long options like `--block-size` without verifying the exact syntax supported by mkfs.ext4.

How to eliminate wrong answers

Option A is wrong because `--block-size` is not a valid long option for mkfs.ext4; the correct long option is `--block-size` but the short form `-b` is required here, and the double-dash syntax is incorrect for this command. Option B is wrong because `-B` is not a valid flag for mkfs.ext4; the uppercase `-B` is used by some other filesystem tools (e.g., mkfs.xfs) but not for ext4, where block size is set with lowercase `-b`. Option D is wrong because `-M` is not a valid flag for mkfs.ext4; the correct flag to set reserved block percentage is lowercase `-m`, and `-M` is unrecognized and would cause an error.

18
Multi-Selectmedium

Which two commands can be used to create a swap space on a partition /dev/sdb2? (Choose two.)

Select 2 answers
A.mkswap /dev/sdb2
B.swapon /dev/sdb2
C.dd if=/dev/zero of=/dev/sdb2 bs=1M count=1024
D.mkswap -L swap /dev/sdb2
E.mkfs.swap /dev/sdb2
AnswersA, D

mkswap writes a swap signature to the partition.

Why this answer

The `mkswap` command initializes a partition or file for use as swap space by writing a swap signature (UUID and superblock) to the device. Option A is correct because `mkswap /dev/sdb2` creates the swap filesystem on the specified partition. Option D is also correct because `mkswap -L swap /dev/sdb2` does the same but additionally assigns a label 'swap' to the swap area, which is a valid variant of the command.

Exam trap

The trap here is that candidates confuse `mkswap` (which creates the swap filesystem) with `swapon` (which activates it), or they assume a generic `mkfs.*` command exists for swap, leading them to pick the invalid `mkfs.swap` option.

19
MCQhard

An administrator wants to create a thin provisioned LVM pool and a thin volume. Which sequence of commands is correct?

A.lvcreate -L 10G -T vg/pool; lvcreate -V 5G -T vg/pool/thinvol
B.lvcreate -L 10G --thinpool vg/pool; lvcreate -V 5G --thin vg/pool/thinvol
C.lvcreate -L 10G -T vg/pool; lvcreate -n thinvol -V 5G vg/pool
D.lvcreate -L 10G -T vg/pool; lvcreate -V 5G -n thinvol vg/pool
AnswerB

Correct syntax for thin pool and thin volume.

Why this answer

Option B is correct because it uses the correct LVM commands to create a thin provisioned pool and a thin volume. The first command, `lvcreate -L 10G --thinpool vg/pool`, creates a thin pool named 'pool' in volume group 'vg' with a 10G metadata and data area. The second command, `lvcreate -V 5G --thin vg/pool/thinvol`, creates a thin volume named 'thinvol' within that pool, specifying the virtual size with `-V`.

The `--thinpool` and `--thin` flags are the proper LVM2 syntax for thin provisioning.

Exam trap

The trap here is that candidates confuse the `-T` flag (which can create both thin pools and thin volumes depending on context) with the explicit `--thinpool` and `--thin` flags, and often forget that creating a thin volume requires specifying the pool path (e.g., `vg/pool/thinvol`) and the `--thin` flag, not just a regular `lvcreate` with `-n`.

How to eliminate wrong answers

Option A is wrong because it uses `-T` (which is a shorthand for `--thin` and is used to create a thin pool, but the syntax `lvcreate -L 10G -T vg/pool` is incorrect; `-T` requires a pool name and a volume group, but the correct form is `lvcreate -L 10G --thinpool vg/pool` or `lvcreate -L 10G -T vg/pool` is actually valid for creating a thin pool, but the second command `lvcreate -V 5G -T vg/pool/thinvol` is wrong because `-T` is not used for creating thin volumes; it should be `--thin`. Option C is wrong because the second command `lvcreate -n thinvol -V 5G vg/pool` attempts to create a regular logical volume, not a thin volume, and does not specify the thin pool or use the `--thin` flag. Option D is wrong because the second command `lvcreate -V 5G -n thinvol vg/pool` also creates a regular logical volume, missing the `--thin` flag and the pool path.

20
MCQeasy

A filesystem is reported as 'read-only' after an unexpected power failure. Which command should be used to attempt repair without data loss?

A.mount -o remount,rw /dev/sda1
B.fsck -y /dev/sda1
C.fsck -n /dev/sda1
D.e2fsck -p /dev/sda1
AnswerC

Read-only check, no repairs, safe to assess damage.

Why this answer

After an unexpected power failure, the filesystem may have been marked as needing a clean replay of its journal, but it is not necessarily corrupted. Running `fsck -n` performs a read-only check of the filesystem without making any changes, allowing you to assess the extent of damage or confirm that the journal replay is all that is needed. This avoids the risk of `fsck` making incorrect automatic repairs that could cause data loss, which is critical when the root cause is an unclean shutdown rather than structural corruption.

Exam trap

The trap here is that candidates assume any filesystem issue after a power failure requires automatic repair (`-y` or `-p`), but the correct first step is a read-only check (`-n`) to avoid data loss from premature or unnecessary writes.

How to eliminate wrong answers

Option A is wrong because `mount -o remount,rw` attempts to force the filesystem to read-write without checking its integrity; if the filesystem is marked as needing a journal replay or has minor inconsistencies, this can lead to further corruption or data loss. Option B is wrong because `fsck -y` automatically answers 'yes' to all repair prompts, which can apply destructive fixes (e.g., removing inodes or truncating files) that may not be necessary after a power failure, potentially causing data loss. Option D is wrong because `e2fsck -p` (the 'preen' mode) automatically repairs filesystem issues that are considered safe, but after a power failure, the filesystem may only need a journal replay (which happens on mount), and running `e2fsck -p` can still make unnecessary changes that risk data loss.

21
Multi-Selecthard

Which three conditions must be met for a filesystem to be mounted by UUID in /etc/fstab? (Choose three.)

Select 3 answers
A.The blkid command must have been run at least once
B.The UUID must be listed in the kernel's boot parameters
C.The UUID must be present in /dev/disk/by-uuid/
D.The filesystem must be formatted with a utility that writes UUIDs
E.The UUID in fstab must match the filesystem's UUID
AnswersC, D, E

The kernel uses this symlink to resolve the UUID to a device.

Why this answer

Option C is correct because the Linux kernel and udev create symbolic links in /dev/disk/by-uuid/ for each block device that has a UUID. When /etc/fstab specifies a filesystem by UUID, the mount command resolves the UUID by looking up the corresponding symlink in this directory. If the symlink is missing (e.g., due to a missing udev rule or a corrupted device), the mount will fail.

Exam trap

The trap here is that candidates often think blkid must be run first to 'register' the UUID, but in reality, udev and the kernel automatically populate /dev/disk/by-uuid/ at boot or when a device is added.

22
MCQhard

An administrator needs to configure iSCSI multipathing. After setting up two paths, which command should be used to verify the multipath topology?

A.multipath -l
B.lsscsi
C.dmsetup ls
D.iscsiadm -m session -P 3
AnswerA

This shows multipath topology.

Why this answer

The `multipath -l` command displays the current multipath topology, showing the aggregated device mapper (dm) devices, their underlying paths, and their status (active/passive or active/active). This is the standard tool for verifying multipath configuration after setting up iSCSI paths, as it reads the multipathd state and presents a human-readable map of the multipath devices.

Exam trap

The trap here is that candidates often confuse `iscsiadm -m session -P 3` (which shows iSCSI session details) with a multipath verification command, but it only shows individual iSCSI connections, not the aggregated multipath topology.

How to eliminate wrong answers

Option B (`lsscsi`) is wrong because it lists SCSI devices and their transport details but does not show multipath topology or aggregated device mapper devices. Option C (`dmsetup ls`) is wrong because it lists all device mapper devices (including LVM and multipath) but does not display path grouping, failover status, or the multipath topology in a structured way. Option D (`iscsiadm -m session -P 3`) is wrong because it shows detailed iSCSI session and connection information (including portal groups and TPGs) but does not aggregate paths into multipath devices or display the multipath topology.

23
MCQmedium

A system administrator notices that a new 1TB NVMe drive (/dev/nvme0n1) is not detected by the kernel. The hardware is confirmed working. Which troubleshooting step should be taken first to check if the drive is recognized by the system's PCI subsystem?

A.Run lsblk to list all block devices.
B.Check dmesg output for errors.
C.Run lspci to verify the NVMe controller is detected.
D.Run fdisk -l /dev/nvme0n1 to probe the drive.
AnswerC

lspci shows PCI devices, including NVMe controllers.

Why this answer

The NVMe drive is not detected by the kernel, but the hardware is confirmed working. The first step is to verify whether the PCI subsystem sees the NVMe controller, because NVMe devices are connected via the PCI Express bus. Running lspci lists all PCI devices, including the NVMe controller; if it does not appear, the issue is at the PCI or hardware level, not the block layer.

Exam trap

The trap here is that candidates assume a missing block device must be checked with block-level tools like lsblk or fdisk, when the correct first step is to verify the PCI bus enumeration with lspci, because NVMe drives are PCIe-attached and the kernel cannot see them without a detected controller.

How to eliminate wrong answers

Option A is wrong because lsblk lists block devices that are already recognized by the kernel; if the drive is not detected, lsblk will not show it, providing no diagnostic information about the PCI subsystem. Option B is wrong because checking dmesg output is a secondary step after confirming PCI detection; dmesg may show errors, but it does not directly query the PCI bus and can be verbose or miss the root cause if the controller is not enumerated. Option D is wrong because fdisk -l /dev/nvme0n1 attempts to probe a specific block device that does not exist in /dev, which will fail with an error and does not check the PCI subsystem at all.

24
MCQmedium

A Linux administrator is managing a database server running on CentOS 7 that uses ext4 filesystems on LVM. The server has three physical volumes: /dev/sda (200GB), /dev/sdb (200GB), and /dev/sdc (200GB) all in volume group 'vg_db'. The logical volume 'lv_data' (400GB) is used for database files. Recently, the DBA reports that database writes are slower than expected. Iostat shows high average wait times (>100ms) on /dev/sdc but normal on /dev/sda and /dev/sdb. The LVM stripes data across all three PVs with a stripe size of 64KB. Which action should the administrator take to improve performance?

A.Replace /dev/sdc with a new disk and restore the mirror or restripe.
B.Convert lv_data to linear mapping on /dev/sda and /dev/sdb only.
C.Increase the stripe size to 256KB to reduce I/O overhead.
D.Remove /dev/sdc from the volume group and reduce the stripe count to 2.
AnswerA

The slow disk is the bottleneck; replacing it resolves the issue.

Why this answer

The high average wait time on /dev/sdc indicates that this specific physical volume is a performance bottleneck, likely due to hardware failure or degradation. Since the logical volume 'lv_data' stripes data across all three PVs, the overall write performance is limited by the slowest device in the stripe set. Replacing /dev/sdc with a new disk and restoring the stripe (e.g., using pvmove to relocate extents and then replacing the device) eliminates the bottleneck and restores balanced I/O across all PVs.

Exam trap

The trap here is that candidates may think increasing stripe size or reducing stripe count will improve performance, but they overlook that a single failing or slow physical volume in a striped logical volume creates a synchronous bottleneck that cannot be mitigated by tuning stripe parameters alone.

How to eliminate wrong answers

Option B is wrong because converting to linear mapping on only two PVs would reduce total available bandwidth and capacity, and would not address the underlying hardware issue on /dev/sdc; the slow device would still be in use if not removed. Option C is wrong because increasing the stripe size to 256KB would change the I/O pattern but does not fix a failing or slow physical disk; it may even worsen latency for small random writes. Option D is wrong because simply removing /dev/sdc from the volume group and reducing the stripe count to 2 would require a full restripe and data migration, and does not address the fact that the remaining two PVs may not provide the same performance as the original three; also, the slow disk is still present and could cause further issues.

25
Multi-Selecteasy

Which two commands display information about LVM physical volumes? (Choose two.)

Select 2 answers
A.pvs
B.pvcreate
C.pvck
D.pvscan
E.pvdisplay
AnswersA, E

pvs provides a concise listing of physical volumes.

Why this answer

The `pvs` command (option A) provides a concise, configurable listing of all LVM physical volumes, showing key attributes like PV name, VG name, size, and free space. The `pvdisplay` command (option E) offers a detailed, verbose display of physical volume properties, including metadata areas, PE size, and allocation status. Both are standard LVM utilities for querying PV information.

Exam trap

The trap here is that candidates often confuse `pvscan` (which does display PVs after scanning) with a dedicated display command, but the LPIC-2 exam expects `pvs` and `pvdisplay` as the standard information-display tools, while `pvscan` is categorized as a scanning/discovery command.

26
MCQhard

A company runs a database server on Linux with a 4-disk RAID 10 array using mdadm. The server recently experienced a power outage. After reboot, the array is not assembling automatically. The administrator runs `mdadm --assemble --scan` and it fails with a message: 'mdadm: /dev/md0 has been found but is not a valid md superblock.' The administrator checks /proc/mdstat and sees no arrays. The disks /dev/sda, /dev/sdb, /dev/sdc, /dev/sdd are present. Running `mdadm --examine /dev/sda` shows no md superblock, but the disk contains data partitions. The administrator suspects that the superblock may be corrupted or that the disks were accidentally overwritten. The administrator has documentation that the array was created with the following parameters: RAID level 10, 4 disks, chunk size 512 KiB, metadata 1.2. What is the best course of action to recover the array?

A.Use `mdadm --create --level=10 --raid-devices=4 --chunk=512 --metadata=1.2 /dev/md0 /dev/sda /dev/sdb /dev/sdc /dev/sdd` without --assume-clean and then run fsck.
B.Run `mdadm --examine --scan` to probe for superblocks on all disks, then attempt recovery with --super-minor or --uuid.
C.Use `dd` to backup each disk's first few sectors, then use a data recovery tool.
D.Use `mdadm --create --level=10 --raid-devices=4 --chunk=512 --metadata=1.2 --assume-clean /dev/md0 /dev/sda /dev/sdb /dev/sdc /dev/sdd` and then mount.
AnswerD

--assume-clean writes new superblocks but does not modify data areas, preserving data.

Why this answer

Option D is correct because when the md superblock is missing or corrupted on all disks (as confirmed by `mdadm --examine` showing no superblock), the only way to recover the array is to recreate it with `--assume-clean`. This tells mdadm to trust that the data on the disks is already in a consistent RAID 10 layout without performing an initial resync, which would overwrite the existing data. The parameters must exactly match the original creation (RAID 10, 4 disks, chunk 512 KiB, metadata 1.2) to reconstruct the correct data mapping.

Exam trap

The trap here is that candidates mistakenly think `--create` always destroys data, but with `--assume-clean` it reconstructs the metadata without overwriting existing data, making it the correct recovery step when superblocks are lost.

How to eliminate wrong answers

Option A is wrong because `mdadm --create` without `--assume-clean` will initiate a full resync of the array, which would overwrite the existing data on the disks and destroy any chance of recovery. Option B is wrong because `mdadm --examine --scan` will not find superblocks if they are corrupted or missing, as already confirmed by the administrator; this option assumes superblocks are intact but just not being detected, which is not the case. Option C is wrong because using `dd` to backup the first few sectors is unnecessary and does not directly recover the array; data recovery tools are for filesystem-level recovery after the array is reassembled, not for fixing a missing superblock.

27
MCQhard

An administrator wants to convert an ext4 filesystem to Btrfs without losing data. Which procedure should be used?

A.btrfs-convert /dev/sda1
B.mkfs.btrfs /dev/sda1
C.cp -a /mnt/ext4 /mnt/btrfs
D.btrfs device add /dev/sda1 /mnt
AnswerA

This command converts ext4 to Btrfs without data loss.

Why this answer

The correct procedure is to use `btrfs-convert /dev/sda1`, which is a dedicated tool that performs an in-place conversion of an existing ext2/3/4 filesystem to Btrfs while preserving all existing data. It works by creating a Btrfs filesystem that wraps the original ext4 data structures, then allowing a gradual migration to native Btrfs features via a background process.

Exam trap

The trap here is that candidates may confuse `btrfs-convert` with `mkfs.btrfs` or assume that a simple copy operation is sufficient, overlooking the fact that only `btrfs-convert` performs a true in-place filesystem conversion without data loss.

How to eliminate wrong answers

Option B is wrong because `mkfs.btrfs /dev/sda1` creates a new Btrfs filesystem from scratch, which would overwrite and destroy all existing data on the partition. Option C is wrong because `cp -a /mnt/ext4 /mnt/btrfs` is a manual file copy that requires both filesystems to be mounted simultaneously and does not convert the underlying filesystem; it also risks permission and metadata loss if not done with extreme care. Option D is wrong because `btrfs device add /dev/sda1 /mnt` adds a block device to an existing Btrfs filesystem, but it does not convert an ext4 filesystem; it would fail if the target is not already a Btrfs filesystem.

28
Matchingmedium

Match each security tool to its function.

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

Concepts
Matches

Packet filtering firewall using netfilter

Successor to iptables with improved syntax

Mandatory access control (MAC) system

Mandatory access control using profiles

Intrusion prevention by banning IPs based on logs

Why these pairings

These tools enhance Linux security.

29
Drag & Dropmedium

Arrange the steps to configure a Linux system as a PostgreSQL database server.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order

Why this order

Install, initialize, start, create user/database, then test.

30
MCQmedium

An administrator wants to use /dev/sdb for a new ext4 filesystem. Which step must be performed first?

A.Mount /dev/sdb to a directory using mount.
B.Create the ext4 filesystem directly on /dev/sdb using mkfs.ext4.
C.Run partprobe /dev/sdb to update the kernel partition table.
D.Create a partition table on /dev/sdb using fdisk.
AnswerD

Correct: A partition must be created first; the disk has no partition table.

Why this answer

Option A is correct because the exhibit shows /dev/sdb without any partitions. Before creating a filesystem, a partition table must be created (e.g., using fdisk) and at least one partition defined. Option B would attempt to create a filesystem directly on the disk, which is possible but not typical and may cause issues with tools expecting partitions.

Option C (partprobe) is only needed after modifying the partition table. Option D (mount) would fail because no filesystem exists.

31
MCQeasy

Which file contains the filesystem table that is read during system boot to mount filesystems?

A./etc/mtab
B./proc/mounts
C./etc/mounts
D./etc/fstab
AnswerD

fstab is read at boot to mount filesystems.

Why this answer

Option D is correct because /etc/fstab is the filesystem table file that is read by the system during boot (via mount -a or systemd-fstab-generator) to automatically mount filesystems. It contains entries specifying devices, mount points, filesystem types, mount options, dump and pass fields, and is the standard configuration file for static filesystem mounting.

Exam trap

The trap here is that candidates confuse /etc/fstab (the static boot-time configuration) with /etc/mtab (the dynamic runtime mount list) or /proc/mounts (the kernel's current view), especially since /etc/mtab is often a symlink to /proc/self/mounts on modern systems.

How to eliminate wrong answers

Option A is wrong because /etc/mtab is a dynamically maintained file that lists currently mounted filesystems, not a configuration file read during boot; it is updated by the mount command and often a symlink to /proc/self/mounts on modern systems. Option B is wrong because /proc/mounts is a virtual filesystem (procfs) that shows the kernel's current mount table, not a persistent configuration file read at boot. Option C is wrong because /etc/mounts does not exist as a standard file; the correct configuration file is /etc/fstab, and /etc/mtab is the runtime mount list.

32
Multi-Selecteasy

Which THREE of the following are correct about RAID 1 in mdadm? (Select THREE)

Select 3 answers
A.It provides striping.
B.It can have a hot spare.
C.It requires at least 2 disks.
D.It provides mirroring.
E.It uses a bitmap for resync.
AnswersB, C, D

Hot spare can be configured.

Why this answer

RAID 1 in mdadm provides mirroring, where data is written identically to two or more disks. A hot spare is supported: if a disk fails, mdadm automatically rebuilds the mirror onto the spare. This requires at least 2 disks to form the mirror.

Exam trap

The trap here is that candidates often confuse RAID 1 with RAID 0 or RAID 5, assuming striping or mandatory bitmaps are part of RAID 1, when in fact mirroring and hot spare support are the key characteristics tested.

33
Matchingmedium

Match each LVM term to its definition.

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

Concepts
Matches

A storage device or partition used by LVM

A pool of physical volumes that can be allocated to logical volumes

A virtual block device created from a volume group

The smallest allocatable unit in a physical volume

Maps to a physical extent in a logical volume

Why these pairings

LVM uses these terms to manage disk storage.

34
MCQmedium

A filesystem check on an XFS filesystem reports corruption. What is the recommended way to repair it?

A.Run xfs_check on the mounted filesystem.
B.Run xfs_repair on the unmounted filesystem.
C.Run xfs_repair -n first, then unmount and repair.
D.Run fsck -t xfs on the mounted filesystem.
AnswerC

Best practice: run in no modify mode before actual repair.

Why this answer

Option C is correct because the recommended procedure for repairing a corrupted XFS filesystem is to first run `xfs_repair -n` in dry-run mode to assess the damage without making changes, then unmount the filesystem and run `xfs_repair` to perform the actual repair. XFS does not support online repair; the filesystem must be unmounted for write operations to avoid further corruption.

Exam trap

The trap here is that candidates may think `xfs_repair` can be run safely on a mounted filesystem (like `fsck` on ext4 with `-f`), or that `xfs_check` is still a valid repair tool, when in fact XFS requires unmounted repair and the dry-run step is a critical safety measure.

How to eliminate wrong answers

Option A is wrong because `xfs_check` is a deprecated tool that only performs read-only consistency checks and cannot repair corruption; moreover, running it on a mounted filesystem can cause false positives or data corruption due to ongoing writes. Option B is wrong because while `xfs_repair` must be run on an unmounted filesystem, skipping the `-n` dry-run step is risky as it may apply repairs without first verifying the extent of corruption, potentially causing irreversible data loss. Option D is wrong because `fsck -t xfs` is not a valid command for XFS; XFS uses its own `xfs_repair` tool, and running any repair tool on a mounted filesystem is unsafe and can lead to catastrophic filesystem damage.

35
MCQeasy

A Linux administrator notices that a newly added disk /dev/sdc is not recognized by the system. Which command should be used to rescan the SCSI bus without rebooting?

A.echo 'scan' > /proc/scsi/scsi
B.blockdev --rereadpt /dev/sdc
C.service scsi restart
D.echo '- - -' > /sys/class/scsi_host/host0/scan
AnswerD

Writing '- - -' performs a full SCSI bus rescan without reboot.

Why this answer

Option B is correct because writing '- - -' to the scan file triggers a bus rescan. Option A writes 'scan' to /proc/scsi/scsi, which is obsolete. Option C reads the partition table.

Option D attempts to restart a non-existent SCSI service.

36
MCQeasy

The administrator wants to create a RAID 1 array using /dev/sdb1 and /dev/sdc1, then create a filesystem and mount it at /mnt/raid1. Which command sequence should be used first?

A.mkfs.ext4 /dev/md0
B.mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
C.pvcreate /dev/sdb1 /dev/sdc1
D.fdisk /dev/sdb && fdisk /dev/sdc
AnswerB

Creates RAID 1 array from two partitions.

Why this answer

Option B is correct because the first step in creating a RAID 1 array is to assemble the underlying block devices into a RAID device using mdadm. The command `mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1` initializes the RAID metadata and creates the array at /dev/md0. Only after the array is created can a filesystem be built on it and then mounted.

Exam trap

The trap here is that candidates often confuse the order of operations, thinking they can format the array before it exists, or they mistakenly apply LVM or partitioning commands when the devices are already prepared as partitions.

How to eliminate wrong answers

Option A is wrong because mkfs.ext4 attempts to create a filesystem on /dev/md0, but the RAID device does not exist yet; the array must be created first. Option C is wrong because pvcreate is used to prepare physical volumes for LVM, not for creating a RAID array; it would be appropriate only if the goal were to use LVM on top of RAID. Option D is wrong because fdisk is used for partitioning disks, but the question states that /dev/sdb1 and /dev/sdc1 are already partitions; repartitioning them is unnecessary and would destroy existing data or partition tables.

37
MCQhard

An administrator is designing a high-availability storage solution using DRBD. The requirement is to have two nodes with synchronous replication and automatic failover in case of primary node failure. Which configuration best achieves this?

A.Export the DRBD block device via NFS and use a load balancer.
B.Primary/Secondary DRBD resource with manual failover using drbdadm.
C.DRBD with Heartbeat to automatically promote the secondary on primary failure.
D.DRBD in Primary/Primary mode managed by Pacemaker cluster stack.
AnswerD

Allows both nodes active and automatic failover via Pacemaker.

Why this answer

Option D is correct because DRBD in Primary/Primary mode, managed by the Pacemaker cluster stack, provides synchronous replication and automatic failover. Pacemaker monitors node health and can promote the secondary node to primary automatically upon primary failure, meeting the high-availability requirement without manual intervention.

Exam trap

The trap here is that candidates often assume Heartbeat is sufficient for automatic failover, but Pacemaker is the modern, recommended cluster stack that supports Primary/Primary DRBD and provides proper fencing and resource management.

How to eliminate wrong answers

Option A is wrong because exporting DRBD via NFS and using a load balancer does not provide automatic failover of the DRBD resource itself; NFS adds a single point of failure and the load balancer cannot handle DRBD state transitions. Option B is wrong because manual failover using drbdadm requires human intervention, which violates the automatic failover requirement. Option C is wrong because Heartbeat alone is a legacy cluster manager that lacks the advanced resource management and fencing capabilities of Pacemaker; while it can promote the secondary, it does not support Primary/Primary mode and is not the recommended stack for modern DRBD high-availability setups.

38
Multi-Selecteasy

A system administrator needs to create a RAID 10 array using four disks: /dev/sdb, /dev/sdc, /dev/sdd, /dev/sde. Which TWO commands correctly achieve this?

Select 2 answers
A.mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
B.mdadm --create /dev/md0 --level=1 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
C.mdadm --create /dev/md0 --level=raid10 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
D.mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdb /dev/sdc --add /dev/md1
E.mdadm --create /dev/md0 --level=10 --raid-devices=2 /dev/sdb /dev/sdc
AnswersA, C

Correct: Numeric level 10 with 4 devices creates RAID 10.

Why this answer

Options A and D both correctly create a RAID 10 array with the required four devices. Option A uses the numeric level '10', while option D uses the name 'raid10'. Option B creates a RAID 1 (mirroring) array, not RAID 10.

Option C has an invalid syntax (using --add incorrectly). Option E only specifies two devices, which is insufficient for RAID 10.

39
MCQmedium

An organization runs a critical application on a Linux server that stores its data on a 500GB LVM logical volume named /dev/vg_data/lv_app. The application must remain operational with minimal disruption, so unmounting the volume is not acceptable. The administrator needs to create a full backup of the logical volume to an external 1TB USB drive attached via eSATA. The backup must capture a point-in-time consistent state of the filesystem. The logical volume is formatted with XFS. Which of the following procedures best achieves this goal while minimizing downtime?

A.Unmount the logical volume, use tar to create an archive on the USB drive, then remount the volume.
B.Use dd to clone the logical volume directly to the USB drive while the volume is mounted.
C.Create an LVM snapshot volume and then use cp -a to copy the snapshot volume's contents directly without mounting.
D.Create an LVM snapshot volume of /dev/vg_data/lv_app, mount the snapshot to a temporary directory, and use rsync to copy the data to the USB drive.
AnswerD

The snapshot is consistent, mounting it does not affect the live volume, and rsync ensures accurate copying.

Why this answer

Option C is correct because creating an LVM snapshot provides a point-in-time consistent view of the volume, mounting the snapshot avoids downtime, and rsync is a reliable tool for copying data while preserving metadata. Option A (dd) risks inconsistency because the volume is mounted. Option B requires unmounting, causing unacceptable downtime.

Option D (cp) is less reliable for preserving all attributes and does not leverage the snapshot's benefits properly.

40
MCQeasy

Which command can be used to create a swap partition on /dev/sdb1?

A.swapcreate /dev/sdb1
B.mkswap /dev/sdb1; swapon /dev/sdb1
C.swapon /dev/sdb1
D.mkfs.swap /dev/sdb1
AnswerB

Correct sequence to create and enable swap.

Why this answer

B is correct because creating a swap partition requires two steps: first, `mkswap` initializes the partition as a swap area by writing a swap signature (UUID and superblock) to /dev/sdb1; second, `swapon` activates the swap space, making it available to the kernel for paging. Without `mkswap`, the partition lacks the necessary swap metadata and cannot be used.

Exam trap

The trap here is that candidates may assume `swapon` alone can both create and activate swap, similar to how `mount` can create a filesystem with `-t` in some contexts, but swap requires explicit initialization with `mkswap` first.

How to eliminate wrong answers

Option A is wrong because `swapcreate` is not a standard Linux command; the correct command to initialize a swap partition is `mkswap`. Option C is wrong because `swapon` alone only activates an already-initialized swap partition; it does not create the swap filesystem or signature, so it would fail on a raw partition. Option D is wrong because `mkfs.swap` is not a valid command; the proper utility for setting up swap is `mkswap`, not a variant of `mkfs`.

41
Multi-Selectmedium

Which TWO statements about LVM thin provisioning are correct?

Select 2 answers
A.Thin pools are created using the 'pvcreate' command.
B.The filesystem on a thin volume must support the 'discard' option to free unused space.
C.Thin volumes can be over-provisioned, allowing more virtual space than physical storage.
D.Thin provisioning requires a dm-cache device to function.
E.Thin volumes automatically grow when they run out of space.
AnswersB, C

fstrim or mount -o discard allows space reclamation.

Why this answer

Option B is correct because thin volumes allocate data blocks on demand from a thin pool. To allow the underlying physical storage to reclaim unused blocks when files are deleted, the filesystem must support the 'discard' option (or use fstrim) so that it can notify the device mapper of freed space. Without discard, the thin pool never learns that blocks are no longer in use, preventing space reclamation.

Exam trap

The trap here is that candidates often assume thin volumes automatically grow or that discard is optional, but the exam tests the precise requirement that the filesystem must support and enable discard to free space back to the thin pool.

42
MCQmedium

A system administrator notices that a new iSCSI target is not appearing as a block device after running iscsiadm. The target is known to be online and reachable. What is the most likely cause?

A.The iSCSI initiator name is not set.
B.The target IQN is not specified correctly.
C.The iSCSI service (iscsid) is not running.
D.The network interface is down.
AnswerC

The iscsid daemon must be active to manage sessions.

Why this answer

The iSCSI initiator requires the `iscsid` daemon to be running in order to process discovery and login requests from `iscsiadm`. Even if the target is online and reachable, without the `iscsid` service, the kernel's iSCSI layer cannot establish a session or create the corresponding block device (e.g., /dev/sdX). This is the most likely cause because the administrator has confirmed network connectivity and target availability, leaving the service state as the primary suspect.

Exam trap

The trap here is that candidates often assume the issue is a configuration error (like a wrong IQN or missing initiator name) when the problem is actually a missing or stopped service, because they overlook the dependency of `iscsiadm` on the `iscsid` daemon.

How to eliminate wrong answers

Option A is wrong because the initiator name is typically set automatically during package installation (e.g., in /etc/iscsi/initiatorname.iscsi) and is not required for a single session; a missing name would cause a different error, not a silent failure to appear as a block device. Option B is wrong because if the IQN were incorrect, `iscsiadm` would return an explicit authentication or login failure, not a scenario where the target is known to be online and reachable yet no block device appears. Option D is wrong because the network interface being down would prevent the target from being reachable at all, contradicting the premise that the target is known to be online and reachable.

43
MCQmedium

An administrator needs to extend an ext4 filesystem on logical volume 'home' by 5 GB. The volume group 'vg' has free extents. Which sequence of commands is correct?

A.lvextend -l +100%FREE /dev/vg/home; resize2fs /dev/vg/home
B.resize2fs /dev/vg/home; lvextend -L +5G /dev/vg/home
C.lvextend -L +5G /dev/vg/home; mount -o remount /dev/vg/home
D.lvresize -L +5G /dev/vg/home; e2fsck -f /dev/vg/home; resize2fs /dev/vg/home
AnswerA

Extends the LV with all free extents, then resizes the ext4 filesystem.

Why this answer

Option A is correct because it first extends the logical volume to use all free extents in the volume group with `lvextend -l +100%FREE`, then resizes the ext4 filesystem with `resize2fs` to utilize the newly allocated space. This sequence ensures the logical volume has sufficient capacity before the filesystem is expanded, which is required because `resize2fs` cannot extend beyond the current block device size.

Exam trap

The trap here is that candidates often confuse the order of operations, thinking the filesystem can be resized before the logical volume is extended, or they mistakenly believe `mount -o remount` will trigger a filesystem resize.

How to eliminate wrong answers

Option B is wrong because it attempts to resize the filesystem before extending the logical volume; `resize2fs` will fail or do nothing if the underlying block device has no additional space. Option C is wrong because `mount -o remount` does not resize the filesystem; it only remounts the filesystem with new options, and the filesystem must be explicitly resized after the logical volume is extended. Option D is wrong because it includes `e2fsck -f` unnecessarily before `resize2fs`; while a filesystem check is not harmful, it is not required for extending an ext4 filesystem, and the correct sequence is to extend the logical volume first, then resize the filesystem.

44
MCQeasy

Which of the following is the primary configuration file for the udev device manager?

A./etc/udev/rules.d/
B./lib/udev/rules.d/
C./etc/udev/rules.d/
D./etc/udev/udev.conf
AnswerD

This is the primary udev configuration file.

Why this answer

The primary configuration file for the udev device manager is /etc/udev/udev.conf. This file sets global parameters such as the device timeout, logging priority, and the default permissions for device nodes. While custom rules are placed in /etc/udev/rules.d/, the main configuration file that controls udev's behavior is udev.conf.

Exam trap

The trap here is that candidates often confuse the directory for custom rules (/etc/udev/rules.d/) with the actual configuration file, or they think the system rules directory (/lib/udev/rules.d/) is the primary config, but the question specifically asks for the 'primary configuration file' which is udev.conf.

How to eliminate wrong answers

Option A is wrong because /etc/udev/rules.d/ is a directory containing custom user-defined udev rules, not the primary configuration file. Option B is wrong because /lib/udev/rules.d/ is a directory for system-provided default rules, not the configuration file. Option C is wrong because /etc/udev/rules.d/ is a directory, not a file; the primary configuration file is /etc/udev/udev.conf.

45
Multi-Selecteasy

Which TWO commands display UUIDs of block devices? (Select TWO)

Select 2 answers
A.parted /dev/sda print
B.lsblk -o UUID
C.udevadm info --query=all --name=/dev/sda
D.blkid
E.fdisk -l
AnswersB, D

Shows UUID column.

Why this answer

B is correct because `lsblk -o UUID` explicitly lists the UUID column for all block devices, showing the filesystem UUIDs. D is correct because `blkid` is the dedicated command to display block device attributes, including UUIDs, by reading the udev database or directly probing the device.

Exam trap

The trap here is that candidates often confuse partition UUIDs (shown by `fdisk -l` for GPT disks) with filesystem UUIDs, or assume `parted` or `udevadm` are standard tools for listing filesystem UUIDs, when in fact only `blkid` and `lsblk` are the correct commands for that specific task.

46
MCQmedium

A filesystem created with mkfs.ext4 on /dev/sda1 has a reserved block count of 5%. How can the administrator reduce it to 1% without reformatting?

A.tune2fs -r 1 /dev/sda1
B.tune2fs -m 1 /dev/sda1
C.dumpe2fs -r 1 /dev/sda1
D.resize2fs -r 1 /dev/sda1
AnswerB

-m sets reserved blocks percentage.

Why this answer

The `-m` option of tune2fs sets the reserved block percentage for the filesystem. Since the question asks to reduce the reserved block count from 5% to 1% without reformatting, `tune2fs -m 1 /dev/sda1` correctly adjusts the reserved blocks percentage to 1% on the existing ext4 filesystem.

Exam trap

The trap here is confusing the `-m` (percentage) and `-r` (absolute block count) options of tune2fs, leading candidates to choose `-r 1` thinking it sets 1% when it actually sets only 1 block reserved.

How to eliminate wrong answers

Option A is wrong because `-r` sets the reserved block count to a specific number of blocks, not a percentage; `-r 1` would reserve only 1 block, not 1%. Option C is wrong because `dumpe2fs` is a read-only tool that displays filesystem information, it cannot modify reserved block counts. Option D is wrong because `resize2fs` is used to resize filesystems, not to change reserved block percentages.

47
MCQhard

A database server experiences performance degradation. Analysis shows high I/O wait on a LVM logical volume that uses striping across two physical volumes. What is the most effective way to improve performance?

A.Add a cache layer using lvmcache on a fast SSD
B.Increase the stripe size and recreate the LV
C.Add an additional PV to the VG and extend the LV
D.Convert the LV to use linear mapping instead of striping
AnswerA

Caching with SSDs accelerates reads and writes, reducing I/O wait.

Why this answer

Adding a cache layer using lvmcache on a fast SSD is the most effective way to reduce high I/O wait because it places frequently accessed (hot) data on the faster SSD while keeping the bulk of data on the slower striped HDDs. This directly addresses the I/O bottleneck without requiring data migration or downtime, and it leverages the existing striped layout for sequential throughput while improving latency for random reads/writes.

Exam trap

The trap here is that candidates assume striping alone maximizes performance, but they overlook that high I/O wait is often due to random access latency, which a cache layer directly mitigates without requiring a disruptive reconfiguration.

How to eliminate wrong answers

Option B is wrong because increasing the stripe size and recreating the LV would require taking the volume offline and migrating all data, which is disruptive and may not reduce I/O wait if the bottleneck is random access latency rather than sequential throughput. Option C is wrong because adding an additional PV to the VG and extending the LV would increase total capacity but does not inherently improve I/O wait; it could even increase contention if the new PV is equally slow. Option D is wrong because converting the LV to linear mapping would eliminate the parallelism of striping, likely worsening performance for workloads that benefit from concurrent I/O across multiple disks.

Ready to test yourself?

Try a timed practice session using only Block Devices, Filesystems and Advanced Storage questions.