General CompTIA Linux+ Questions (Extended) Flashcards
This is an extension of the other set of flashcards for the CompTIA Linux+ exam. (99 cards)
What is lvmdiskscan intended to do and what is its modern equivalent? (Online)
The lvmdiskscan command scans for and displays disks which can be used for LVM physical volumes. The “pvs” is the modern equivalent and shows the same data.
What are three commands to display logical volumes on a system? (Pg. 227 and Online)
LVM Commands:
lvs – This shows all logical volumes and is a highly customizable command.
lvdisplay – This displays logical properties like size and mapping.
lvscan – This scans the system and lists the logical volumes.
What does the killall command do? (Online)
killall <process_name> -- This kills all of the processes for a user which matches the input stated.</process_name>
How do you automatically fix filesystem errors with the fsck command? (Online)
Example: fsck -y /dev/sdb – This checks /dev/sdb for filesystem errors and automatically fixes them. (“-y” = says “yes” to all fixes)
How do you do a test run with the fsck command? (Online)
Example: fsck -N /dev/sdb – This does a test run on the specified /dev/sdb disk without performing any actions.
How do you display errors without performing any actions with the fsck command? (Online)
Example: fsck -n /dev/sdb – This displays any corruption errors with the /dev/sdb disk but does perform any action on it.
How do you perform a filesystem check on all filesystems with the fsck command? (Online)
fsck -AR – This performs a filesystem check on all (“-A”) filesystems, except root (“-R”) as the root filesystem (“/”) cannot be unmounted on a running system.
What are the default options specified by the /etc/fstab option “defaults?” (Online)
Default Options:
- rw – Allow reading and writing.
- suid – Enable security bits.
- dev – Enable files (under /dev) that represent access points to devices.
- exec – Enables binaries and files to be able to be executed on that partition.
- auto – Automatically mounts partition at boot.
- nouser – Only root can mount the partition.
- async – Allows asynchronous I/O; multiple threads instead of single-threading.
How do you enable user and group quotas on a partition? (Online)
The options “usrquota” and “grpquota” can be input in the options field of /etc/fstab to enable user and group quotas, respectively, on the disk.
What does the vmstat command mean? (Pg. 612 and Online)
“vmstat” = “Virtual Memory STATistics”
What display all active and inactive memory running with the vmstat command? (Online)
vmstat -a – This displays totals of all (“-a”) active and instance memory of the system running.
How do you display all memory event counters with the vmstat command? (Online)
vmstat -s – This displays a summary of all event counters and memory statistics like the number of forks and pages paged in and out.
How do you display all RAM disk statistics with the vmstat command? (Online)
vmstat -d – This displays all RAM disk (“-d”) statistics such as numbers of reads and writes per disk.
How do print the available commands in fdisk and in gdisk, respectively? (Pgs. 190, 194)
m for fdisk and ? for gdisk – The “m” or “?” in fdisk and gdisk, respectively, prints the help menu, displaying available commands.
How can you display the partition table in fdisk/gdisk? (Pgs. 190, 194)
p – This displays the partition (“p”) table.
Which commands do you need to create a new partition and have the changes take effect in fdisk/gdisk? (Pgs. 190-192, 194)
n then w – The “n” specifies a new partition to be made. Then after going through the options, the “w” will write the partition to the disk.
How do you display the available partition types in fdisk/gdisk? (Pgs. 190, 194)
l – This lists (“l”) out the available filesystem types for fdisk/gdisk.
How do you back up GPT data to a file with the gdisk utility? (Pg. 194)
b – This backs up GUID Partition Table data to a file.
How can you rename a partition in the gdisk utility? (Pg. 194)
c – This changes (“c”) the name of the specified partition.
How do you test if a regular file exists with the if bash statement? (Online)
Example: if [ -f file1 ] – This tests whether the regular file “file1” exists.
How do you test if any file or directory exists with the if bash statement? (Online)
Example: if [ -e /dev/sdb2 ] – This tests whether the file “/dev/sdb2” exists. The “-e” option can be used to test existence for any file type or directory.
How do you test if a file is readable with the if bash statement? (Online)
Example: if [ -r file1 ] – This tests whether the file “file1” is readable by the current user.
What is the xfs_growfs command used to do? (Online and Online)
Example: xfs_growfs -D <size> <mount_point> -- This grows a specified XFS filesystem to the specified size. (xfs_growfs “-d” <mount_point> will specify maximum size for the disk.)</mount_point></mount_point></size>
What is the functional equivalent xfs_growfs command of xfs_info? (Online)
xfs_growfs -n – This prints geometry information like inodes and block size like the xfs_info command.