Unit 5: SELinux and Advanced Storage Management - Practice Quiz

CSE493 — Linux System Administration 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the main purpose of SELinux?

Managing SELinux Security Easy
A. To schedule recurring system tasks
B. To manage disk partition tables
C. To configure network addresses
D. To enforce mandatory access control

2 Which command displays the current SELinux operating mode?

Managing SELinux Security Easy
A. restorecon
B. setfacl
C. getsebool
D. getenforce

3 Which SELinux mode logs policy violations but does not block them?

Changing the SELinux Enforcement Mode Easy
A. Targeted
B. Disabled
C. Permissive
D. Enforcing

4 Which command temporarily changes SELinux to permissive mode?

Changing the SELinux Enforcement Mode Easy
A. setenforce 1
B. getenforce 0
C. setenforce 0
D. sestatus 1

5 Which file is commonly edited to make an SELinux mode change persistent?

Changing the SELinux Enforcement Mode Easy
A. /etc/hosts
B. /etc/fstab
C. /etc/selinux/config
D. /etc/passwd

6 Which command option displays SELinux contexts when listing files?

Controlling SELinux File Contexts Easy
A. ls -Z
B. ls -R
C. ls -X
D. ls -S

7 Which command restores the default SELinux context of a file?

Controlling SELinux File Contexts Easy
A. sealert
B. restorecon
C. getsebool
D. setenforce

8 Which command is used to define a persistent SELinux file-context rule?

Controlling SELinux File Contexts Easy
A. semanage boolean
B. semanage fcontext
C. semanage port
D. semanage login

9 What do SELinux booleans provide?

Adjusting SELinux Policy with Booleans Easy
A. Labels for network devices
B. Names for disk partitions
C. Switches for policy behavior
D. Keys for user passwords

10 Which command makes an SELinux boolean change persistent?

Adjusting SELinux Policy with Booleans Easy
A. getsebool -P
B. restorecon -P
C. setsebool -L
D. setsebool -P

11 Which log file commonly contains SELinux access-denial messages?

Investigating and Resolving SELinux Issues Easy
A. /var/log/dnf.log
B. /var/log/boot.log
C. /var/log/wtmp
D. /var/log/audit/audit.log

12 Which command can search the audit log for recent SELinux AVC messages?

Investigating and Resolving SELinux Issues Easy
A. restorecon -m AVC
B. lsblk -m AVC
C. ausearch -m AVC
D. journalctl -m AVC

13 Which command lists block devices such as disks and partitions?

Managing Basic Storage and Logical Volumes Easy
A. lsattr
B. lsmod
C. lscpu
D. lsblk

14 Which command creates an XFS file system on a partition?

Adding Partitions, File Systems, and Persistent Mounts Easy
A. fsck.xfs
B. mkfs.xfs
C. mount.xfs
D. fdisk.xfs

15 Which file defines file systems that should be mounted persistently?

Adding Partitions, File Systems, and Persistent Mounts Easy
A. /etc/shells
B. /etc/mtab
C. /etc/fstab
D. /etc/group

16 Which command activates a prepared swap device?

Managing Swap Space Easy
A. mkswap
B. free
C. swapoff
D. swapon

17 Which command creates a new LVM logical volume?

Creating Logical Volumes Easy
A. vgcreate
B. pvcreate
C. mkfs
D. lvcreate

18 Which command extends an existing LVM logical volume?

Extending Logical Volumes Easy
A. lvdisplay
B. lvextend
C. lvcreate
D. lvremove

19 In Stratis, what is created from one or more block devices?

Managing Layered Storage with Stratis Easy
A. A network bridge
B. A security policy
C. A storage pool
D. A user account

20 What is the primary benefit of VDO deduplication?

Compressing and Deduplicating Storage with VDO Easy
A. It repairs damaged data blocks
B. It removes duplicate data blocks
C. It encrypts all data blocks
D. It relocates all data blocks

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?

Managing SELinux Security Medium
A. The loaded SELinux policy rules
B. The filesystem's mount order
C. The file's traditional group owner
D. The process's systemd unit name

22 Which command displays the current SELinux mode as a single value such as Enforcing, Permissive, or Disabled?

Managing SELinux Security Medium
A. getsebool
B. restorecon
C. selinuxenabled
D. getenforce

23 An administrator needs to troubleshoot an SELinux denial without enforcing policy decisions until the next reboot. Which command should be used?

Changing the SELinux Enforcement Mode Medium
A. setenforce 1
B. getenforce 0
C. setenforce 0
D. 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?

Changing the SELinux Enforcement Mode Medium
A. SETENFORCE=0
B. SELINUX=disabled
C. SELINUX=permissive
D. 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?

Controlling SELinux File Contexts Medium
A. restorecon -R -t httpd_sys_content_t /srv/site
B. setsebool -P httpd_sys_content_t on
C. semanage fcontext -a -t httpd_sys_content_t '/srv/site(/.*)?'
D. 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?

Controlling SELinux File Contexts Medium
A. chcon --reference /data/app
B. semanage boolean -m /data/app
C. setfiles -n /data/app
D. restorecon -Rv /data/app

27 An administrator uses chcon to change a file's SELinux type. Why might the change disappear after running restorecon?

Controlling SELinux File Contexts Medium
A. restorecon recreates files from policy packages
B. chcon does not update persistent context mappings
C. chcon applies labels only while a process runs
D. 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?

Adjusting SELinux Policy with Booleans Medium
A. restorecon -R httpd_can_network_connect_db
B. setsebool -P httpd_can_network_connect_db on
C. setsebool httpd_can_network_connect_db off
D. semanage fcontext -a httpd_can_network_connect_db

29 Which command lists SELinux booleans and includes a brief description of what each boolean controls?

Adjusting SELinux Policy with Booleans Medium
A. sestatus -b
B. getsebool -a
C. semodule -l
D. 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?

Investigating and Resolving SELinux Issues Medium
A. restorecon -m AVC /var/log
B. ausearch -m AVC -ts recent
C. semanage -m AVC -l recent
D. 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?

Investigating and Resolving SELinux Issues Medium
A. Assign the expected web-content context to the file
B. Generate a custom policy allowing access to default_t
C. Run Apache permanently in permissive mode
D. Disable SELinux for the Apache service

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?

Managing Basic Storage and Logical Volumes Medium
A. du -sh
B. df -hT
C. pvs -o+uuid
D. 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?

Adding Partitions, File Systems, and Persistent Mounts Medium
A. LABEL=/dev/sdb1
B. UUID=<filesystem-uuid>
C. /dev/disk
D. /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?

Adding Partitions, File Systems, and Persistent Mounts Medium
A. findmnt --verify-only
B. systemctl reload mount
C. mount -a
D. mount -o remount

35 A new partition /dev/sdc2 has been created for swap. Which command sequence prepares and activates it immediately?

Managing Swap Space Medium
A. swapon /dev/sdc2 followed by mkswap /dev/sdc2
B. mkfs.xfs /dev/sdc2 followed by swapon /dev/sdc2
C. pvcreate /dev/sdc2 followed by swapon /dev/sdc2
D. 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?

Creating Logical Volumes Medium
A. pvcreate -L 20G -n lvbackup vgdata
B. vgcreate -L 20G -n lvbackup vgdata
C. lvcreate -L 20G -n lvbackup vgdata
D. 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?

Extending Logical Volumes Medium
A. lvextend -L 5G /dev/vgdata/lvapp
B. lvextend -r -L +5G /dev/vgdata/lvapp
C. xfs_growfs -L +5G /dev/vgdata/lvapp
D. 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?

Implementing Advanced Storage Features Medium
A. Thin provisioning
B. Physical mirroring
C. Striped allocation
D. Linear allocation

39 A Stratis pool named pool1 already exists. Which command creates a Stratis filesystem named projects in that pool?

Managing Layered Storage with Stratis Medium
A. lvcreate -n projects pool1
B. stratis pool create pool1 projects
C. mkfs.stratis pool1 projects
D. 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?

Compressing and Deduplicating Storage with VDO Medium
A. Inline deduplication
B. Filesystem journaling
C. Block striping
D. Metadata mirroring

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?

Changing the SELinux Enforcement Mode Hard
A. Disable the audit subsystem before restarting the service
B. Edit /etc/selinux/config and reboot immediately
C. Run semanage permissive -a service_name
D. Run 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?

Managing SELinux Security Hard
A. SELinux only evaluates access for root processes
B. SELinux can deny access after UNIX permissions grant it
C. SELinux denials occur only when the policy is disabled
D. SELinux replaces all UNIX permission checks

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?

Controlling SELinux File Contexts Hard
A. semanage fcontext -a -t httpd_sys_content_t '/srv/site(/.*)?'; then restorecon -Rv /srv/site
B. restorecon -t httpd_sys_content_t /srv/site; then chcon -R /srv/site
C. chcon -t httpd_sys_content_t /srv/site; then semanage fcontext -l
D. 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?

Controlling SELinux File Contexts Hard
A. A relabel removes all labels because SELinux cannot label application data
B. chcon changes labels only for filesystems mounted read-only
C. chcon changed the current label but did not create a persistent policy rule
D. 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?

Adjusting SELinux Policy with Booleans Hard
A. semanage fcontext -a -t httpd_can_network_connect_db /etc
B. setsebool -P httpd_can_network_connect_db on
C. setsebool httpd_can_network_connect_db off
D. 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?

Adjusting SELinux Policy with Booleans Hard
A. The Boolean is permanently enabled and the display is stale
B. The Boolean must be replaced with a custom file context
C. The Boolean was changed without the persistent -P option
D. The Boolean is ignored whenever SELinux is in enforcing mode

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?

Investigating and Resolving SELinux Issues Hard
A. Disable SELinux permanently, delete audit logs, and restart the application
B. Change every file to unconfined_u:object_r:default_t:s0 and retry
C. Grant the process setuid privileges before checking any denial records
D. Inspect AVC records with 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?

Investigating and Resolving SELinux Issues Hard
A. Switch to permissive mode permanently so the generated module becomes unnecessary
B. Verify the denial is expected and fix labels or Booleans before adding custom policy
C. Use chcon on the process binary without reviewing the denied operation
D. Install the module immediately because every AVC denial requires an allow rule

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?

Managing Basic Storage and Logical Volumes Hard
A. Create a GPT partition, format it, create the mount point, add its UUID to fstab, and mount it
B. Create an LVM physical volume, run swapon, and mount the swap signature as data
C. Add /dev/sdb1 to fstab before partitioning and let mount -a create the partition
D. Run 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?

Adding Partitions, File Systems, and Persistent Mounts Hard
A. Add sync to the options so device names remain stable
B. Use the mount point as the filesystem identifier
C. Replace the device path with the current kernel major and minor numbers
D. Replace the device path with the filesystem UUID from 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?

Adding Partitions, File Systems, and Persistent Mounts Hard
A. Use mount -a -F to force all entries to mount concurrently
B. Reboot repeatedly until the system accepts the modified configuration
C. Unmount every filesystem and run mkfs before testing the configuration
D. Run 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?

Managing Swap Space Hard
A. Create a 4 GiB file, restrict its permissions, run mkswap, then run swapon
B. Create a directory named swapfile, run mkswap on the directory, then enable it
C. Run swapon on an empty file, then use mkswap after activation
D. Create a 4 GiB file, run 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?

Managing Swap Space Hard
A. UUID=1111-2222 none swap defaults 0 0
B. UUID=1111-2222 / none swapon 0 0
C. UUID=1111-2222 /swap ext4 defaults 0 2
D. /dev/swap UUID=1111-2222 swap auto 1 1

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?

Creating Logical Volumes Hard
A. lvcreate -L 8G -n logs vgdata; then mkfs.xfs /dev/vgdata/logs
B. lvcreate -l 8G -n logs vgdata; then mkfs.swap /dev/vgdata/logs
C. vgcreate -L 8G logs vgdata; then mkfs.xfs /dev/logs/vgdata
D. 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?

Extending Logical Volumes Hard
A. Unmount the XFS filesystem and run resize2fs because XFS cannot grow online
B. Run lvreduce -L +5G /dev/vgdata/logs, then resize2fs on the mount point
C. Run xfs_growfs first, then reduce the LV to match the new filesystem size
D. Run 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?

Extending Logical Volumes Hard
A. The physical volume must be converted from LVM2 to LVM1
B. The volume group must be exported and imported before filesystems can grow
C. The filesystem itself has not been grown after the block device was extended
D. The LV must be reduced temporarily so the filesystem can detect free space

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?

Implementing Advanced Storage Features Hard
A. Use RAID1 for the database and linear allocation for the capacity workload
B. Use RAID0 for the database and RAID1 for the capacity workload
C. Use linear allocation for the database and RAID0 for the capacity workload
D. Use snapshots for the database and thin provisioning for guaranteed redundancy

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?

Managing Layered Storage with Stratis Hard
A. The pool can lose data because a nonredundant Stratis pool does not provide disk fault tolerance
B. Stratis automatically reconstructs all data from metadata stored on the surviving disk
C. The filesystem remains fully available because Stratis mirrors every block by default
D. Only the mount-point path changes; the filesystem data remains guaranteed intact

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?

Managing Layered Storage with Stratis Hard
A. Stratis duplicates every file in RAM before allocating disk blocks
B. Stratis reserves the entire requested size as swap before mounting
C. Stratis filesystems use thin provisioning within the storage pool
D. Stratis formats every filesystem as a compressed read-only image

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?

Compressing and Deduplicating Storage with VDO Hard
A. It contains 1 TiB of fully allocated blocks despite the smaller backing device
B. It disables filesystem allocation checks and therefore requires no monitoring
C. It uses logical overcommit through thin provisioning, with compression and deduplication reducing physical usage
D. It is a RAID1 mirror whose second copy is stored in system memory