CompTIA Linux+ XK0-006 Practice Test Questions and Exam Dumps Part 7: Q121–Q140

View Full CompTIA XK0-006 Exam Dumps and Practice Test Dumps.

 

Question 121

Which command is commonly used to create a new RAID array using Linux software RAID?

  1. mdadm
  2. raidctl
  3. mkraidfs
  4. diskadm

Correct Answer: 1

Explanation

The mdadm command is used to create, manage, monitor, and maintain Linux software RAID arrays. RAID can combine multiple disks to provide improved redundancy, performance, or both, depending on the RAID level. For example, RAID 1 mirrors data between disks, while RAID 5 uses distributed parity. Before creating an array, administrators should carefully verify the selected devices because RAID creation can destroy existing data. mdadm is an important tool for Linux storage administration and troubleshooting.

Question 122

Which RAID level provides disk mirroring by writing the same data to two drives?

  1. RAID 0
  2. RAID 5
  3. RAID 1
  4. RAID 6

Correct Answer: 3

Explanation

RAID 1 provides disk mirroring by maintaining an identical copy of data on two or more disks. If one disk fails, the mirrored copy can continue providing access to the data, depending on the system configuration. RAID 1 improves redundancy but does not provide the same capacity efficiency as some parity-based RAID levels. RAID 0 focuses on striping without redundancy, while RAID 5 and RAID 6 use parity. Administrators should select RAID based on availability, performance, and capacity requirements.

Question 123

Which command can be used to display detailed information about an LVM volume group?

  1. vgdisplay
  2. lvremove
  3. pvcreate
  4. mkvg

Correct Answer: 1

Explanation

The vgdisplay command shows detailed information about an LVM volume group. The output can include the volume group name, size, physical extent information, allocated space, and free space. This is useful when determining whether a volume group has enough unused capacity for a new logical volume or for extending an existing one. Other LVM commands have different purposes. For example, pvcreate prepares a physical volume, while lvremove removes a logical volume.

Question 124

Which command displays detailed information about an LVM logical volume?

  1. lvdisplay
  2. vgremove
  3. pvscan
  4. mkfs

Correct Answer: 1

Explanation

The lvdisplay command provides detailed information about logical volumes managed by LVM. It can show the logical volume path, volume group, size, status, and other properties. This information is useful when troubleshooting storage or preparing to resize a logical volume. Administrators can use it together with commands such as vgs, pvs, and lvs to understand the overall LVM layout. Checking the correct logical volume before changing its size helps prevent accidental changes to the wrong storage device.

Question 125

Which command is commonly used to show concise information about LVM physical volumes?

  1. pvs
  2. lvs
  3. vgs
  4. pvremove

Correct Answer: 1

Explanation

The pvs command provides a concise summary of LVM physical volumes. It can show information such as the physical volume name, volume group, and available or allocated space. This is useful when quickly checking how disks or partitions are being used by LVM. The related vgs command summarizes volume groups, while lvs summarizes logical volumes. These short-form commands are useful for administrators because they provide an overview without producing the larger amount of detail shown by commands such as pvdisplay.

Question 126

Which filesystem is commonly associated with the xfs_growfs command for increasing filesystem size?

  1. ext2
  2. XFS
  3. FAT32
  4. swap

Correct Answer: 2

Explanation

The xfs_growfs command is used to increase the size of an XFS filesystem. When an underlying logical volume or partition is expanded, the filesystem may also need to be expanded so it can use the additional space. XFS supports online filesystem growth, which means it can normally be expanded while mounted. The exact procedure depends on the storage layer and filesystem. Administrators should always confirm the filesystem type before selecting a resize command.

Question 127

Which file is commonly used to define filesystems that should be mounted automatically during boot?

  1. /etc/hosts
  2. /etc/passwd
  3. /etc/fstab
  4. /etc/profile

Correct Answer: 3

Explanation

The /etc/fstab file contains persistent filesystem mount information. Each entry can specify the device or UUID, mount point, filesystem type, mount options, and other settings. During boot, Linux can use this information to mount configured filesystems automatically. Administrators should be careful when editing /etc/fstab because an incorrect entry can cause boot delays or failures. UUIDs are often preferred because device names such as /dev/sdb1 can change depending on hardware detection order.

Question 128

Which command can display filesystem UUIDs and filesystem types for storage devices?

  1. blkid
  2. lsmod
  3. lspci
  4. sysctl

Correct Answer: 1

Explanation

The blkid command displays information about block devices, including filesystem type and UUID when available. UUIDs are useful in /etc/fstab because they provide a stable identifier for a filesystem even if Linux assigns a different device name after a reboot. For example, /dev/sdb1 could potentially become another device name, while its filesystem UUID remains associated with that filesystem. Administrators often use blkid when configuring persistent mounts or troubleshooting storage identification problems.

Question 129

Which command is commonly used to check the current status of NetworkManager?

  1. systemctl status NetworkManager
  2. networkctl remove NetworkManager
  3. nmcli delete NetworkManager
  4. service-net NetworkManager

Correct Answer: 1

Explanation

systemctl status NetworkManager checks whether the NetworkManager service is running and provides recent status information. NetworkManager manages network interfaces and connection profiles on many modern Linux distributions. If networking suddenly stops working, checking the service status can help determine whether the network management service is active. Administrators can then inspect logs, connection profiles, interfaces, and DNS configuration as needed. The exact service name can vary on some systems, so administrators should verify the installed network management framework.

Question 130

Which command can show the current IP addresses assigned to Linux network interfaces?

  1. ip addr
  2. ip users
  3. route show-dns
  4. netmount

Correct Answer: 1

Explanation

The ip addr command displays network interfaces and their assigned IP addresses. It can show IPv4 and IPv6 addresses, interface states, MAC addresses, and other useful information. This makes it an important command for network troubleshooting. For example, if a server cannot communicate with another system, an administrator can first verify whether the expected interface is up and whether it has the correct address. The ip command is part of the modern Linux networking toolset.

Question 131

Which file can provide local hostname-to-IP address mappings before or alongside DNS resolution, depending on resolver configuration?

  1. /etc/fstab
  2. /etc/hosts
  3. /etc/shadow
  4. /etc/sudoers

Correct Answer: 2

Explanation

The /etc/hosts file contains static hostname-to-IP address mappings. It can be useful for local testing, small environments, or systems that need a specific hostname to resolve without relying on DNS. The order in which Linux checks /etc/hosts and DNS is controlled by the resolver configuration, commonly through /etc/nsswitch.conf. Administrators should ensure entries are accurate because an incorrect hosts entry can cause applications to connect to the wrong address or fail to resolve a hostname correctly.

Question 132

Which protocol is commonly used to securely transfer files over an SSH connection?

  1. FTP
  2. TFTP
  3. SFTP
  4. HTTP

Correct Answer: 3

Explanation

SFTP, or SSH File Transfer Protocol, transfers files securely through an SSH connection. It provides encrypted communication and supports operations such as uploading, downloading, renaming, and deleting files. Unlike traditional FTP, SFTP does not require a separate unencrypted FTP control and data channel. It is commonly used when administrators need secure file transfers between Linux systems. SFTP authentication can use passwords or SSH keys, depending on the server configuration and security policy.

Question 133

Which SSH configuration setting can disable direct remote login for the root account?

  1. PermitRootLogin no
  2. AllowRootAccess yes
  3. RootLogin disable
  4. SSHRoot off

Correct Answer: 1

Explanation

The PermitRootLogin no setting in the SSH server configuration prevents direct SSH login as the root user. Disabling direct root login is a common hardening practice because attackers frequently target privileged accounts. Administrators can instead log in using a normal account and use sudo for authorized administrative tasks. After changing SSH configuration, the administrator should validate the configuration and restart or reload the SSH service as appropriate. SSH access should always be tested carefully before closing the current session.

Question 134

Which security principle requires users and services to receive only the permissions they actually need?

  1. Defense in depth
  2. Least privilege
  3. Open access
  4. Full trust

Correct Answer: 2

Explanation

The principle of least privilege means users, applications, and services should receive only the permissions required to perform their intended tasks. This reduces the potential damage if an account or application is compromised. For example, a web application should not normally run with unrestricted root privileges when a dedicated low-privilege account is sufficient. Least privilege applies to file permissions, sudo rules, service accounts, cloud permissions, and many other areas of Linux security.

Question 135

Which Linux security framework commonly uses labels and policies to control access to files and processes?

  1. SELinux
  2. Bash
  3. GRUB
  4. Cron

Correct Answer: 1

Explanation

SELinux, or Security-Enhanced Linux, provides mandatory access control using security labels and policy rules. It can restrict what processes are allowed to access, even when traditional Linux permissions would otherwise permit the action. SELinux is commonly used on distributions such as Red Hat Enterprise Linux and related systems. When troubleshooting access problems, administrators should check both traditional permissions and SELinux status or denials. Understanding SELinux is important because changing file permissions alone may not resolve an SELinux policy restriction.

Question 136

Which command can be used to check whether SELinux is currently enforcing, permissive, or disabled?

  1. getenforce
  2. selinux-status
  3. securityctl
  4. policycheck

Correct Answer: 1

Explanation

The getenforce command reports the current SELinux mode. It normally returns Enforcing, Permissive, or Disabled. In enforcing mode, SELinux policies actively restrict unauthorized actions. In permissive mode, policy violations are logged but generally not blocked. Disabled means SELinux is not active. Checking the current mode is useful when troubleshooting access problems because an application failure may be caused by SELinux policy rather than standard Unix file permissions.

Question 137

Which firewall technology is commonly used as the modern packet filtering framework on Linux systems?

  1. nftables
  2. ext4
  3. systemd
  4. OpenSSH

Correct Answer: 1

Explanation

nftables is a modern Linux packet filtering and firewall framework. It replaces many older iptables-based approaches and provides a unified system for filtering network traffic. Administrators can create rules to allow or block traffic based on addresses, ports, protocols, interfaces, and other properties. Some Linux distributions provide higher-level firewall tools such as firewalld that use nftables underneath. Understanding the underlying firewall framework helps administrators troubleshoot connectivity and security rules more effectively.

Question 138

Which command is commonly used to generate a SHA-256 checksum for a file?

  1. sha256sum
  2. cryptsum
  3. hashfile256
  4. openssl-hashfile

Correct Answer: 1

Explanation

The sha256sum command calculates a SHA-256 cryptographic hash of a file. A checksum can be used to verify that a file has not changed between two points in time or during transfer. If the calculated hash matches a trusted reference value, the file contents are highly likely to be identical. Hashes are commonly used for software downloads, backups, forensic work, and integrity verification. A hash is not the same as encryption because it is designed to be one-way.

Question 139

Which command can be used to inspect the status of a firewall managed by firewalld?

  1. firewall-cmd –state
  2. firewall-status -p
  3. firewalld check
  4. iptables –firewall

Correct Answer: 1

Explanation

The firewall-cmd –state command checks whether the firewalld service is running. Firewalld provides a dynamic firewall management interface and commonly uses nftables as its backend on modern systems. Administrators can use firewall-cmd for many tasks, including checking active zones, services, ports, and firewall configuration. When troubleshooting network access, checking firewall state is important because a running service and correct IP configuration do not guarantee that required network traffic is allowed.

Question 140

A Linux server cannot access the internet, but its network interface has a valid IP address. What should you check next to determine whether the server has a default route?

  1. ip route
  2. lsblk
  3. free -m
  4. lsusb

Correct Answer: 1

Explanation

The ip route command can show whether the server has a default route. A default route tells Linux where to send packets when there is no more specific route for the destination. A system can have a valid IP address and still be unable to reach external networks if its default gateway is missing or incorrect. After checking the route, an administrator can test the gateway, DNS resolution, and external connectivity separately to identify where the network path is failing.