Unit 5: SELinux and Advanced Storage Management - Practice Quiz
1 What is the main purpose of SELinux?
2 Which command displays the current SELinux operating mode?
restorecon
setfacl
getsebool
getenforce
3 Which SELinux mode logs policy violations but does not block them?
4 Which command temporarily changes SELinux to permissive mode?
setenforce 1
getenforce 0
setenforce 0
sestatus 1
5 Which file is commonly edited to make an SELinux mode change persistent?
/etc/hosts
/etc/fstab
/etc/selinux/config
/etc/passwd
6 Which command option displays SELinux contexts when listing files?
ls -Z
ls -R
ls -X
ls -S
7 Which command restores the default SELinux context of a file?
sealert
restorecon
getsebool
setenforce
8 Which command is used to define a persistent SELinux file-context rule?
semanage boolean
semanage fcontext
semanage port
semanage login
9 What do SELinux booleans provide?
10 Which command makes an SELinux boolean change persistent?
getsebool -P
restorecon -P
setsebool -L
setsebool -P
11 Which log file commonly contains SELinux access-denial messages?
/var/log/dnf.log
/var/log/boot.log
/var/log/wtmp
/var/log/audit/audit.log
12 Which command can search the audit log for recent SELinux AVC messages?
restorecon -m AVC
lsblk -m AVC
ausearch -m AVC
journalctl -m AVC
13 Which command lists block devices such as disks and partitions?
lsattr
lsmod
lscpu
lsblk
14 Which command creates an XFS file system on a partition?
fsck.xfs
mkfs.xfs
mount.xfs
fdisk.xfs
15 Which file defines file systems that should be mounted persistently?
/etc/shells
/etc/mtab
/etc/fstab
/etc/group
16 Which command activates a prepared swap device?
mkswap
free
swapoff
swapon
17 Which command creates a new LVM logical volume?
vgcreate
pvcreate
mkfs
lvcreate
18 Which command extends an existing LVM logical volume?
lvdisplay
lvextend
lvcreate
lvremove
19 In Stratis, what is created from one or more block devices?
20 What is the primary benefit of VDO deduplication?
21
A web server process is running in the httpd_t domain. Which SELinux mechanism primarily determines whether it may read a file labeled user_home_t?
22
Which command displays the current SELinux mode as a single value such as Enforcing, Permissive, or Disabled?
getsebool
restorecon
selinuxenabled
getenforce
23 An administrator needs to troubleshoot an SELinux denial without enforcing policy decisions until the next reboot. Which command should be used?
setenforce 1
getenforce 0
setenforce 0
sestatus --disable
24
SELinux must start in permissive mode after every reboot while continuing to label files and log denials. Which setting should be placed in /etc/selinux/config?
SETENFORCE=0
SELINUX=disabled
SELINUX=permissive
SELINUXTYPE=permissive
25
Web content stored under /srv/site must retain the httpd_sys_content_t type after a full filesystem relabel. Which command defines the persistent mapping?
restorecon -R -t httpd_sys_content_t /srv/site
setsebool -P httpd_sys_content_t on
semanage fcontext -a -t httpd_sys_content_t '/srv/site(/.*)?'
chcon -R -t httpd_sys_content_t /srv/site
26
After defining a persistent context rule for /data/app, which command applies the expected SELinux labels recursively to the existing files?
chcon --reference /data/app
semanage boolean -m /data/app
setfiles -n /data/app
restorecon -Rv /data/app
27
An administrator uses chcon to change a file's SELinux type. Why might the change disappear after running restorecon?
restorecon recreates files from policy packages
chcon does not update persistent context mappings
chcon applies labels only while a process runs
restorecon always removes all custom SELinux types
28 A web application must connect to a remote database, and SELinux is blocking the connection. Which command enables the relevant boolean persistently?
restorecon -R httpd_can_network_connect_db
setsebool -P httpd_can_network_connect_db on
setsebool httpd_can_network_connect_db off
semanage fcontext -a httpd_can_network_connect_db
29 Which command lists SELinux booleans and includes a brief description of what each boolean controls?
sestatus -b
getsebool -a
semodule -l
semanage boolean -l
30 A service works in permissive mode but fails in enforcing mode. Which command is most appropriate for finding recent SELinux AVC denial records?
restorecon -m AVC /var/log
ausearch -m AVC -ts recent
semanage -m AVC -l recent
journalctl -p AVC -ts recent
31
An AVC denial shows that Apache is trying to read a web file labeled default_t. What is the most appropriate first corrective action?
default_t
32 Before repartitioning a newly attached disk, an administrator wants to view block devices, filesystem types, UUIDs, and mount points. Which command provides this information?
du -sh
df -hT
pvs -o+uuid
lsblk -f
33
A new XFS filesystem on /dev/sdb1 must mount reliably at /archive even if device names change. Which /etc/fstab source is most appropriate?
LABEL=/dev/sdb1
UUID=<filesystem-uuid>
/dev/disk
/dev/sdb1
34
After adding an entry to /etc/fstab, which command tests the entry by attempting to mount filesystems that are not already mounted?
findmnt --verify-only
systemctl reload mount
mount -a
mount -o remount
35
A new partition /dev/sdc2 has been created for swap. Which command sequence prepares and activates it immediately?
swapon /dev/sdc2 followed by mkswap /dev/sdc2
mkfs.xfs /dev/sdc2 followed by swapon /dev/sdc2
pvcreate /dev/sdc2 followed by swapon /dev/sdc2
mkswap /dev/sdc2 followed by swapon /dev/sdc2
36
A volume group named vgdata has enough free extents. Which command creates a 20 GiB logical volume named lvbackup?
pvcreate -L 20G -n lvbackup vgdata
vgcreate -L 20G -n lvbackup vgdata
lvcreate -L 20G -n lvbackup vgdata
lvextend -L 20G -n lvbackup vgdata
37
An XFS filesystem mounted from /dev/vgdata/lvapp needs 5 GiB of additional space. Which command extends both the logical volume and its filesystem?
lvextend -L 5G /dev/vgdata/lvapp
lvextend -r -L +5G /dev/vgdata/lvapp
xfs_growfs -L +5G /dev/vgdata/lvapp
vgextend -r -L +5G /dev/vgdata/lvapp
38 A test environment requires many logical volumes whose advertised sizes may exceed the storage currently allocated to their pool. Which LVM feature best fits this requirement?
39
A Stratis pool named pool1 already exists. Which command creates a Stratis filesystem named projects in that pool?
lvcreate -n projects pool1
stratis pool create pool1 projects
mkfs.stratis pool1 projects
stratis filesystem create pool1 projects
40 A VDO volume stores many identical virtual-machine disk images. Which VDO behavior primarily reduces the space consumed by repeated identical blocks?
41 A service fails because SELinux denies an operation. An administrator wants to test whether SELinux causes the failure without changing the policy permanently. Which action is most appropriate?
/etc/selinux/config and reboot immediately
semanage permissive -a service_name
setenforce 0, test the service, then run setenforce 1
42 A system is configured with SELinux in enforcing mode, but a newly installed application cannot access a resource despite UNIX permissions allowing access. Which statement best explains the result?
43
Web content is moved from /var/www/html to /srv/site. The web server can read the files only after their SELinux labels are corrected. Which command makes the labeling rule persistent and which command applies it immediately?
semanage fcontext -a -t httpd_sys_content_t '/srv/site(/.*)?'; then restorecon -Rv /srv/site
restorecon -t httpd_sys_content_t /srv/site; then chcon -R /srv/site
chcon -t httpd_sys_content_t /srv/site; then semanage fcontext -l
semanage boolean -a -t httpd_sys_content_t '/srv/site(/.*)?'; then setsebool -P httpd_sys_content_t
44
An administrator used chcon to label /data/app as var_t, and the application worked until a filesystem relabel was performed. What is the most accurate diagnosis?
chcon changes labels only for filesystems mounted read-only
chcon changed the current label but did not create a persistent policy rule
chcon is persistent, but the application changed the label during startup
45 A web server must connect to a database on another host. SELinux denies the connection, and the administrator wants the supported policy-controlled solution to persist across reboots. Which command is appropriate?
semanage fcontext -a -t httpd_can_network_connect_db /etc
setsebool -P httpd_can_network_connect_db on
setsebool httpd_can_network_connect_db off
audit2allow -M httpd_can_network_connect_db
46
A Boolean appears enabled with getsebool, but its value returns to disabled after every reboot. Which conclusion is correct?
-P option
47
After confirming that UNIX permissions are correct, an application still receives Permission denied. Which investigation sequence is most reliable for an SELinux-related failure?
unconfined_u:object_r:default_t:s0 and retry
ausearch, review context with ls -Z, then validate labels and policy
48
A generated audit2allow module would permit an unusual process to read a sensitive file. What should the administrator do before installing it?
chcon on the process binary without reviewing the denied operation
49
A new disk is visible as /dev/sdb, but no partition or filesystem exists. Which sequence correctly prepares it for a persistent data mount using a GPT partition?
fstab, and mount it
swapon, and mount the swap signature as data
/dev/sdb1 to fstab before partitioning and let mount -a create the partition
mkfs on the whole disk, add /dev/sdb directly to fstab, and reboot
50
An /etc/fstab entry for an XFS filesystem uses /dev/sdc1, but the device name changes after hardware discovery order changes. Which correction is best?
sync to the options so device names remain stable
blkid
51
A filesystem is mounted at /archive, but mount -a reports an error after an fstab change. Which validation approach minimizes the risk of disrupting existing mounts?
mount -a -F to force all entries to mount concurrently
mkfs before testing the configuration
findmnt --verify and then test the specific entry with mount /archive
52 A system needs a temporary 4 GiB swap area backed by a regular file. Which sequence provides the correct initialization and activation?
mkswap, then run swapon
swapfile, run mkswap on the directory, then enable it
swapon on an empty file, then use mkswap after activation
mkfs.xfs, then mount it at /swap
53
A swap partition is active, but the administrator wants it enabled automatically after reboot. Which fstab entry is correct when the partition UUID is 1111-2222?
54
A volume group has 12 GiB of free extents. An administrator needs a new 8 GiB logical volume named logs and an XFS filesystem on it. Which command sequence is valid?
lvcreate -L 8G -n logs vgdata; then mkfs.xfs /dev/vgdata/logs
lvcreate -l 8G -n logs vgdata; then mkfs.swap /dev/vgdata/logs
vgcreate -L 8G logs vgdata; then mkfs.xfs /dev/logs/vgdata
pvcreate -L 8G -n logs vgdata; then lvformat /dev/vgdata/logs
55
An XFS filesystem on /dev/vgdata/logs must grow by 5 GiB while mounted. Which operation is required after extending the LV?
resize2fs because XFS cannot grow online
lvreduce -L +5G /dev/vgdata/logs, then resize2fs on the mount point
xfs_growfs first, then reduce the LV to match the new filesystem size
lvextend -L +5G /dev/vgdata/logs, then xfs_growfs on its mount point
56
A logical volume has been extended successfully, but df -h still shows the old filesystem size. What is the most likely missing step?
57 A database requires redundancy across two physical disks, while an unrelated workload requires maximum usable capacity with no redundancy. Which LVM layout assignments best match those requirements?
58 A Stratis pool contains a filesystem mounted persistently by its filesystem UUID. One underlying disk fails, but the pool was created without redundancy. What should be expected?
59 An administrator creates a Stratis filesystem and notices that its reported virtual size can exceed currently allocated physical space. Which Stratis feature explains this behavior?
60 A VDO volume reports a logical size of 1 TiB but is backed by only 400 GiB of physical storage. Which statement best describes the configuration?
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →