30 free LPI LPIC-2 201-450 practice questions from the CertStash pack of 120, each with the correct answer and a full explanation. The rule is the same for every exam: ten free on the product page, 30 free here, all 120 in the pack, and each step includes the one before it.
Get all 120 questions (US$39) · Download the first 10 as a PDF
Question 1
Which of the following commands erases the contents of the /dev/sdb3 partition?
Show answer and explanation
Correct answer: B. dd if=/dev/zero of=/dev/sdb3
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 files will be looked for and used by GNU make, if one of them exists, unless a different file is specified on the command line when trying to compile software from source code? (Choose two.)
Show answer and explanation
Correct answer: C, D. makefile; Makefile
GNU make automatically looks for either 'makefile' or 'Makefile' (case-sensitive on Unix systems, typically preferring Makefile) in the current directory when no file is specified with the -f option. These are the default build instruction files that make will use if they exist.
Why the other options are wrong
- A. configure is a shell script used for configuration, not a make file itself.
- B. config.h.in is a template file used by configure to generate config.h, not a make build file.
- E. Makefile.in is a template that is processed by configure to generate Makefile, not directly used by make.
Question 3
Which of the following commands restores only those files containing lpi in their name from the archive lpifiles.tar.gz?
Show answer and explanation
Correct answer: A. tar xvzf lpifiles.tar.gz --wildcards "˜*lpi*'
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 4
A regular user has just run - ./configure && make && make install to build and install a program. However, the installation fails. What could be done to install the program? (Choose two.)
Show answer and explanation
Correct answer: B, D. Run make install with root privileges; Rerun ./configure with a --prefix option where the user has permissions to write
Running 'make install' with root privileges (sudo) bypasses permission restrictions and installs to default system directories. Alternatively, using './configure --prefix=/path/with/user/permissions' allows the regular user to install the program in a directory where they have write access without requiring root privileges.
Why the other options are wrong
- A. suinstall is not a standard Linux command for installing binaries.
- C. Skipping ./configure would not fix permission issues and would likely cause the build to fail or use incorrect defaults.
- E. make install_local is not a standard make target; this option does not exist.
Question 5
The following command has just been run successfully: Cd /opt; tar xvf /dev/nst0; What will happen if the command sequence is run again?
Show answer and explanation
Correct answer: D. The contents of /opt will have additional content added from the next file on the tape
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 6
Which single command simulates a failed device within a RAID 5 array?
Show answer and explanation
Correct answer: D. mdadm --fail /dev/md0 /dev/sdc1
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 7
What is the minimum number of disks required in a fully redundant RAID5 array?
Show answer and explanation
Correct answer: C. 3
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 8
A system has one hard disk and one CD writer which are both connected to SATA controllers. Which device represents the CD writer?
Show answer and explanation
Correct answer: D. /dev/sr0
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 9
What action should be performed after increasing the size of a logical volume?
Show answer and explanation
Correct answer: B. Increase the size of the filesystem used for the logical volume
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 10
What information is found in the following excerpt from the file /proc/mdstat? (Choose two.)
Show answer and explanation
Correct answer: A, C. One of the disks in /dev/md0 has failed and a spare disk is used to recreate full redundancy; The information [UU_] means, that the raid is missing one disk and is not fully redundant
Option A is correct because [3/2] [UU_] shows a RAID5 array that should have 3 devices but has only 2 in use, and the line recovery = 15.9% shows the missing member is being rebuilt. When a member is lost, the md driver recreates its data on a spare drive. Option C is correct because [UU_] means two devices are up (U) and one is down (_), so the RAID5 is degraded and not fully redundant until the recovery finishes.
Why the other options are wrong
- B. /dev/sda1 is still marked (S) in the output, so it remains a spare and is not the disk being recovered. Full redundancy is restored by the current recovery, so no further disk is needed afterwards.
- D. Nothing in the output links super 1.2 to boot loader support, and LILO can only boot from version 0.90 superblock arrays.
- E. [3/2] means the array should have 3 devices and 2 are currently in use. It does not mean 2 disks are spare. The spares are the devices marked (S): sdb1 and sda1.
What people say about the full LPIC-2 pack 5.0 from 3
Passed my exam! Not an easy cert. If you only use official resources you are going to struggle. This dump gives you the actual exam questions.
Question 11
Which of the following commands shows capabilities and usable frequencies for the wireless interface wlan0?
Show answer and explanation
Correct answer: B. iw dev wlan0 info
The command 'iw dev wlan0 info' displays capabilities and information about the wireless interface wlan0, including supported frequencies and modes. The 'dev' keyword specifies a network device, and 'info' retrieves detailed information about it.
Why the other options are wrong
- A. 'iw phy phy0 info' would target the physical radio device (phy0), not the specific wireless interface wlan0.
- C. The 'show' subcommand is not the standard way to retrieve capabilities; 'info' is the correct subcommand.
- D. 'iw phy wlan0 show' incorrectly uses 'phy' with an interface name; 'phy' requires a physical device name like phy0.
- E. 'iw phy0 show' targets the physical radio device and uses 'show' instead of the correct 'info' subcommand.
Question 12
Which of the following is a CD-ROM filesystem standard?
Show answer and explanation
Correct answer: B. ISO 9660
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 13
Which of the following init systems comes along with an own UEFI boot loader?
Show answer and explanation
Correct answer: A. systemd
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 14
Which commands below are useful to collect data about remote filesystem connections? (Choose two.)
Show answer and explanation
Correct answer: B, D. nfsiostat; cifsiostat
The `nfsiostat` command provides I/O statistics for NFS (Network File System) mounts, and `cifsiostat` provides I/O statistics for CIFS/SMB (Common Internet File System) mounts. These tools are specifically designed to collect data about remote filesystem connections and their performance. `pidstat` monitors individual process statistics, `sadf` converts sar data formats, and `fsiostat` is not a standard command.
Why the other options are wrong
- A. pidstat reports per-process statistics, not remote filesystem connection data.
- C. sadf converts existing sar data but does not specifically collect remote filesystem statistics.
- E. fsiostat is not a standard Linux command for remote filesystem monitoring.
Question 15
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?
Show answer and explanation
Correct answer: B. lvcreate
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 16
In which directory tree are files modified when changing kernel parameters using the command sysctl?
Show answer and explanation
Correct answer: C. /proc/sys/
The sysctl command modifies kernel parameters by reading and writing to files in the /proc/sys/ directory tree. This is the standard location where the proc filesystem exposes kernel tunable parameters that can be modified at runtime without recompiling the kernel.
Why the other options are wrong
- A. /sys/kernel/ is part of the sysfs filesystem which exposes kernel objects, not the location modified by sysctl.
- B. /proc/kernel/ does not exist; kernel parameters are under /proc/sys/.
- D. /lib/sys/ is not a standard Linux directory for kernel parameters.
- E. /sys/proc/ is not a valid directory structure for kernel parameters.
Question 17
Which command reports information on memory usage, paging and block input/output?
Show answer and explanation
Correct answer: E. vmstat
The `vmstat` command reports detailed information on memory usage, paging activity (page ins and page outs), and block input/output statistics. It provides a comprehensive view of virtual memory system performance including CPU activity, memory allocation, disk I/O, and system statistics. The `free` command shows only RAM and swap usage, `memshow` is not standard, `lsof` lists open files, and `pidof` finds process IDs.
Why the other options are wrong
- A. free only reports memory and swap usage summary, not paging or I/O statistics.
- B. memshow is not a standard Linux command.
- C. lsof lists open files and network connections, not memory or I/O statistics.
- D. pidof only identifies process IDs matching a name, not system performance data.
Question 18
A Linux server running systemd booted to rescue.target for maintenance. Which commands are used to restore the server to its usual target? (Choose two.)
Show answer and explanation
Correct answer: B, E. systemctl default; systemctl reboot
systemctl default restores the system to its default target (typically multi-user.target or graphical.target), which is the standard way to exit rescue.target. systemctl reboot cleanly reboots the system, bringing it back to its normal operating state. Both commands accomplish the goal of returning the system to normal operation after rescue mode maintenance.
Why the other options are wrong
- A. telinit 0 is a legacy SysVinit command that would shut down the system, not restore normal operation.
- C. sync flushes disk buffers but does not change the system target or restore normal operation.
- D. systemctl emergency would move to an even more minimal state, not restore normal operation.
Question 19
If the file containing the Linux kernel is deleted, what happens when the system boots?
Show answer and explanation
Correct answer: D. Without a kernel system cannot boot and, depending on the bootloader, an error is displayed
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
Which of the following commands adds a static IPv6 address to the network interface eth0?
Show answer and explanation
Correct answer: C. ip addr add 2001:db8::1337/64 dev eth0
The correct command to add a static IPv6 address is 'ip addr add 2001:db8::1337/64 dev eth0'. The ip command automatically handles both IPv4 and IPv6 addresses without requiring explicit IPv6 flags. The standard syntax is 'ip addr add <address> dev <interface>'.
Why the other options are wrong
- A. 'ip add' is abbreviated incorrectly; the full command should be 'ip addr'.
- B. The '-6' flag is not a standard option for the ip addr add command; IPv6 is handled automatically by the ip command.
- D. The 'new' keyword is not part of the standard ip addr add syntax.
- E. The '-6' flag does not come before the address; this is incorrect syntax for the ip command.
Question 21
In order to gather performance data with sar over a longer period of time, which command should be run periodically from cron?
Show answer and explanation
Correct answer: A. sa1
The `sa1` command is the data collection script for `sar` that should be run periodically from cron to gather performance data over time. It collects system activity information and stores it in binary format for later analysis with `sar`. The other options are either non-existent or serve different purposes: `sarmon` and `sarcron` are not standard tools, `sadf` converts sar data to different formats, and `sarec` is not a recognized command.
Why the other options are wrong
- B. sarmon is not a standard system activity reporting command.
- C. sarec is not a recognized sar-related command.
- D. sadf converts existing sar data to different formats but does not collect data periodically.
- E. sarcron is not a standard Linux command for sar data collection.
Question 22
On a Linux node with multiple active network interfaces, each having a default route to the Internet, which default route is preferred?
Show answer and explanation
Correct answer: E. The default route with the lowest metric value
When multiple default routes exist, the route with the lowest metric value is preferred. Metrics represent the cost of a route, where lower values indicate more preferred paths. The kernel uses metrics to determine which route to use when multiple paths to the same destination are available.
Why the other options are wrong
- A. Higher metric values indicate less preferred routes, not more preferred ones.
- B. MTU (Maximum Transmission Unit) is unrelated to route selection and preference.
- C. TTL (Time To Live) is not used to determine route preference in the routing table.
- D. Higher TTL values are not used for route preference; routing decisions use metrics, not TTL.
Question 23
In the following output of the command uptime, the load averages represent the system load averages for what time frames? 12:10:05 up 18 days, 19:00, 2 users, load average: 0.47, 24.71, 35.31
Show answer and explanation
Correct answer: A. 1, 5 and 15 minutes
The `uptime` command displays three load average values representing the average system load over the past 1, 5, and 15 minutes respectively. In the given output, 0.47 is the 1-minute average, 24.71 is the 5-minute average, and 35.31 is the 15-minute average. These standard time intervals are a fundamental part of Linux system monitoring and are consistent across all Unix-like systems.
Why the other options are wrong
- B. Load averages are not calculated for 1, 15, and 30-minute intervals.
- C. Load averages are never expressed in seconds; they always use minute-based intervals.
- D. Load averages are not measured in 15, 30, and 60-minute intervals.
- E. Load averages are not measured in seconds at all; the standard is 1, 5, and 15 minutes.
Question 24
What component of a system does smartd monitor?
Show answer and explanation
Correct answer: C. Hard drives
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 25
What should be done to ensure a client machine uses the recursive nameserver running on the IP address 192.168.0.1? (Choose two.)
Show answer and explanation
Correct answer: A, D. Add nameserver 192.168.0.1 to /etc/resolv.conf; Ensure that the dns service is listed in the hosts entry in the /etc/nsswitch.conf file
To use a recursive nameserver at 192.168.0.1, two steps are needed. First, add the nameserver to /etc/resolv.conf using 'nameserver 192.168.0.1', which tells the resolver where to send queries. Second, ensure /etc/nsswitch.conf includes 'dns' in the hosts entry so that DNS is consulted for hostname resolution.
Why the other options are wrong
- B. The route command is for managing routing tables, not DNS nameserver configuration.
- C. ifconfig is used for interface configuration and does not support nameserver parameters.
- E. bind is a DNS server package; 'bind add nameserver' is not a valid command for configuring the resolver.
Question 26
After manually compiling and installing a new kernel, what has to be done regarding the initramfs?
Show answer and explanation
Correct answer: B. Since the initramfs contains kernel modules, a new initramfs must be built for the new kernel
After compiling and installing a new kernel, a new initramfs must be built for that kernel version because the initramfs contains kernel modules and drivers specific to the kernel version. The initramfs is tightly coupled to the kernel and must match the kernel being booted.
Why the other options are wrong
- A. The initramfs is not independent; it must be rebuilt for each new kernel version.
- C. The Linux kernel compilation does not automatically build the initramfs; this is done separately using tools like mkinitramfs or dracut.
- D. The initramfs does not reconfigure itself automatically during startup; it must be explicitly built before boot.
Question 27
What is the purpose of a system mount unit?
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 28
After the downloading patch-4.6.4.xz from http://kernel.org, what are the next steps to prepare the build of a version 4.6.4 Linux kernel? (Choose two.)
Show answer and explanation
Correct answer: C, D. Apply the patch file to the kernel source directory containing kernel version 4.6.3; Uncompress the file using xz to get the uncompressed patch file
A patch file like patch-4.6.4.xz is an incremental update, typically applied to the previous kernel version source. First, you must uncompress the patch file using xz (option D) to get the uncompressed patch, then apply it to the source directory of the previous kernel version 4.6.3 (option C) using the patch command.
Why the other options are wrong
- A. The uncompressed directory should not be moved to /usr/src/linux; the patch is applied to an existing kernel source directory.
- B. Patches are applied incrementally to the immediately previous version, not to 4.6.0.
- E. The patch file should be applied to a specific previous kernel version (4.6.3), not to any arbitrary previous version.
Question 29
A network client has an Ethernet interface (eth0) configured with an IP address in the subnet 192.168.0.0/24. This subnet has a router, with the IP address 192.168.0.1, that connects this subnet to the Internet. Which of the following commands can be used on the client to enable it to use the router as its default gateway? (Choose two.)
Show answer and explanation
Correct answer: A, C. route add default gw 192.168.0.1 eth0; ip route add default via 192.168.0.1
Both commands correctly add a default gateway. Option A uses the route command with the syntax 'route add default gw 192.168.0.1 eth0', which is the classic method. Option C uses the modern ip command with 'ip route add default via 192.168.0.1', which is the preferred approach in modern Linux systems.
Why the other options are wrong
- B. ifconfig does not support a defaultroute parameter; this syntax is invalid.
- D. The /etc/resolv.conf file is for DNS configuration, not routing or default gateway settings.
- E. The route command does not use the syntax 'defaultgw=192.168.0.1 if=eth0'; this is incorrect syntax.
Question 30
Which command is used to install a GRUB boot loader into the master boot record?
Show answer and explanation
Correct answer: A. grub-install
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.
That was 30 of 120.
The full LPI LPIC-2 201-450 pack has all 120 questions, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.
Not ready yet? Get the first 60 free as one PDF by email. Get the Half Pack →
