โ† All RHCSA Flashcard Decks

RHCSA LVM Storage Management Flashcards

6 cards from real RHCSA practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 RHCSA LVM Storage Management flashcards as text
  1. A logical volume named `lv_data` in the volume group `vg_apps` is almost full. A new physical disk, `/dev/sdd`, has been added to the system to provide more space. Which of the following sequences of commands correctly extends the logical volume to use the new disk?

    Answer: 1. `pvcreate /dev/sdd` 2. `vgextend vg_apps /dev/sdd` 3. `lvextend -l +100%FREE /dev/vg_apps/lv_data` 4. `xfs_growfs /mount/point` or `resize2fs /dev/vg_apps/lv_data`

    The correct procedure is to first initialize the new disk as a physical volume using `pvcreate`. Then, the volume group must be extended to include this new physical volume with `vgextend`. After the volume group has more space, the logical volume can be extended to use the available free space using `lvextend`. Finally, the filesystem on the logical volume must be resized to recognize and use the additional space; this is done with `xfs_growfs` for XFS filesystems or `resize2fs` for ext2/3/4 filesystems.

  2. Which command is used to create a new logical volume named `lv_web` of size 10 Gigabytes from a volume group named `vg_data`?

    Answer: C. `lvcreate -L 10G -n lv_web vg_data`

    The `lvcreate` command is used to create a new logical volume. The `-L` option specifies the size of the logical volume (10G), and the `-n` option specifies its name (lv_web). The final argument is the name of the volume group from which to allocate the space (vg_data).

  3. A system administrator needs to remove a logical volume `/dev/vg01/lv01` which is currently mounted on `/data`. What is the correct procedure to safely remove the logical volume?

    Answer: C. `umount /data` followed by `lvremove /dev/vg01/lv01`

    Before a logical volume can be removed, it must be unmounted. The `umount` command is used to unmount the filesystem. After it's unmounted and no longer in use, the `lvremove` command can be used to safely delete the logical volume.

  4. Which of the following describes the fundamental relationship between Physical Volumes (PVs), Volume Groups (VGs), and Logical Volumes (LVs) in LVM?

    Answer: D. Physical Volumes are pooled together to create a Volume Group, from which Logical Volumes can be created.

    LVM works by creating a pool of storage space called a Volume Group (VG) from one or more Physical Volumes (PVs), which can be whole disks or partitions. From this VG, you can create Logical Volumes (LVs), which function as virtual partitions that can be easily managed and resized.

  5. A sysadmin has created a logical volume and now needs to make it usable by the operating system. What are the next two essential steps after using `lvcreate`?

    Answer: A. Create a filesystem on the LV, then mount it.

    After a logical volume is created with `lvcreate`, it is just a raw block device. The next step is to create a filesystem on it using a command like `mkfs.xfs` or `mkfs.ext4`. Once the filesystem exists, the logical volume can be mounted to a directory to make it accessible for storing files.

  6. You need to reduce the size of a logical volume named `data_lv` in the `corp_vg` volume group. The volume is formatted with an ext4 filesystem. What is a critical prerequisite before running the `lvreduce` command?

    Answer: B. The filesystem must be resized to be smaller than or equal to the new LV size.

    Reducing the size of a logical volume will destroy any data in the removed space. Therefore, it is critical to first shrink the filesystem on the volume to ensure no data is lost. Commands like `resize2fs` (for ext4) must be used before `lvreduce` to safely reduce the overall size.