CompTIA Linux+ Practice Test (XK0-006)
Use the form below to configure your CompTIA Linux+ Practice Test (XK0-006). The practice test can be configured to only include certain exam objectives and domains. You can choose between 5-100 questions and set a time limit.

CompTIA Linux+ XK0-006 (V8) Information
CompTIA Linux+ (v8 / XK0-006) Exam
The CompTIA Linux+ (XK0-006) certification is designed for IT professionals who work with Linux systems. It validates skills in system administration, security, scripting, and troubleshooting. This certification is vendor-neutral, covering multiple distributions such as Ubuntu, CentOS, and Red Hat.
Exam Overview
The XK0-006 exam consists of a maximum of 90 questions, including multiple-choice and performance-based questions. Candidates have 90 minutes to complete the test. The exam costs $358 USD. A passing score is 720 on a scale of 100 to 900. The certification is valid for three years and can be renewed through CompTIA’s continuing education program.
Exam Content
The XK0-006 exam focuses on five main domains: system management, security, scripting and automation, troubleshooting, and Linux fundamentals. System management includes package management, system monitoring, and user administration. Security covers permissions, authentication, and encryption. Scripting and automation focus on Bash scripting and task automation. Troubleshooting tests problem-solving skills for system failures and performance issues. Linux fundamentals include file system hierarchy, networking, and command-line operations.
Who Should Take This Exam?
The CompTIA Linux+ certification is ideal for system administrators, Linux support technicians, and DevOps professionals. It is recommended for individuals with at least one year of Linux experience. This certification is beneficial for IT professionals working with servers, cloud infrastructure, and cybersecurity.
How to Prepare
Candidates should review the official CompTIA Linux+ Exam Objectives and study materials provided by CompTIA. Hands-on experience with Linux systems is essential. Practice exams can help assess readiness and identify weak areas. Using Linux in a lab or virtual environment can provide practical experience with commands, system configuration, and troubleshooting.
Summary
The CompTIA Linux+ (XK0-006) certification is a valuable credential for IT professionals working with Linux systems. It validates essential skills in system administration, security, and automation. This certification is ideal for those managing Linux-based environments in IT infrastructure, cybersecurity, and cloud computing.

Free CompTIA Linux+ XK0-006 (V8) Practice Test
- 20 Questions
- Unlimited
- System ManagementServices and User ManagementSecurityAutomation, Orchestration, and ScriptingTroubleshooting
Free Preview
This test is a free preview, no account required.
Subscribe to unlock all content, keep track of your scores, and access AI features!
You are preparing a RHEL-based server that boots with GRUB 2 on a BIOS system. The kernel must always start with the noapic parameter, and the setting must be preserved when new kernels are installed. After making the change you will regenerate the boot-loader configuration with:
grub2-mkconfig -o /boot/grub2/grub.cfg
Which single configuration file should you edit before running the command so the new parameter is applied persistently?
/boot/grub2/custom.cfg
/etc/grub.d/10_linux
/boot/grub2/grub.cfg
/etc/default/grub
Answer Description
GRUB 2's human-editable settings are stored in /etc/default/grub. When grub2-mkconfig runs, it combines the values in this file (especially the GRUB_CMDLINE_LINUX line) with the scripts in /etc/grub.d/ to build a fresh /boot/grub2/grub.cfg. Editing /etc/default/grub therefore ensures that any kernel parameters you add-such as noapic-are written into every menu entry and are kept when future kernels are installed.
The other choices are unsuitable:
- /boot/grub2/grub.cfg is the generated file; any manual edits are overwritten the next time grub2-mkconfig or a kernel update runs.
- /etc/grub.d/10_linux is a script snippet, not the central place for simple kernel-parameter changes, and editing it risks syntax errors that break the whole menu.
- /boot/grub2/custom.cfg is intended for custom menu entries only; modifications there are not propagated to new kernels installed by the package manager.
Therefore, editing /etc/default/grub is the correct and supported method.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why is /etc/default/grub used for kernel parameter changes?
What happens if you manually edit /boot/grub2/grub.cfg instead?
What is the purpose of /etc/grub.d/10_linux?
You have booted a Linux server into single-user (rescue) mode after an unexpected power loss. Before you run fsck on the root file system (/), you must switch that file system to read-only without changing its mount point or rebooting. Which single command accomplishes this task?
mount -o remount,ro /mount -o bind,ro / /mount -o remount,rw /mount -o remount,nosuid /
Answer Description
The remount option tells the kernel to change the mount options of an already-mounted file system in place. Adding ro sets the mount to read-only. Therefore, mount -o remount,ro / immediately flips the root file system to read-only while it remains mounted at /.
The other choices are incorrect:
mount -o bind,ro / /attempts a bind mount; it would create a second mount of the same directory and is not how you change an existing mount's permissions.mount -o remount,nosuid /changes only the nosuid flag; the file system would still be read-write.mount -o remount,rw /explicitly keeps the file system read-write, the opposite of what is required.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the 'remount' option do in the mount command?
What is the purpose of single-user mode in Linux?
Why must the root file system be switched to read-only before running fsck?
After cloning a Debian-based server to a replacement disk, the first reboot halts with an initramfs emergency prompt reporting that the kernel cannot mount the root filesystem on the UUID supplied in the root= parameter. Investigation shows that GRUB2 (installed in legacy BIOS/MBR mode) is still passing the old UUID to the kernel. The administrator wants to make the new root UUID persist across future kernel updates. Which configuration file should be modified before running update-grub so the correct root= value is passed to the kernel at every boot?
/etc/fstab
/etc/default/grub
/etc/grub.d/40_custom
/boot/grub/grub.cfg
Answer Description
GRUB2 stores the menu that the firmware actually reads in /boot/grub/grub.cfg, but on Debian-based systems that file is regenerated automatically from templates each time update-grub (or a kernel package) is run. Persistent kernel command-line changes are therefore made in /etc/default/grub, usually by editing the GRUB_CMDLINE_LINUX (or GRUB_CMDLINE_LINUX_DEFAULT) variable and then regenerating the menu with update-grub. Editing /boot/grub/grub.cfg directly will work only until the next update overwrites it. The script /etc/grub.d/40_custom is meant for adding entirely new menu entries, not for changing the parameters of the distribution-generated entries. /etc/fstab influences how filesystems are mounted after the kernel has already mounted its root filesystem, so changing it will not fix a root= mismatch during early boot.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the GRUB_CMDLINE_LINUX variable in /etc/default/grub?
Why shouldn't you edit /boot/grub/grub.cfg directly?
What role does the UUID play in the root= parameter in GRUB2?
A Linux administrator is troubleshooting a server where a secondary XFS filesystem on /dev/sdb1 is suspected to be corrupt. The filesystem was not cleanly unmounted and now fails to mount. Before attempting any repairs, the administrator needs to perform a read-only check of the filesystem to assess the damage without making any modifications. Which of the following commands should be used to accomplish this?
xfs_repair -n /dev/sdb1
xfs_repair /dev/sdb1
xfs_growfs /dev/sdb1
fsck /dev/sdb1
Answer Description
The correct command is xfs_repair -n /dev/sdb1. The xfs_repair utility is specifically designed to check and repair XFS filesystems. The -n option runs the command in no-modify mode, performing a read-only check without changing the filesystem, which is a crucial first step in assessing corruption. The command must be run on an unmounted filesystem, specified by its device name, such as /dev/sdb1.
xfs_repair /dev/sdb1is incorrect because, without the-noption, it would immediately attempt to repair the filesystem, which is not what the scenario asks for. The administrator wants to check for issues first.fsck /dev/sdb1is incorrect because, for XFS filesystems, thefsckcommand is a wrapper that typically does nothing and exits, recommending the use ofxfs_repair.xfs_growfs /dev/sdb1is incorrect as this command is used to expand or grow an existing XFS filesystem, not to check or repair it.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the '-n' option in the xfs_repair command?
Why can't the fsck command be used to check an XFS filesystem?
How can you ensure that the xfs_repair command is safe to use on a filesystem?
A system administrator is running a script that generates a large amount of verbose output to both standard output and standard error. The administrator only needs to check the script's exit code and wants to prevent all output from being displayed on the terminal or written to a log file. Which of the following commands will achieve this?
script.sh > /dev/randomscript.sh > /dev/zeroscript.sh | /dev/nullscript.sh > /dev/null 2>&1
Answer Description
The correct command is script.sh > /dev/null 2>&1. This command structure first redirects standard output (stdout, file descriptor 1) to the special device file /dev/null, which discards all data written to it. Then, 2>&1 redirects standard error (stderr, file descriptor 2) to the same location as standard output, effectively discarding error messages as well. Redirecting to /dev/zero is incorrect; its primary purpose is to provide a stream of null characters when read. Using a pipe (|) with /dev/null is incorrect because /dev/null is a device file, not a command that accepts standard input. Redirecting to /dev/random is also incorrect as this file is a source for random data and not intended for discarding output.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of /dev/null in Linux?
What does the '2>&1' part of the command mean?
Why can't /dev/zero or /dev/random be used for discarding output?
You need to permanently disable IPv6 on a BIOS-based RHEL server that uses GRUB 2. The change must survive future kernel updates and must follow the vendor-recommended workflow for modifying the boot loader configuration. Which action will achieve this goal?
Add "ipv6.disable=1" to the GRUB_CMDLINE_LINUX line in /etc/default/grub and run "grub2-mkconfig -o /boot/grub2/grub.cfg".
Append "ipv6.disable=1" directly to the linux line in /boot/grub2/grub.cfg and save the file.
Add "ipv6.disable=1" to the DEFAULTKERNEL variable in /etc/sysconfig/kernel and run "dracut -f" to rebuild the initramfs.
Create a custom menuentry with "ipv6.disable=1" inside /etc/grub.d/40_custom and run "grubby --update-kernel=ALL".
Answer Description
GRUB 2 regenerates its binary menu (/boot/grub2/grub.cfg) from templates in /etc/grub.d and the settings found in /etc/default/grub. Red Hat documentation states that you should edit /etc/default/grub (for example, by adding ipv6.disable=1 to the GRUB_CMDLINE_LINUX line) and then rebuild the menu with grub2-mkconfig -o /boot/grub2/grub.cfg. Editing grub.cfg directly is discouraged because the file is overwritten whenever grub2-mkconfig or update-grub is run. Placing the parameter in /etc/grub.d/40_custom or in /etc/sysconfig/kernel does not automatically propagate the option to every new kernel and therefore is not the preferred, maintainable approach.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is GRUB 2 and how does it function in Linux?
Why is editing `/boot/grub2/grub.cfg` directly discouraged?
What does the kernel parameter `ipv6.disable=1` do?
A system administrator is teaching a new intern about the Filesystem Hierarchy Standard (FHS) on a Linux server. The intern asks about the purpose of the topmost directory. According to the FHS, what is the primary role of the root (/) directory?
It contains variable data files that change during system operation, such as logs and mail spools.
It contains the majority of multi-user utilities, applications, and their libraries.
It serves as the primary hierarchy and contains all other directories and files.
It contains all system-wide configuration files and host-specific settings.
Answer Description
The correct answer is that the root (/) directory is the primary hierarchy and contains the entire filesystem. According to the Filesystem Hierarchy Standard (FHS), all files and directories appear under the root directory, even if they are on different physical devices. The other options are incorrect as they describe other specific top-level directories:
- System-wide configuration files are stored in
/etc. - Shareable, read-only user utilities and applications are stored in
/usr. - Variable data files, such as logs and spools, are stored in
/var.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the Filesystem Hierarchy Standard (FHS)?
What is the difference between the root (/) directory and the /root directory?
How does the FHS handle files across multiple physical devices?
A network administrator is using iperf3 to troubleshoot network throughput between two Linux servers, ServerA (10.0.1.10) and ServerB (10.0.1.20). The administrator starts the iperf3 server process on ServerA. To measure the download speed from ServerA to ServerB, which command should be executed on ServerB?
iperf3 -s -c 10.0.1.10iperf3 -c 10.0.1.10 --get-server-outputiperf3 -c 10.0.1.10iperf3 -c 10.0.1.10 -R
Answer Description
The correct command is iperf3 -c 10.0.1.10 -R. By default, an iperf3 test sends data from the client to the server, which measures the upload speed of the client. The -R (or --reverse) flag reverses the direction of the test, causing the server (ServerA) to send data to the client (ServerB). This correctly measures the download speed on the client machine. The command iperf3 -c 10.0.1.10 would measure the upload speed from ServerB to ServerA. The command iperf3 -s -c 10.0.1.10 is invalid because the -s (server) and -c (client) flags are mutually exclusive. The --get-server-output flag is used to retrieve the server's final report at the client, but it does not alter the direction of the data transfer.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `-R` flag do in `iperf3`?
Why can't the `-s` and `-c` flags be used together in `iperf3`?
What is the purpose of the `--get-server-output` flag in `iperf3`?
You are writing a Bash deployment script that must append the following stanza to /etc/httpd/conf.d/example.conf:
<VirtualHost *:80>
ServerName $SERVERNAME
DocumentRoot $DOCROOT
</VirtualHost>
The script has two requirements:
- The $SERVERNAME and $DOCROOT variables must be substituted by the parent shell before the text is written.
- The four leading spaces that indent each inner line are literal spaces and must be preserved exactly as written.
Which of the following command constructions meets both requirements and appends the stanza to the file?
cat <
> /etc/httpd/conf.d/example.conf <VirtualHost *:80> ServerName $SERVERNAME DocumentRoot $DOCROOT EOF cat <<'EOF' >> /etc/httpd/conf.d/example.conf <VirtualHost *:80> ServerName $SERVERNAME DocumentRoot $DOCROOT EOF
cat <<< "<VirtualHost *:80> ServerName $SERVERNAME DocumentRoot $DOCROOT " >> /etc/httpd/conf.d/example.conf
cat <<-EOF >> /etc/httpd/conf.d/example.conf <VirtualHost *:80> ServerName $SERVERNAME DocumentRoot $DOCROOT EOF
Answer Description
Using an unquoted delimiter with the standard here-document operator (<<) allows the shell to treat the body of the document like a double-quoted string: parameter expansion and command substitution occur. Crucially, all characters, including literal leading spaces, are copied to the command's standard input. This meets both requirements. Quoting the delimiter (<<'EOF') disables all expansions, so $SERVERNAME and $DOCROOT would be written literally. The <<- operator strips leading tab characters from each line of the document. Because the required indentation consists of spaces, this operator is not the correct tool for the job. The <<< operator is a here-string, not a here-document; it is designed to supply a single string to a command's standard input and is not the correct tool for embedding multi-line blocks of text. Therefore, the construction that uses an unquoted delimiter with << and a >> redirection is the only choice that satisfies both requirements.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of << in a Bash script?
How does quoting the delimiter (<<'EOF') affect the output?
What is the difference between << and <<< in Bash scripting?
A Linux administrator has placed a new set of custom scripts in the /usr/local/sbin directory and made them executable. When the administrator tries to run a script by typing only its name, the shell returns a "command not found" error. The output of echo $PATH is as follows:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Which of the following commands must the administrator run to allow the scripts in /usr/local/sbin to be executed by name for the duration of the current session?
source /usr/local/sbin
chmod +x /usr/local/sbin/*
export PATH=$PATH:/usr/local/sbin
export PATH="/usr/local/sbin"
Answer Description
The correct command is export PATH=$PATH:/usr/local/sbin. The PATH environment variable contains a colon-separated list of directories that the shell searches for executable files. To allow the shell to find the new scripts, their directory must be added to the PATH. The syntax $PATH:/usr/local/sbin takes the existing value of the PATH variable ($PATH) and appends the new directory, /usr/local/sbin, to the end of the list. The export command makes this new PATH variable available to any subsequent commands executed in the current session. Overwriting the PATH with export PATH="/usr/local/sbin" would remove all other essential system directories, causing most standard commands to fail. The source command is used to execute a script in the current shell, not to add a directory to the PATH. Setting permissions with chmod is a necessary step to make a script runnable, but it does not solve the issue of the shell not being able to locate the file.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the PATH environment variable?
Why does the `$PATH:/usr/local/sbin` syntax work for appending directories?
What happens if you use `export PATH="/usr/local/sbin"` instead?
A system administrator is running a lengthy script, ./update.sh, that generates important progress information to standard output. The administrator needs to capture this output in a file named update.log for later analysis, but also wants to monitor the script's execution in real time on the terminal. Which of the following commands will achieve this?
./update.sh | tee update.log./update.sh > update.log && tail -f update.log./update.sh > update.logtee update.log < ./update.sh
Answer Description
The correct command is ./update.sh | tee update.log. The tee command reads from standard input and writes to both standard output and one or more files simultaneously. The pipe symbol | sends the standard output of the ./update.sh script to the standard input of the tee command. tee then displays that output on the terminal (its standard output) and saves it to the update.log file.
- The command
./update.sh > update.loguses the output redirection operator>, which sends the standard output only to the file, not to the screen. - The command
./update.sh > update.log && tail -f update.logwould only runtail -fafter the./update.shscript has finished successfully, which does not allow for real-time monitoring of the script as it runs. - The command
tee update.log < ./update.shincorrectly tries to use the script file itself as standard input fortee, rather than executing the script and capturing its output.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `tee` command do in Linux?
What is the difference between `>` and `|` in Linux?
How does `tail -f` differ from using `tee` for real-time monitoring?
During installation of a new x86_64 server, the root filesystem is placed inside a LUKS-encrypted logical volume (LVM). After running dracut to regenerate the initial RAM disk, the machine boots successfully and asks for the passphrase early in the boot sequence. Which statement best explains why the initramfs stage is mandatory for this setup?
It supplies the user-space tools and kernel modules needed to unlock the LUKS container and activate the LVM so the kernel can mount the real root filesystem.
It contains the systemd unit files that start normal services after the kernel boots into the real root filesystem.
It provides firmware code that lets the BIOS or UEFI locate and launch the bootloader on the disk.
It allows GRUB2 to read /etc/default/grub from the encrypted disk and rebuild the boot menu on every startup.
Answer Description
The kernel itself cannot access an encrypted, LVM-based root filesystem without first loading extra drivers and user-space helpers. Those drivers (dm-crypt, LVM, the storage controller) and the utilities that unlock the LUKS container and activate the volume group are packaged inside the initramfs. When the kernel finishes its own hardware initialization, it runs the /init script from the initramfs. That script loads the required modules, starts cryptsetup to decrypt the volume, runs vgchange to make the logical volumes available, mounts the real root filesystem, and then hands control to the regular init system. If the initramfs were missing or incomplete, the kernel would have no way to reach the encrypted root device and the boot would fail. The other options describe tasks handled by GRUB, systemd, or the system firmware, none of which solve the problem of accessing an encrypted LVM root early in boot.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why does the initramfs include user-space tools for unlocking LUKS-encrypted volumes?
What role does the initramfs play in activating LVM volumes?
What would happen if the initramfs were incomplete or missing in this setup?
A system administrator is analyzing disk usage on a Linux server and observes that the /usr directory consumes a significant amount of space. According to the Filesystem Hierarchy Standard (FHS), what is the primary purpose of this directory?
It contains the personal directories for all non-root users on the system.
It contains host-specific system configuration files and various shell scripts.
It contains sharable, read-only data, including the majority of user utilities and applications.
It contains variable data files, such as system logs, mail spools, and printer queues.
Answer Description
The correct answer is that /usr contains sharable, read-only data, including user programs and applications. According to the Filesystem Hierarchy Standard (FHS), /usr is designated for installed software, libraries, and documentation that is not required for the initial boot process and can be shared across multiple machines. /etc is the correct location for host-specific system configuration files. /var is designated for variable data files, such as logs, caches, and spool files, which are expected to change in size during normal system operation. /home is the standard directory for storing users' personal files and data.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why is the `/usr` directory considered 'read-only' according to the FHS?
What are some examples of files or directories found inside `/usr`?
How is `/usr` different from `/bin` or `/sbin`?
You are hardening a Linux server that sometimes remounts its root filesystem read-only during maintenance. A health-check script must confirm at runtime that /tmp is really mounted with the noexec flag, even if /etc/mtab is unavailable or out of date. Which single file should the script read to obtain an authoritative, up-to-date list of all mounts and their current options?
/run/mount/utab
/etc/fstab
/proc/partitions
/proc/mounts
Answer Description
The kernel maintains the definitive mount table and exposes it through the pseudo-file /proc/mounts (a symbolic link to /proc/self/mounts on modern kernels). Because the contents are generated on demand by the kernel, the file always shows the mounts that are visible in the calling process's mount namespace, regardless of whether /etc/mtab exists, is stale, or is a symlink. Reading /etc/fstab only shows administrator-configured entries, /proc/partitions lists block devices but not current mount options, and /run/mount/utab is a private runtime database used by libmount (util-linux) to track user-mount metadata-it is not maintained by the kernel and can be missing or stale. Therefore, parsing /proc/mounts is the most reliable way to verify that /tmp-or any filesystem-is currently mounted with the desired flags.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the difference between /proc/mounts and /etc/fstab?
What is the purpose of the noexec flag in mount options?
Why is /proc/mounts considered more reliable than /run/mount/utab?
A security scan reveals that the /tmp directory on a multi-user Linux server has permissions drwxrwxrwx (0777). To bring the directory back into compliance with the Filesystem Hierarchy Standard (FHS) and ensure that ordinary users cannot delete files they do not own, which chmod command should the administrator run?
chmod 0777 /tmp
chmod 2777 /tmp
chmod 1777 /tmp
chmod 755 /tmp
Answer Description
The /tmp directory is intended for temporary files that do not need to survive a reboot. It should be world-writable so every process can create temporary files, but it must also have the sticky bit set so that only the file owner (or root) can rename or delete each file. Setting the sticky bit is done by placing a leading "1" in the numeric mode, making the correct permission 1777 (displayed as drwxrwxrwt). Using 0777 leaves the directory world-writable without any protection; 2777 sets the SGID bit, which affects group ownership rather than deletion protection; 0755 removes write permission for non-owners, breaking many applications that rely on /tmp.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the sticky bit, and why is it important?
What does the Filesystem Hierarchy Standard (FHS) specify for /tmp?
What is the difference between chmod 1777 and chmod 2777?
A system administrator needs to permanently add the nomodeset kernel parameter to the GRUB 2 boot-loader configuration. Which of the following methods should the administrator use to ensure the change persists after a kernel update?
Add the line
kernel.nomodeset=1to the/etc/sysctl.conffile and runsysctl -p.Directly edit the
/boot/grub/grub.cfgfile and add the parameter to thelinuxline.Edit the
GRUB_CMDLINE_LINUX_DEFAULTline in/etc/default/gruband then runupdate-grub.Append
nomodesetto the end of the/proc/cmdlinefile.
Answer Description
The persistent way to add a kernel parameter in GRUB 2 is to edit /etc/default/grub and then regenerate the main configuration. Add nomodeset to the GRUB_CMDLINE_LINUX or GRUB_CMDLINE_LINUX_DEFAULT variable in /etc/default/grub, save the file, and run the appropriate command to rebuild the menu: update-grub on Debian/Ubuntu systems or grub2-mkconfig -o /boot/grub2/grub.cfg on RHEL-derived systems (UEFI systems use the /boot/efi/EFI/<distro>/grub.cfg stub). Editing /boot/grub2/grub.cfg (or /boot/grub/grub.cfg) directly is incorrect because those files are auto-generated and will be overwritten the next time the rebuild command runs-such as during a kernel update. /proc/cmdline only reflects the parameters of the currently running kernel, and /etc/sysctl.conf controls runtime kernel tunables, not boot-loader parameters.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the `nomodeset` kernel parameter?
Why is editing `/etc/default/grub` preferred over directly editing `/boot/grub/grub.cfg`?
What are the commands `update-grub` and `grub2-mkconfig`, and how do they differ?
During an overnight maintenance window you plan to shrink the ext4 file system located on /dev/mapper/vgdata-lvarchive. Before reducing the size of the underlying logical volume, you need to know exactly how many file-system blocks the volume can be reduced to so that you do not make it smaller than the data it contains. The file system is currently unmounted, and you want a command that only reports this minimum size without modifying anything. Which single command satisfies this requirement?
resize2fs -M /dev/mapper/vgdata-lvarchive
resize2fs -f /dev/mapper/vgdata-lvarchive
e2fsck -f /dev/mapper/vgdata-lvarchive
resize2fs -P /dev/mapper/vgdata-lvarchive
Answer Description
resize2fs with the -P (print minimum) option calculates and displays the minimum number of blocks required for the current contents and then exits without altering the file system. Using -M would immediately shrink the file system to that minimum, -f merely forces a resize operation if one is attempted, and e2fsck only checks or repairs consistency-it does not report the minimum shrinkable size. Therefore the correct choice is the command that uses -P.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the -P option in resize2fs do?
How does resize2fs differ from e2fsck?
Can you explain the difference between -P and -M options in resize2fs?
During a compliance audit on an x86_64 server running a 6.x Linux kernel, you list the contents of /boot and see the following files:
/boot/initramfs-6.7.9-amd64.img
/boot/vmlinuz-6.7.9-amd64
/boot/System.map-6.7.9-amd64
/boot/grub/grub.cfg
The auditors ask you to justify the presence of the initramfs-6.7.9-amd64.img file. Which statement accurately describes the purpose of this file in the Linux boot process?
It is a sector map generated by LILO that tells the bootloader where kernel sectors are located on disk.
It provides a minimal root filesystem loaded into RAM so the kernel can load drivers and scripts required to mount the real root filesystem before normal boot continues.
It is the main GRUB2 configuration file that lists available boot entries and kernel parameters.
It is a compressed copy of the kernel that the firmware expands before handing control to the bootloader.
Answer Description
The initramfs (or initrd) image is a compressed archive that the bootloader loads into memory together with the kernel. The kernel unpacks it to create a temporary root filesystem that contains the drivers, modules, and early-boot scripts required to locate and mount the real root filesystem-whether it resides on LVM, RAID, encrypted storage, or over the network. Once the real root is mounted, control passes to the normal init system and the initramfs is discarded from RAM. It is therefore not a GRUB configuration file (that is grub.cfg), a compressed kernel image (that is vmlinuz), or a sector-map file generated by LILO (that is /boot/map).
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the difference between initramfs and initrd?
Why does Linux need a temporary root filesystem during boot?
What happens to the initramfs after the real root filesystem is mounted?
During a new Linux deployment you create a separate logical volume for user data so the operating system can be re-installed without touching personal files. According to the Filesystem Hierarchy Standard (FHS), to which top-level directory should you mount this volume so that each user's dotfiles and other personal data are found automatically by shells, desktop environments, and standard tools without any extra configuration?
/opt
/usr/local
/srv
/home
Answer Description
The FHS designates /home as the default location for regular users' home directories. Placing a dedicated filesystem at /home lets every non-root account store its personal files and hidden configuration files in a predictable path such as /home/alice or /home/bob. The other paths serve different purposes: /usr/local is reserved for locally installed software that should survive distribution upgrades, /opt is intended for add-on application packages, and /srv holds data offered by network services such as web or FTP servers. Mounting the user volume at any of those locations would break established conventions and could confuse system tools or administrators; therefore /home is the correct choice.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why is /home the correct choice for user data according to FHS?
What is the purpose of /usr/local in Linux?
How is /srv different from /home in Linux?
A Linux system administrator needs to modify the system-wide configuration for network services on a server. According to the Filesystem Hierarchy Standard (FHS), in which directory should the administrator primarily look for these configuration files?
/boot
/home
/etc
/var
Answer Description
The correct answer is /etc. The Filesystem Hierarchy Standard (FHS) specifies that the /etc directory is for host-specific, system-wide configuration files and directories. It should not contain any binaries. The /var directory is for variable data files, such as logs, spool files, and caches, which change during normal system operation. The /home directory is the default location for user-specific files and configurations, not system-wide ones. The /boot directory contains the static files required for the system's boot process, such as the kernel and bootloader files, not general service configurations.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the Filesystem Hierarchy Standard (FHS)?
Why is the `/etc` directory important in Linux systems?
How does `/var` differ from `/etc` in terms of functionality?
Wow!
Looks like that's it! You can go back and review your answers or click the button below to grade your test.