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?
getenforce
restorecon
setfacl
getsebool
3 Which SELinux mode logs policy violations but does not block them?
4 Which command temporarily changes SELinux to permissive mode?
setenforce 1
sestatus 1
getenforce 0
setenforce 0
5 Which file is commonly edited to make an SELinux mode change persistent?
/etc/passwd
/etc/fstab
/etc/hosts
/etc/selinux/config
6 Which command option displays SELinux contexts when listing files?
ls -R
ls -Z
ls -S
ls -X
7 Which command restores the default SELinux context of a file?
restorecon
setenforce
sealert
getsebool
8 Which command is used to define a persistent SELinux file-context rule?
semanage login
semanage boolean
semanage fcontext
semanage port
9 What do SELinux booleans provide?
10 Which command makes an SELinux boolean change persistent?
restorecon -P
getsebool -P
setsebool -L
setsebool -P
11 Which log file commonly contains SELinux access-denial messages?
/var/log/wtmp
/var/log/audit/audit.log
/var/log/boot.log
/var/log/dnf.log
12 Which command can search the audit log for recent SELinux AVC messages?
lsblk -m AVC
restorecon -m AVC
ausearch -m AVC
journalctl -m AVC
13 Which command lists block devices such as disks and partitions?
lsmod
lsblk
lscpu
lsattr
14 Which command creates an XFS file system on a partition?
fdisk.xfs
fsck.xfs
mount.xfs
mkfs.xfs
15 Which file defines file systems that should be mounted persistently?
/etc/fstab
/etc/mtab
/etc/shells
/etc/group
16 Which command activates a prepared swap device?
free
mkswap
swapoff
swapon
17 Which command creates a new LVM logical volume?
pvcreate
vgcreate
lvcreate
mkfs
18 Which command extends an existing LVM logical volume?
lvdisplay
lvremove
lvextend
lvcreate
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?
selinuxenabled
restorecon
getsebool
getenforce
23 An administrator needs to troubleshoot an SELinux denial without enforcing policy decisions until the next reboot. Which command should be used?
sestatus --disable
setenforce 0
getenforce 0
setenforce 1
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?
SELINUXTYPE=permissive
SELINUX=permissive
SETENFORCE=0
SELINUX=disabled
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?
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
restorecon -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?
restorecon -Rv /data/app
chcon --reference /data/app
semanage boolean -m /data/app
setfiles -n /data/app
27
An administrator uses chcon to change a file's SELinux type. Why might the change disappear after running restorecon?
chcon applies labels only while a process runs
restorecon always removes all custom SELinux types
chcon does not update persistent context mappings
restorecon recreates files from policy packages
28 A web application must connect to a remote database, and SELinux is blocking the connection. Which command enables the relevant boolean persistently?
setsebool -P httpd_can_network_connect_db on
semanage fcontext -a httpd_can_network_connect_db
restorecon -R httpd_can_network_connect_db
setsebool httpd_can_network_connect_db off
29 Which command lists SELinux booleans and includes a brief description of what each boolean controls?
getsebool -a
semanage boolean -l
semodule -l
sestatus -b
30 A service works in permissive mode but fails in enforcing mode. Which command is most appropriate for finding recent SELinux AVC denial records?
ausearch -m AVC -ts recent
journalctl -p AVC -ts recent
restorecon -m AVC /var/log
semanage -m AVC -l 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
lsblk -f
pvs -o+uuid
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
/dev/disk
/dev/sdb1
UUID=<filesystem-uuid>
34
After adding an entry to /etc/fstab, which command tests the entry by attempting to mount filesystems that are not already mounted?
mount -o remount
systemctl reload mount
mount -a
findmnt --verify-only
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
mkswap /dev/sdc2 followed by swapon /dev/sdc2
pvcreate /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
lvextend -L 20G -n lvbackup vgdata
vgcreate -L 20G -n lvbackup vgdata
lvcreate -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?
vgextend -r -L +5G /dev/vgdata/lvapp
lvextend -L 5G /dev/vgdata/lvapp
lvextend -r -L +5G /dev/vgdata/lvapp
xfs_growfs -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?
stratis pool create pool1 projects
mkfs.stratis pool1 projects
lvcreate -n projects pool1
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?
semanage permissive -a service_name
/etc/selinux/config and reboot immediately
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
semanage boolean -a -t httpd_sys_content_t '/srv/site(/.*)?'; then setsebool -P httpd_sys_content_t
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
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 is persistent, but the application changed the label during startup
chcon changed the current label but did not create a persistent policy rule
chcon changes labels only for filesystems mounted read-only
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?
audit2allow -M httpd_can_network_connect_db
setsebool -P httpd_can_network_connect_db on
setsebool httpd_can_network_connect_db off
semanage fcontext -a -t httpd_can_network_connect_db /etc
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?
ausearch, review context with ls -Z, then validate labels and policy
unconfined_u:object_r:default_t:s0 and retry
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
mkfs on the whole disk, add /dev/sdb directly to fstab, and reboot
/dev/sdb1 to fstab before partitioning and let mount -a create the partition
swapon, and mount the swap signature as data
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?
blkid
sync to the options so device names remain stable
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
findmnt --verify and then test the specific entry with mount /archive
mkfs before testing the configuration
52 A system needs a temporary 4 GiB swap area backed by a regular file. Which sequence provides the correct initialization and activation?
swapfile, run mkswap on the directory, then enable it
swapon on an empty file, then use mkswap after activation
mkswap, then run swapon
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.swap /dev/vgdata/logs
pvcreate -L 8G -n logs vgdata; then lvformat /dev/vgdata/logs
vgcreate -L 8G logs vgdata; then mkfs.xfs /dev/logs/vgdata
lvcreate -L 8G -n logs vgdata; then mkfs.xfs /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
lvextend -L +5G /dev/vgdata/logs, then xfs_growfs on its mount point
xfs_growfs first, then reduce the LV to match the new filesystem size
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 →