The system is having trouble and the engineer wants to bypass the usual /sbin/init start up and run /bin/sh. What is the usual way to pass this change to the kernel from your boot loader?
Correct Answer: B
Explanation The usual way to pass this change to the kernel from the boot loader is to pass init=/bin/sh on the kernel parameter line12. The init kernel parameter is used to specify the program that is run as the first process after the kernel is loaded3. By default, this program is /sbin/init, which is responsible for starting and managing other processes and services4. However, by passing init=/bin/sh, the kernel will run /bin/sh instead, which is a shell program that allows the user to execute commands interactively or from a script5. This way, the user can bypass the usual initialization process and run /bin/sh as the root user, which can be useful for troubleshooting or recovery purposes12. The other options in the question are not correct because: * A. Start in runlevel 1: This option would not bypass the /sbin/init program, but rather instruct it to start the system in single-user mode, which is a mode that allows only the root user to log in, and disables all network services and graphical interfaces. To start in runlevel 1, the user would need to pass single or 1 on the kernel parameter line, not init=/bin/sh. * C. Pass /bin/sh on the kernel parameter line: This option would not work, because the kernel would not recognize /bin/sh as a valid parameter and would ignore it. The kernel only accepts parameters that have a specific format, such as name=value or name.flag3. To specify the init program, the user would need to use the init= prefix, as in init=/bin/sh3. * D. Pass start=/bin/sh on the kernel parameter line: This option would also not work, because the kernel does not have a start parameter. The user would need to use the init parameter, as in init=/bin/sh3. References: 1: How to pass arguments to a Linux kernel init= bootparam? - Unix & Linux Stack Exchange 2: kernel parameter init=/bin/bash not working? (RHEL7, RHCSA test) - Unix & Linux Stack Exchange 3: The kernel's command-lineparameters - The Linux Kernel documentation 4: [init - Wikipedia] 5: [sh - Wikipedia] : [Single-user mode - Wikipedia] : How to Change Runlevels (targets) in SystemD - Tecmint
Question 7
What does the command mount -a do?
Correct Answer: D
The command mount -a mounts all filesystems that are listed in the file /etc/fstab and have the option auto set. The option auto means that the filesystem can be mounted automatically by the mount -a command or at boot time. The option noauto means that the filesystem can only be mounted explicitly by the mount command with the device or mount point specified12. The file /etc/fstab contains information about the filesystems that are known to the system and how they can be mounted3. The command mount -a is useful for mounting all the filesystems that are needed by the system after a change in /etc/fstab or after a reboot4. References: 1: mount(8) - Linux man page 2: Linux mount and umount commands help and examples 3: fstab(5) - Linux man page 4: How to Use the mount Command on Linux
Question 8
You just started X for the first time and noticed that the display does not use the entire screen. What program can you use to fix this?
Correct Answer: B
Question 9
Which of the following files, located in a user's home directory, contains the Bash history?
Correct Answer: B
Question 10
Which of the following command sets the Bash variable named TEST with the content FOO?
Correct Answer: D
Explanation The correct way to set a Bash variable is to use the syntax variable=value without any spaces around the equal sign. The value can be enclosed in double quotes if it contains spaces or special characters, but it is not mandatory. Therefore, TEST="FOO" will set the Bash variable named TEST with the content FOO. The other options are either invalid or do not perform the desired task. The set command is used to set or unset shell options and positional parameters, not variables. The var command is not a valid Bash command. The TEST = "FOO" syntax will cause a syntax error because of the spaces around the equal sign. References: * LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.1 Work on the command line * LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)