Increasing the Size of /dev/vg/lv Volume | CompTIA Linux+ Exam XK0-004

Increase the Size of /dev/vg/lv Volume to 20GB

Question

An administrator is tasked with increasing the size of the volume /dev/vg/lv to 20GB.

Which of the following BEST illustrates the steps the administrator should take?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.

The correct answer is D. lvextend "L20G /dev/vg/lv; resize2fs /dev/vg/lv.

Explanation:

The task is to increase the size of the volume /dev/vg/lv to 20GB. To accomplish this, the administrator needs to perform the following steps:

  1. Verify the current size of the logical volume using the "lvdisplay" command. This will display the size of the logical volume along with other details like the volume group name, physical volume, etc.

  2. Extend the logical volume to the desired size using the "lvextend" command. The "-L" option specifies the new size for the logical volume. In this case, the option should be "-L 20G". The command will look like:

    lvextend -L 20G /dev/vg/lv

  3. Resize the filesystem to use the new size of the logical volume using the "resize2fs" command. The command will look like:

    resize2fs /dev/vg/lv

This command will resize the filesystem to the size of the logical volume.

Option A (vgextend "L20G /dev/vg/lv; resizelv /dev/vg/lv) is incorrect because "vgextend" is used to add a physical volume to a volume group. "resizelv" is not a valid command. The correct command to resize a logical volume is "lvextend".

Option B (parted "L20G /dev/vg/lv; remount /dev/vg/lv) is incorrect because "parted" is used for partitioning disks, not resizing logical volumes. Also, "remount" is not required after resizing a logical volume.

Option C (mkfs "L20G /dev/vg/lv; tune2fs /dev/vg/lv) is incorrect because "mkfs" is used to create a new filesystem, not resize an existing one. "tune2fs" is used to change filesystem parameters, not resize the filesystem.