RHCE Storage and File Systems 2 — Questions and Answers
Question 1: Which command creates a volume group named `vg_data` from physical volume `/dev/sdb`?
- pvcreate vg_data /dev/sdb
- vgcreate vg_data /dev/sdb (Correct answer)
- lvcreate vg_data /dev/sdb
- mkfs.xfs vg_data /dev/sdb
Correct answer: vgcreate vg_data /dev/sdb
`vgcreate` creates a new LVM volume group from one or more physical volumes.
Question 2: What mount option in `/etc/fstab` causes a file system to be mounted read-only?
- noexec
- ro (Correct answer)
- nosuid
- defaults
Correct answer: ro
The `ro` mount option mounts the file system in read-only mode, preventing any write operations.
Question 3: Which command scans for available LVM physical volumes on the system?
- pvdisplay
- pvscan (Correct answer)
- pvcheck
- pvlist
Correct answer: pvscan
`pvscan` scans all supported LVM block devices in the system for physical volumes.
Question 4: What does the `blkid` command display?
- Block device I/O statistics
- UUID and type of block devices (Correct answer)
- LVM logical volume details
- Disk partition sizes
Correct answer: UUID and type of block devices
`blkid` locates and prints block device attributes including UUID, label, and file system type.
Question 5: Which option in `mkfs.xfs` sets a label for a new XFS file system?
- -n
- -L (Correct answer)
- -l
- -b
Correct answer: -L
The `-L` option in `mkfs.xfs` sets a label (name) for the newly created XFS file system.
Question 6: What command creates a swap partition and enables it immediately?
- mkswap /dev/sdc1 && swapon /dev/sdc1 (Correct answer)
- mkfs.swap /dev/sdc1 && swapon /dev/sdc1
- fdisk /dev/sdc1 && swapon /dev/sdc1
- mkswap /dev/sdc1 && swapstart /dev/sdc1
Correct answer: mkswap /dev/sdc1 && swapon /dev/sdc1
`mkswap` formats the partition as swap space, and `swapon` activates it for immediate use.
Which command creates a volume group named `vg_data` from physical volume `/dev/sdb`?