RHCE Storage and File Systems 1 — Questions and Answers
Question 1: Which command is used to create a physical volume in LVM?
- pvcreate (Correct answer)
- vgcreate
- lvcreate
- mkfs
Correct answer: pvcreate
The `pvcreate` command initializes a disk or partition as an LVM physical volume.
Question 2: What file system type is recommended by Red Hat for XFS journaling on RHEL 8+?
- ext4
- xfs (Correct answer)
- btrfs
- vfat
Correct answer: xfs
XFS is the default and recommended file system for RHEL 8 and later due to its performance and scalability.
Question 3: Which command displays the disk usage of a mounted file system in human-readable format?
- du -h
- df -h (Correct answer)
- lsblk -h
- fdisk -l
Correct answer: df -h
`df -h` reports file system disk space usage in human-readable units like GB and MB.
Question 4: Which LVM command extends an existing logical volume by 2GB?
- lvresize -L +2G /dev/vg0/lv0
- lvextend -L +2G /dev/vg0/lv0 (Correct answer)
- vgextend -L +2G /dev/vg0/lv0
- pvextend -L +2G /dev/vg0/lv0
Correct answer: lvextend -L +2G /dev/vg0/lv0
`lvextend -L +2G` increases the size of a logical volume by the specified amount.
Question 5: What is the purpose of the `/etc/fstab` file?
- Lists installed packages
- Defines file systems to mount at boot (Correct answer)
- Stores disk partition tables
- Configures LVM volume groups
Correct answer: Defines file systems to mount at boot
The `/etc/fstab` file contains static information about file systems and is read at boot to mount them automatically.
Question 6: Which command resizes an XFS file system to fill its logical volume after expansion?
- resize2fs
- xfs_growfs (Correct answer)
- fsck
- tune2fs
Correct answer: xfs_growfs
`xfs_growfs` expands an XFS file system to use all available space in its underlying block device.
Which command is used to create a physical volume in LVM?