LPIC 2 201-450 Practice Questions with Explanations

Free LPIC 2 201-450 practice questions. 21 of them, each with the correct answer, a full explanation, and the reason every other option is wrong. These are real questions from the 201-450 exam, not paraphrases, and every explanation is written out rather than just marking the right letter.

They are drawn from the same bank as the full 201-450 pack, which has 120 questions in total.

Get the full 201-450 question bank (120 questions) →

201-450 practice questions

Question 1

Which of the following commands erases the contents of the /dev/sdb3 partition?

  • A. rm /dev/sdb3
  • B. dd if=/dev/zero of=/dev/sdb3
  • C. dd of=/dev/zero if=/dev/sdb3
  • D. umount /dev/sdb3
Show answer and explanation ▾

Correct answer: B

The command 'dd if=/dev/zero of=/dev/sdb3' writes zeros from /dev/zero to the partition /dev/sdb3, effectively erasing its contents. The 'if' (input file) and 'of' (output file) parameters are in the correct order to overwrite the partition with zeros.

Why the other options are wrong:

  • A. rm cannot directly erase block device partitions; it only removes file references.
  • C. This reverses the input and output parameters, attempting to read from /dev/zero and write to itself, which is incorrect.
  • D. umount only unmounts a filesystem but does not erase its contents.

Question 2

Which of the following commands restores only those files containing lpi in their name from the archive lpifiles.tar.gz?

  • A. tar xvzf lpifiles.tar.gz --wildcards "˜*lpi*'
  • B. tar xvzwf lpifiles.tar.gz "˜*lpi*'
  • C. tar -xvfz lpifiles.tar.gz --deep "˜*lpi*'
  • D. tar -xvzf lpifiles.tar.gz --subdirs "˜*lpi*'
  • E. tar xvzf lpifiles.tar.gz --globbing "˜*lpi*'
Show answer and explanation ▾

Correct answer: A

The command 'tar xvzf lpifiles.tar.gz --wildcards "*lpi*"' correctly extracts files from a gzipped tar archive while filtering for files matching the wildcard pattern '*lpi*'. The -- wildcards option enables pattern matching during extraction, and the flags x (extract), v (verbose), z (gzip), and f (file) are properly ordered.

Why the other options are wrong:

  • B. The -w flag does not exist in standard tar; this option is invalid.
  • C. The --deep option does not exist in tar for filtering extractions.
  • D. The --subdirs option is not a valid tar option for pattern-based extraction.
  • E. The --globbing option does not exist; --wildcards is the correct option for pattern matching.

Question 3

The following command has just been run successfully: Cd /opt; tar xvf /dev/nst0; What will happen if the command sequence is run again?

  • A. An error saying that there is no tape present is generated because the tape has been ejected after being used
  • B. The contents of /opt will be restored again
  • C. The entire contents of /opt will be replaced with the contents of the next file on the tape
  • D. The contents of /opt will have additional content added from the next file on the tape
Show answer and explanation ▾

Correct answer: D

Tape devices like /dev/nst0 are sequential access devices that maintain a file pointer position. After extracting the first tar archive, the tape pointer advances to the next file. Running the command again reads the next file on the tape and extracts its contents into /opt, adding to what already exists rather than replacing it.

Why the other options are wrong:

  • A. Tapes do not automatically eject after use; the non-rewinding device /dev/nst0 keeps the tape in position.
  • B. The contents will not simply be restored again; the tape pointer has advanced to the next file.
  • C. The contents are added to /opt, not replaced entirely, because both tar files extract sequentially into the same directory.

Question 4

Which single command simulates a failed device within a RAID 5 array?

  • A. mdadm --remove /dev/md0 /dev/sdd1
  • B. mdadm --zero-superblock /dev/sdf3
  • C. mdadm --force-fault /dev/md2 /dev/sde2
  • D. mdadm --fail /dev/md0 /dev/sdc1
  • E. mdadm /dev/md0 --offline /dev/sdc1
Show answer and explanation ▾

Correct answer: D

The command 'mdadm --fail /dev/md0 /dev/sdc1' marks the device /dev/sdc1 in the RAID array /dev/md0 as failed, simulating a device failure. This is the correct mdadm syntax for marking a disk as faulty within an array.

Why the other options are wrong:

  • A. The --remove option removes a device from an array; it does not simulate a failure state.
  • B. The --zero-superblock option erases the RAID superblock; it does not mark a device as failed.
  • C. The --force-fault option does not exist in mdadm.
  • E. The --offline option marks a device as offline but is not the standard method for simulating a failure; --fail is the correct option.

Question 5

What is the minimum number of disks required in a fully redundant RAID5 array?

  • A. 1
  • B. 2
  • C. 3
  • D. 4
  • E. 5
Show answer and explanation ▾

Correct answer: C

RAID 5 requires a minimum of 3 disks to function. It stripes data across disks and uses distributed parity to provide redundancy. With 3 disks, one disk worth of capacity is used for parity information, allowing recovery from a single disk failure.

Why the other options are wrong:

  • A. One disk provides no redundancy and is not a valid RAID configuration.
  • B. Two disks cannot provide the striping and parity protection that RAID 5 requires.
  • D. While 4 disks is a valid RAID 5 configuration, the minimum requirement is 3 disks.
  • E. Five disks is a valid configuration but exceeds the minimum requirement.

Question 6

A system has one hard disk and one CD writer which are both connected to SATA controllers. Which device represents the CD writer?

  • A. /dev/hdb
  • B. /dev/sdd
  • C. /dev/scd1
  • D. /dev/sr0
  • E. /dev/sr1
Show answer and explanation ▾

Correct answer: D

A SATA-connected CD writer is represented by /dev/sr0, where 'sr' stands for SCSI CD- ROM. SATA devices use the SCSI subsystem for CD/DVD drives. The first such device is numbered 0, making /dev/sr0 the correct device file.

Why the other options are wrong:

  • A. /dev/hdb represents an IDE hard drive, not a SATA device or CD writer.
  • B. /dev/sdd would represent a SATA hard disk drive, not a CD writer.
  • C. /dev/scd1 is an alternate naming scheme for SCSI CD devices, but it would represent the second device; the first is typically /dev/sr0.
  • E. /dev/sr1 would represent the second SCSI CD-ROM device, not the first CD writer on the system.

Question 7

What action should be performed after increasing the size of a logical volume?

  • A. Run vgresize
  • B. Increase the size of the filesystem used for the logical volume
  • C. Run 1vresize
  • D. Remount the logical volume
Show answer and explanation ▾

Correct answer: B

After increasing the size of a logical volume with lvextend or lvresize, the filesystem contained within that volume must be expanded to use the newly available space. Commands like resize2fs (for ext filesystems) or xfs_growfs (for XFS) are required to grow the filesystem to match the logical volume size. Without this step, the additional space remains unused by the filesystem.

Why the other options are wrong:

  • A. vgresize is not a valid LVM command; volume group resizing is not the appropriate action after expanding a logical volume.
  • C. lvresize is used to change the logical volume size itself, not the action performed after resizing.
  • D. Remounting alone does not expand the filesystem to use the new logical volume space; filesystem expansion commands are required.

Question 8

Which command is used to make an exact copy, at a single point in time, of a logical volume while still allowing the original logical volume to be updated?

  • A. lvcclone
  • B. lvcreate
  • C. lvm2
  • D. lvsnap
  • E. lvsnapshot
Show answer and explanation ▾

Correct answer: B

The lvcreate command is used to create logical volume snapshots when invoked with the -s or --snapshot option. This creates a point-in-time copy of a logical volume while allowing the original to continue being updated. Snapshots use copy-on-write technology to track changes efficiently.

Why the other options are wrong:

  • A. lvcclone is not a valid LVM command.
  • C. lvm2 is the package/suite name, not a command for creating snapshots.
  • D. lvsnap is not a valid LVM command.
  • E. lvsnapshot is not a valid LVM command; the correct command is lvcreate with snapshot options.

Question 9

Which of the following commands creates a Btrfs subvolume named volume in/mnt?

  • A. btrfs subvolume add ""n volume /mnt
  • B. btrfs create subvolume /mnt volume
  • C. btrfs-subvolume create /mnt/volume
  • D. btrfs subvolume new volume /mnt
  • E. btrfs subvolume create /mnt/volume
Show answer and explanation ▾

Correct answer: E

The correct syntax for creating a Btrfs subvolume is 'btrfs subvolume create /mnt/volume', where the subvolume path is specified as a single argument combining the mount point and subvolume name. This is the standard Btrfs command syntax.

Why the other options are wrong:

  • A. The syntax is incorrect and includes malformed quoting; btrfs subvolume add is not the correct command.
  • B. The argument order is wrong; subvolume creation does not use 'create subvolume' with reversed arguments.
  • C. btrfs-subvolume is not a valid command; the correct command is btrfs with subvolume as a subcommand.
  • D. The 'new' subcommand does not exist in btrfs; the correct subcommand is 'create'.

Question 10

Due to extreme system use, a Linux system requires some additional swap space. To initialize 5 GB of additional swap space, which combination of commands should be used?

  • A. dd if=/dev/zero of=/tmp/swapfile bs=1024 count=5120000; mkswap /tmp/swapfile; mount /tmp/swapfile
  • B. dd if=/dev/zero of=/tmp/swapfile bs=1024 count=5120000; swapon /tmp/swapfile
  • C. dd if=/dev/zero of=/tmp/swapfile bs=1024 count=5120000; mkswap /tmp/swapfile; swapon /tmp/swapfile
  • D. touch -5G /tmp/swapfile; swapon /tmp/swapfile
  • E. mkswap /tmp/swapfile 512000; swapon /tmp/swapfile
Show answer and explanation ▾

Correct answer: C

Creating swap space requires three steps: (1) creating a file with dd using bs=1024 and count=5120000 to create a 5GB file (1024 × 5120000 = 5,242,880,000 bytes), (2) formatting it as swap with mkswap, and (3) activating it with swapon. The mount command is incorrect because swap is not mounted like regular filesystems.

Why the other options are wrong:

  • A. Using mount instead of swapon is incorrect; swap spaces must be activated with swapon, not mounted.
  • B. This skips the mkswap step, which is necessary to initialize the swap format before the space can be used.
  • D. The touch command cannot create files of specified sizes in the manner shown; dd is the correct tool for this task.
  • E. mkswap syntax shown is incorrect and does not properly create a 5GB swap file; it requires a file to be created first with dd.

Question 11

What is the purpose of a system mount unit?

  • A. It is used by the command systemd-mount and allows users to mount partitions to mount points of their choice
  • B. It is used only to mount network file systems to local mount points. It cannot be used for local media
  • C. It is created by the command systemd-fstab-generator to integrate entries from /etc/fstab into the system boot process
  • D. It is used by the command mount when using system to mount and unmount file systems
Show answer and explanation ▾

Correct answer: C

It is created by the command systemd-fstab- generator to integrate entries from /etc/fstab into the system boot process A system mount unit is a systemd unit file (.mount) that is generated by systemd-fstab- generator to convert traditional /etc/fstab entries into systemd mount units. This integration allows fstab entries to be managed within the systemd boot and service management framework, enabling dependency tracking and parallel mounting.

Why the other options are wrong:

  • A. While systemd-mount can use mount units, the primary purpose of mount units is to integrate fstab entries into systemd, not to provide user-choice mounting mechanisms.
  • B. Mount units are not restricted to network filesystems; they handle both local and remote filesystems equally.
  • D. The mount command does not use system or systemd mount units; mount units are part of systemd's native management system.

Question 12

What component of a system does smartd monitor?

  • A. CPU
  • B. RAM
  • C. Hard drives
  • D. Ethernet traffic
Show answer and explanation ▾

Correct answer: C

smartd is the SMART (Self-Monitoring, Analysis and Reporting Technology) daemon that monitors the health and status of hard drives and SSDs. It checks SMART attributes from storage devices to predict and detect potential failures before they occur.

Why the other options are wrong:

  • A. smartd does not monitor CPU; CPU monitoring uses different tools like lm_sensors or performance monitoring daemons.
  • B. smartd does not monitor RAM; memory monitoring requires separate tools and mechanisms.
  • D. smartd does not monitor network traffic; network monitoring uses tools like netstat, iftop, or packet sniffers.

Question 13

How can the label root be added to the ext4 filesystem on /dev/sda1?

  • A. relabel /dev/sda1 root
  • B. tune2fs ""L root /dev/sda1
  • C. echo "˜root' > /proc/fs/sda1/label
  • D. labelfs --device /dev/sda1 root
Show answer and explanation ▾

Correct answer: B

The tune2fs command with the -L option is used to set or change the label of an ext2/ext3/ext4 filesystem. The syntax is 'tune2fs -L label /dev/device', making this the standard tool for managing ext filesystem labels.

Why the other options are wrong:

  • A. relabel is not a valid Linux command for filesystem labeling.
  • C. The /proc filesystem does not provide an interface for setting filesystem labels in this manner.
  • D. labelfs is not a standard Linux command; tune2fs is the correct utility for ext filesystems.

Question 14

Which sub command to crypsetup shows information about an encrypted LUKS partition?

  • A. luksDump
  • B. luksInfo
  • C. luksDebug
  • D. luksLS
  • E. luksShow
Show answer and explanation ▾

Correct answer: A

The luksDump subcommand to cryptsetup displays detailed information about a LUKS encrypted partition, including header information, key slots, and other encryption metadata. This is the standard way to inspect LUKS partition configuration.

Why the other options are wrong:

  • B. luksInfo is not a valid cryptsetup subcommand.
  • C. luksDebug is not a valid cryptsetup subcommand.
  • D. luksLS is not a valid cryptsetup subcommand.
  • E. luksShow is not a valid cryptsetup subcommand; the correct command is luksDump.

Question 15

Which of the following is a CD-ROM filesystem standard?

  • A. OSI 9660
  • B. ISO 9660
  • C. SR0FS
  • D. ISO 8859
  • E. ROM-EO
Show answer and explanation ▾

Correct answer: B

ISO 9660 is the international standard filesystem format for CD-ROMs, defining how files and directories are organized on optical media. It was developed by the International Organization for Standardization and is universally recognized as the CD-ROM filesystem standard.

Why the other options are wrong:

  • A. OSI 9660 does not exist; the correct designation is ISO 9660.
  • C. SROFS is not a recognized CD-ROM filesystem standard.
  • D. ISO 8859 is a character encoding standard, not a filesystem standard.
  • E. ROM-EO is not a recognized filesystem standard for CD-ROMs.

Question 16

Which of the following init systems comes along with an own UEFI boot loader?

  • A. systemd
  • B. SysVinit
  • C. Upstart
  • D. OpenRC
  • E. launchd
Show answer and explanation ▾

Correct answer: A

systemd is the modern init system that includes systemd-boot (also called bootctl), a UEFI boot manager and bootloader integrated directly into the systemd project. This provides native UEFI boot functionality alongside the init system.

Why the other options are wrong:

  • B. SysVinit is a traditional init system that does not include its own bootloader.
  • C. Upstart is an event-driven init system that does not provide a UEFI bootloader.
  • D. OpenRC is a dependency-based init system that does not include a UEFI bootloader.
  • E. launchd is macOS's init system and is not relevant to Linux UEFI booting.

Question 17

What effect does the ""f option to the update-rc.d command have on files in the /etc/rcX.d/ and /etc/init.d/ directories?

  • A. It will force the removal of the symlinks in /etc/rcX.d/ even when the links are read only
  • B. It will remove both the symlinks in /etc/rcX.d/ and the init script in /etc/init.d/
  • C. It will remove the init script in /etc/init.d/ and the symlinks in /etc/rcX.d/ and update the package information of installed files
  • D. It will force the removal of symlinks in /etc/rcX.d/ even if the corresponding init script still exists in /etc/init.d/
Show answer and explanation ▾

Correct answer: D

The -f flag in update-rc.d forces the removal of symlinks in /etc/rcX.d/ directories even if the corresponding init script still exists in /etc/init.d/. This allows cleanup of runlevel links without requiring the actual script to be removed first.

Why the other options are wrong:

  • A. The -f option does not specifically address read-only link permissions.
  • B. The -f option removes only the symlinks, not the init script itself.
  • C. The -f option does not remove the init script from /etc/init.d/ nor does it update package information.

Question 18

Which command is used to install a GRUB boot loader into the master boot record?

  • A. grub-install
  • B. grub-mkconfig
  • C. grub-install-mbr
  • D. grub-glue-mbr
  • E. grub-mbr-setup
Show answer and explanation ▾

Correct answer: A

grub-install is the standard command used to install GRUB bootloader code into the master boot record (MBR) or EFI partition. It handles the installation of GRUB to the system's boot sector.

Why the other options are wrong:

  • B. grub-mkconfig generates configuration files but does not install the bootloader.
  • C. grub-install-mbr is not a recognized GRUB command.
  • D. grub-glue-mbr is not a standard GRUB utility.
  • E. grub-mbr-setup is not a recognized GRUB command.

Question 19

If the file containing the Linux kernel is deleted, what happens when the system boots?

  • A. The system starts normally since the bootloader copies the kernel to the master boot record of the hard disk
  • B. Instead of the kernel, the initramfs is loaded and instructed to mount the root filesystem and reinstall the kernel from the original package or from source
  • C. The bootloader mounts the root filesystem read-only and launches /bin/sh directly in order to allow the administrator to reinstall the kernel
  • D. Without a kernel system cannot boot and, depending on the bootloader, an error is displayed
Show answer and explanation ▾

Correct answer: D

If the kernel file is deleted, the system cannot boot at all. The bootloader can load the kernel into memory and transfer control to it, but if the kernel file does not exist, the bootloader will fail and display an error. No automatic recovery mechanisms exist to reinstall a missing kernel.

Why the other options are wrong:

  • A. The bootloader does not copy the kernel to the MBR; it loads the kernel from the filesystem.
  • B. The initramfs cannot function without a kernel to run; it is loaded by the kernel, not independently.
  • C. The bootloader cannot mount the root filesystem or launch a shell without a kernel being executed.

Question 20

What is the purpose of an initramfs during the Linux system start?

  • A. It loads required modules and starts sub sytems like LVM to make the root file system accessible to the kernel
  • B. It moves the kernel from normal system memory to initram memory to speed up kernel access
  • C. It copies the root file system's content to RAM to speed up the system and reduce writes to disk
  • D. It creates a ram disk to store volatile data for directories like /tmp to reduce writes to disk
Show answer and explanation ▾

Correct answer: A

The initramfs is a minimal root filesystem loaded into RAM that contains essential drivers and utilities. Its primary purpose is to load required kernel modules, initialize hardware, and enable access to the actual root filesystem, especially when LVM, encryption, or RAID are involved.

Why the other options are wrong:

  • B. The kernel is not moved between memory types; this does not reflect how initramfs functions.
  • C. The initramfs does not copy the root filesystem to RAM; it enables access to the real root filesystem on disk.
  • D. The initramfs is not designed to store volatile data; that role belongs to the actual mounted /tmp filesystem.

Question 21

Which of the following is a userspace application used to modify EFI entries on a Linux system?

  • A. efieditor
  • B. configefi
  • C. efimanager
  • D. efiboottmgr
  • E. efibootedit
Show answer and explanation ▾

Correct answer: D

efibootmgr is the standard userspace utility for viewing and modifying EFI boot entries on Linux systems. It allows administrators to manage UEFI firmware boot options without rebooting into firmware settings.

Why the other options are wrong:

  • A. efieditor is not a recognized standard Linux utility for EFI management.
  • B. configefi is not a recognized standard Linux utility for EFI management.
  • C. efimanager is not a recognized standard Linux utility for EFI management.
  • E. efibootedit is not a recognized standard Linux utility for EFI management.

Get the complete 201-450 bank

These 21 questions are roughly 29% of the bank. The full pack has 120 real 201-450 questions, each with the same depth of explanation, plus a questions-only PDF for timed practice and free updates forever.

View the full LPIC 2 201-450 question bank →

Related exams

Browse free practice questions for every exam →

Back to blog