201-450 LPI Practice Test Questions and Exam Dumps


Question No 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

Correct answer: B

Explanation: 

The correct command to erase the contents of a partition in a Unix-like system is dd if=/dev/zero of=/dev/sdb3. The dd command is used for low-level copying and can write data to a device or partition. In this case, if=/dev/zero means the input file is /dev/zero, which generates a stream of zero bytes. The of=/dev/sdb3 specifies that these zero bytes will be written to the partition /dev/sdb3, effectively erasing all data on the partition by overwriting it with zeros.

Here’s why the other options are incorrect:

  • A. rm /dev/sdb3: The rm command is used to remove files, not devices or partitions. It cannot erase the contents of a partition. The command would result in an error because /dev/sdb3 is a block device, not a regular file.

  • C. dd of=/dev/zero if=/dev/sdb3: This command is incorrect because it attempts to copy data from /dev/sdb3 to /dev/zero. Since /dev/zero is a special device that produces an endless stream of zeros, this command doesn't accomplish the task of erasing the partition; instead, it would result in an error because it’s trying to use a device as the output (of) instead of the source of zeros.

  • D. umount /dev/sdb3: The umount command is used to unmount a mounted file system or partition, which is not the same as erasing its contents. While unmounting a partition is necessary before performing operations like formatting or writing to it, this command does not erase any data.

Thus, B is the correct command to erase the contents of the /dev/sdb3 partition by writing zeros to it.

Question No 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.)

A. configure
B. config.h.in
C. makefile
D. Makefile
E. Makefile.in

Answer: C, D

Explanation:

When using GNU make to compile software from source code, the tool looks for specific files that contain instructions on how to build the software, typically in the form of a Makefile. A Makefile contains rules, targets, and dependencies that guide the build process. There are certain naming conventions that GNU make follows to determine which file to use:

  • Option C: makefile — The lowercase makefile is one of the standard names GNU make will look for if no file is explicitly specified on the command line. Although the convention is often to use the capitalized version, GNU make is still capable of using a lowercase makefile if it is present in the directory.

  • Option D: Makefile — The Makefile (capital M) is the primary and default file name that GNU make looks for when building software. If no other file is specified, make will look for this file by default in the current directory.

Now, let's analyze the other options:

  • Option A: configure — The configure file is not used by GNU make directly. Instead, it is typically a shell script that helps in configuring the software, such as checking for system dependencies or generating the Makefile from a template. It’s an important part of the build process but not used by make itself.

  • Option B: config.h.in — This file is often used as a template for generating the config.h file during the configuration stage. It is not a file used directly by GNU make to build software, but rather part of the preprocessing stage that happens before the actual build process begins.

  • Option E: Makefile.in — The Makefile.in is a template for the Makefile generated during the configuration process, typically by running the configure script. It is not used directly by make, but it is an intermediate file in the process of preparing the software build environment.

In conclusion, the two files that GNU make will look for are makefile (option C) and Makefile (option D), depending on which one exists in the current directory. Therefore, the correct answer is C and D.

Question No 3:

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"™

Correct answer: A

Explanation:

In this scenario, we are working with a tar command to extract files from an archive named lpifiles.tar.gz. The goal is to extract only those files whose names contain the string "lpi." Let's break down the options and explain why A is correct.

tar command basics:
The tar command is used for creating, viewing, and extracting files from archive files. The syntax to extract files from a .tar.gz archive is typically:

-x: Extract files from the archive.

-v: Verbose mode, showing the names of files as they are extracted.

-z: Filter the archive through gzip (for .gz files).

-f: Specifies the filename of the archive.

Understanding the options:
Now, let's focus on the options provided:

A. tar xvzf lpifiles.tar.gz --wildcards "˜lpi"™:
This option uses wildcards to match any file name containing "lpi". The wildcard pattern *lpi* matches any string that contains "lpi" at any position in the file name. This is the correct way to extract only those files from the archive that contain "lpi" in their name. The --wildcards option tells tar to use pattern matching.

B. tar xvzwf lpifiles.tar.gz "˜lpi"™:
This option has an incorrect syntax. The correct option for decompressing .gz files is -z, but the w option is invalid here. Additionally, the command syntax is incorrect because w doesn’t exist for tar in this context.

C. tar -xvfz lpifiles.tar.gz --deep "˜lpi"™:
The --deep option doesn't exist in tar. Therefore, this option is invalid.

D. tar -xvzf lpifiles.tar.gz --subdirs "˜lpi"™:
The --subdirs option is also invalid in tar and doesn't match the behavior we want. Subdirectory handling in tar is typically not specified in this way.

E. tar xvzf lpifiles.tar.gz --globbing "˜lpi"™:
The --globbing option is not a valid option for tar. Tar does not use this option for pattern matching or extraction.

The correct option is A, which uses the valid --wildcards option along with a pattern to extract only files whose names contain "lpi". The other options either contain incorrect syntax or invalid options.

Correct answer: A

Question No 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.)

A. Install the binaries manually with suinstall
B. Run make install with root privileges
C. Do not run ./configure in order to maintain the default configuration for correct installation
D. Rerun ./configure with a --prefix option where the user has permissions to write
E. Run make install_local to install into /usr/local/

Correct answer: B,D

Explanation:

In the scenario where a regular user attempts to run ./configure && make && make install but encounters an installation failure, there are several potential solutions based on permission issues or the need for configuration adjustments.

  • B. Run make install with root privileges:
    When running make install, the process typically involves writing files to system directories like /usr/bin, /usr/local/bin, or /etc, which require root or elevated privileges. Since a regular user does not have permission to write to these directories, the installation fails. Running make install with root privileges using sudo (i.e., sudo make install) will grant the necessary permissions to complete the installation. This is a standard approach to resolve installation failures related to permission issues.

  • D. Rerun ./configure with a --prefix option where the user has permissions to write:
    The ./configure script is responsible for setting up the program for installation, and it can be customized with the --prefix option to specify a different directory for installation. If a regular user does not have write access to the default installation directories (like /usr/local), using the --prefix option allows them to specify a directory where they have write permissions, such as their home directory or a local directory. For example:
    ./configure --prefix=/home/user/my_program_directory
    This ensures the program is installed in a location that the user has permission to write to.

Let's analyze why the other options are less appropriate:

  • A. Install the binaries manually with suinstall:
    There is no widely-known suinstall command or tool used for manual binary installation. The process of manually installing binaries would typically involve copying files into the appropriate directories, but this would still require root permissions and could be error-prone. This is not a standard solution.

  • C. Do not run ./configure in order to maintain the default configuration for correct installation:
    Running ./configure is a necessary step to configure the software before building and installing it. Not running ./configure would prevent the program from being configured for the system, likely causing further issues in the build and installation process. Maintaining default configurations is generally not relevant to permission issues.

  • E. Run make install_local to install into /usr/local/:
    While installing into /usr/local/ may be a valid choice for a user with appropriate permissions, it’s still likely that make install_local would fail for a regular user unless they have write access to /usr/local/. Additionally, make install_local is not a universally supported command and may not be available in all source distributions. This approach would require root privileges unless the installation path is changed to a user-accessible directory.

Therefore, the best solutions to resolve the installation failure are B (running with root privileges) and D (adjusting the --prefix to a directory where the user has write permissions).

Question No 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?

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

Correct answer: D

Explanation:

In the command sequence provided, the tar command is used to extract files from a tape device (/dev/nst0) into the /opt directory. Here's a breakdown of the command's behavior and its implications:

  • cd /opt; changes the current working directory to /opt.

  • tar xvf /dev/nst0; extracts the contents of the tape device /dev/nst0 and lists them as it does so (v stands for verbose).

The key point here is that the tape device /dev/nst0 is being used with non-rewinding mode (denoted by nst instead of st). This means that after the first extraction, the tape does not rewind automatically. Therefore, the next time the tar command is run, it will continue extracting from where it left off in the tape rather than starting from the beginning of the tape.

Option A is incorrect because there is no indication in the command sequence that the tape has been ejected. With non-rewinding mode (nst0), the tape remains in place and does not need to be reloaded or reinserted.

Option B is incorrect because the contents of /opt will not be restored again. The tar command continues from the next file on the tape, and unless the tape is explicitly rewound, it will not reextract the contents already written to /opt.

Option C is incorrect because the contents of /opt will not be replaced by the next file on the tape. The command appends the next file(s) onto the /opt directory, rather than replacing its existing contents.

Option D is the correct answer because the tar command will extract additional content from the next file on the tape, adding it to /opt without affecting the existing files that have already been restored.

In conclusion, when the command sequence is run again, the contents of /opt will have additional content added from the next file on the tape, continuing the extraction process.

Question No 6:

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

Correct answer: D

Explanation:

In a RAID 5 array, simulating a device failure is useful for testing the array's resilience and recovery mechanisms. The mdadm tool, which is used to manage Linux software RAID arrays, provides several options to simulate device failure or remove a device from the array.

A. mdadm --remove /dev/md0 /dev/sdd1 is incorrect. This command removes the device /dev/sdd1 from the RAID array /dev/md0, but it does not simulate a failure. Instead, it removes the device from the active RAID configuration. Removing a device can cause the array to enter a degraded state, but it is not the same as simulating a failure.

B. mdadm --zero-superblock /dev/sdf3 is incorrect. This command clears the superblock of a device, which effectively removes the RAID metadata from the device. While it could make the device unusable within a RAID array, it does not simulate a failure in the context of the RAID array itself; rather, it prepares the device for reuse or removal from the array.

C. mdadm --force-fault /dev/md2 /dev/sde2 is incorrect. This command is used to force a fault on a device, but the correct syntax requires the --fail option instead of --force-fault. Additionally, the array name (/dev/md2) should be specified correctly, and the --fail option would be more appropriate in this context.

D. mdadm --fail /dev/md0 /dev/sdc1 is the correct answer. This command explicitly simulates a failure of the device /dev/sdc1 in the RAID 5 array /dev/md0. The --fail option marks the specified device as failed, causing the RAID array to enter a degraded state, which mimics the scenario where a drive fails in a RAID 5 array. This is the most straightforward and accurate way to simulate a failed device.

E. mdadm /dev/md0 --offline /dev/sdc1 is incorrect. This command takes the device /dev/sdc1 offline in the RAID array, but taking a device offline does not simulate a failure. It is more about temporarily removing the device from the active configuration, and the array might still be able to function, depending on the RAID level and the number of available drives.

In summary, to simulate a failed device within a RAID 5 array, the appropriate command is mdadm --fail /dev/md0 /dev/sdc1. This command marks the specified device as failed, which simulates a failure scenario and allows you to test the RAID array's response.

Question No 7:

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

A. 1
B. 2
C. 3
D. 4
E. 5

the correct answer is C.

Explanation:

In a RAID 5 configuration, data is striped across multiple disks, and a parity block is distributed across the disks as well. This parity allows RAID 5 to provide redundancy, meaning that if one disk fails, the data can still be reconstructed using the remaining data and parity information.

  • The minimum number of disks required for RAID 5 is 3. This is because RAID 5 needs at least three disks to provide both data striping and the distributed parity. With fewer than three disks, it is not possible to configure RAID 5, as there would be no room for both data and parity.

  • A (1 disk) is incorrect because a single disk cannot provide redundancy or striping.

  • B (2 disks) is incorrect because RAID 5 requires at least three disks to operate.

  • D (4 disks) and E (5 disks) are both possible configurations for RAID 5, but they exceed the minimum requirement of three disks.

Thus, the correct answer is C.

Question No 8:

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

Answer: D

Explanation:

In Linux, devices such as hard drives, CD/DVD drives, and other storage devices are represented by specific device files in the /dev/ directory. These files provide an interface for the system to interact with the devices, such as reading from or writing to them.

  • D. /dev/sr0 is the standard device file for the first CD/DVD drive in Linux systems. This device is typically used for optical drives like CD writers, DVD drives, and Blu-ray drives. The /dev/sr prefix indicates a SCSI CD-ROM drive (which applies to SATA optical drives as well, even though they are not strictly SCSI devices), and the number 0 refers to the first such device. If there are multiple CD/DVD drives, they would be numbered sequentially, e.g., /dev/sr1 for the second drive.

Now, let’s explain why the other options are incorrect:

  • A. /dev/hdb: The /dev/hdb device file was traditionally used for the second IDE (PATA) hard drive in older systems. However, this naming convention is outdated and not applicable for modern systems that use SATA drives. Additionally, this file would be for a hard disk, not a CD writer.

  • B. /dev/sdd: The /dev/sdd device file typically refers to the fourth SATA or SCSI hard drive in the system. Since the question specifies that there is one hard disk and one CD writer, /dev/sdd would most likely represent another hard disk or storage device, not the CD writer.

  • C. /dev/scd1: The /dev/scd naming convention was once used to represent SCSI CD-ROM drives in older systems, but it is now obsolete in favor of /dev/sr0, /dev/sr1, etc. This naming convention may still appear in older systems or legacy setups, but modern Linux distributions typically use the /dev/sr convention.

  • E. /dev/sr1: The /dev/sr1 device file would represent the second CD/DVD drive on the system. Since there is only one CD writer mentioned in this case, the correct device file for the first CD/DVD drive is /dev/sr0, not /dev/sr1.

In conclusion, the /dev/sr0 device file is the correct representation for the first CD/DVD writer in a modern Linux system. Therefore, the correct answer is D.

UP

LIMITED OFFER: GET 30% Discount

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 30% Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.