XK0-004 · Question #399
A Linux administrator added storage to an XFS-formatted filesystem at /dev/mapper/vgSlash- lvLog device using the LVM tools. However the additional space does not show up when the administrator runs…
The correct answer is C. resize2fs /dev/mapper/vgSlash-IvLog. After extending an LVM logical volume, the filesystem itself must be separately resized before the additional space is visible to the OS.
Question
A Linux administrator added storage to an XFS-formatted filesystem at /dev/mapper/vgSlash- lvLog device using the LVM tools. However the additional space does not show up when the administrator runs the df -h command. Which of the following commands should the administrator run to resolve this issue?
Options
- AXfs-growfs/dev/mapper/vgSlash-lvLog
- Bdd if=dev/zero of=/dev/mapper/vgSlash-IvLog bs=IN
- Cresize2fs /dev/mapper/vgSlash-IvLog
- DIvextend -n IvLog VgSlash -L+10G
How the community answered
(19 responses)- A5% (1)
- B11% (2)
- C79% (15)
- D5% (1)
Why each option
After extending an LVM logical volume, the filesystem itself must be separately resized before the additional space is visible to the OS.
The syntax 'Xfs-growfs' uses a hyphen instead of the required underscore (correct form: xfs_growfs) and has no space between the command and the device path, making it an invalid command that would not execute.
dd if=/dev/zero of=/dev/mapper/vgSlash-lvLog overwrites the device with null bytes, which destroys all filesystem data rather than resizing it.
resize2fs /dev/mapper/vgSlash-lvLog resizes the filesystem to fill the newly extended logical volume, making the additional space appear in df -h output. LVM tools like lvextend only grow the block device layer; without a subsequent filesystem resize operation the filesystem boundary remains at the original size and the new space is inaccessible.
lvextend operates at the LVM block device layer to allocate new extents to the logical volume, but it does not resize the filesystem on top of it - a separate filesystem resize command is still required afterward.
Concept tested: LVM volume extension and filesystem resize after lvextend
Source: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_and_managing_logical_volumes/modifying-the-size-of-a-logical-volume_configuring-and-managing-logical-volumes
Topics
Community Discussion
No community discussion yet for this question.