LPIC-2 Exam 201
Question No: 151 – (Topic 8)
You are trying to boot a system and change the root password, which you do not know. What do you type at he LILO prompt?
linux disable passwords
Explanation: If you forget the root password, you can boot init into the shell and change the password using the following commands:
boot: Linux init=/bin/sh
bash# mount -o remount / -rw bash# passwd root
Reference: Michael J. Tobler. New Riders, Inside Linux: Page 466.
A: linux /etc/passwd is not a valid boot prompt command. B:linux norootpass is not a valid boot prompt command. C:linux disable passwords is not a valid boot prompt command. E:linux passwd=0 is not a valid boot prompt command.
Question No: 152 – (Topic 8)
When you only back up one partition, this is called a backup.
Explanation: If you are backing up just one partition and not the entire system, you are backing up only ‘part’ of the system. This is therefore a partial backup.
A:A differential backup backs up all files that have been changed or created since the last full or incremental backup. A differential backup does not describe what portion of a system was backed up.
B:A full backup backs up all the specified files. A full backup does not describe what portion of a system was backed up.
D:A copy backup backs up all the specified files. The difference between a full backup and a copy backup is that a full backup marks the files as having been backed up, whereas a copy backup doesn’t. A copy backup does not describe what portion of a system was
Question No: 153 CORRECT TEXT – (Topic 8)
What command would you type to use the cpio command to create a backup called backup.cpio of all the users home directories?
Answer: find /home | cpio -o gt; backup.cpio
Explanation: The cpio command expects to receive a list that contains one file per line. That is exactly the type of list that the find utility creates. The ls utility can also create this type of list, meaning that you will see either of the ls or the find utilities used in conjunction with cpio. And since cpio archives a list of files it receives from standard input, you usually use a pipe (|) whenever you create an archive with the cpio utility.
A lot of documentation suggests using the -print option with the find command. For example, find /home -print | cpio -o gt; backup.cpio. However, this is not required on Linux systems, and other systems that use GNU find, although it is required on Unix systems.
Question No: 154 – (Topic 8)
You want to export a local file system /data, and permit read-write access for all users on hostA. In addition, the root account on hostA should be allowed root level access. All other hosts are to have read-only access. Which of the following /etc/exports lines would you use?
/data hostA(rw,no_root_squash) (ro)
/data hostA(allow_root) -ro
/data hostA=rw,root *=ro
/data hostA(rw,all_squash,anonid=0) @all(ro)
Explanation: The format of the /etc/exports lines is ‘directoryname hostname(options)’. In this case you are exporting the /data directory. HostA has the (rw,no_root_squash) permissions applied and everyone else gets the (ro) permission. The rw permission allows HostA read/write permissions. The no_root_squash option gives the root account on HostA root access to the /data directory. Everyone else gets the ro permission which means read only.
B:The option to allow root access is no_root_squash, not allow_root.
C:The syntax in this answer is incorrect. D:The syntax in this answer is incorrect. E:The syntax in this answer is incorrect.
Question No: 155 CORRECT TEXT – (Topic 8)
When typing at the command line, the default editor is the library.
Explanation: The default command line editor is the Readline library. As with most text editor programs, it allows certain keystrokes to aid in the writing/editing of a command. For example, there are keystroke combinations that allow you to jump to the beginning or end of the line, or to jump to the start or end of a previous word.
Question No: 156 – (Topic 8)
You are creating a script with demands that the previous command execute correctly. How would you correctly test the exit status of the previous command in BASH?
A. if [ “$#” -eq “0” ]; then…
B. if [ “$?” -eq “0” ]; then…
C. if [ ‘$#’ == 0 ]; then…
D. if [ ‘$?’ == ‘0’]; then…
E. if [ $@ -eq 0 ]; then…
Explanation: The variable quot;$?quot; checks the exit status of the last command run. The -eq “0” statement is used to check whether a condition is true. The statement if [ “$?” -eq “0” ]; then… will check that the last command executed correctly and run the next part of the script.
A:The variable is “$?” not “$#”.
C:The variable is “$?” not “$#”.
D:The variable is “$?” not ‘$?’ (double quotes, not single quotes).
E:The variable is “$?” not $@.
Question No: 157 – (Topic 8)
Which one of the following factors does not play a role in choosing the type of backup media to use?
How frequently a file changes.
How long you need to retain the backup.
How much data needs to be backed up.
How frequently the backed up data needs to be accessed.
Explanation: Your choice of backup media will depend on its capacity, its shelf life and the time it takes to access the data. The frequency of file changes is irrelevant.
Question No: 158 – (Topic 8)
You have to mount the /data filesystem from an NFS server (srv 1) that does not support locking. Which of the following mount commands should you use?
mount -a -t nfs
mount -o locking=off srv1:/data /mnt/data
mount -o nolocking srv1:/data /mnt/data
mount -o nolock srv1:/data /mnt/data
mount -o nolock/data@srv1 /mnt/data
Explanation: If you are mounting a volume that does not support locking, you need to use the nolock option with the mount command. The nolock option tells the system to not use the NFS locking protocol.
Reference: http://docsrv.caldera.com:8457/cgi-bin/info2html?(am- utils.info.gz)opts%20Option
A:This answer has the wrong command options. B:‘Locking=off’ is the wrong option. It should be ‘nolock’. C:‘Nolocking’ is the wrong option. It should be ‘nolock’.
E:/data@srv1 is the wrong syntax. It should be lt;servernamegt;:/lt;foldernamegt;.
Question No: 159 – (Topic 8)
Using command substitution, how would you display the value of the present working directory?
pwd | echo
Explanation: The echo command can be used to display the contents of variables. The present working directory is held in the pwd variable. Echo $(pwd) will display the contents of the pwd variable. Other commands that would work are echo $ PWD and echo “$PWD”.
Question No: 160 – (Topic 8)
Every time you attempt to delete a file using the rm utility, the operating system prompts you for confirmation. You know that this is not the customary behavior for the rm command. What is wrong?
rm has been aliased as rm -i
The version of rm installed on your system is incorrect.
This is the normal behavior of the newest version of rm.
There is an incorrect link on your system.
Explanation: The -i option with the rm command runs the command in ‘interactive’ mode. This will cause rm to prompt you for the deletion of a file.
B:The fact that rm is prompting for a confirmation indicates that the version of rm is compatible with your system.
C:This is not the normal behaviour for rm although it will prompt you if you are attempting to delete a write protected file.
D:The rm command is running the rm program so there is not an incorrect link.
|Lowest Price Guarantee||Yes||No||No|
|Free VCE Simulator||Yes||No||No|