Which approach extends an existing logical volume lv_home by 20G and then grows the filesystem accordingly, depending on the filesystem type?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which approach extends an existing logical volume lv_home by 20G and then grows the filesystem accordingly, depending on the filesystem type?

Explanation:
Extending a logical volume is done in two steps: first grow the LV, then enlarge the filesystem to use the new space. The LV can be increased with a command like lvextend -L +20G /dev/vg_name/lv_home, which adds 20 GB to the destination LV. After the LV is enlarged, you must grow the filesystem itself. The method depends on the filesystem type: - For XFS, you grow the filesystem through the mounted filesystem using xfs_growfs and you specify the mount point (for example, /home). XFS grows online by operating on the mounted filesystem, and the device path is not used here. - For ext4, you grow the filesystem with resize2fs, typically targeting the device path of the LV (such as /dev/vg_name/lv_home). This enlarges the ext4 filesystem to fill the newly available space. This two-step sequence is correct because it first makes room at the logical volume level and then updates the filesystem to be able to use that space, with the exact grow command chosen according to the filesystem type. Other options either shrink the volume, use an incorrect grow command for the filesystem, or omit growing the filesystem for one of the supported types.

Extending a logical volume is done in two steps: first grow the LV, then enlarge the filesystem to use the new space. The LV can be increased with a command like lvextend -L +20G /dev/vg_name/lv_home, which adds 20 GB to the destination LV.

After the LV is enlarged, you must grow the filesystem itself. The method depends on the filesystem type:

  • For XFS, you grow the filesystem through the mounted filesystem using xfs_growfs and you specify the mount point (for example, /home). XFS grows online by operating on the mounted filesystem, and the device path is not used here.

  • For ext4, you grow the filesystem with resize2fs, typically targeting the device path of the LV (such as /dev/vg_name/lv_home). This enlarges the ext4 filesystem to fill the newly available space.

This two-step sequence is correct because it first makes room at the logical volume level and then updates the filesystem to be able to use that space, with the exact grow command chosen according to the filesystem type. Other options either shrink the volume, use an incorrect grow command for the filesystem, or omit growing the filesystem for one of the supported types.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy