Exam EX200 All QuestionsBrowse all questions from this exam
Question 96

SIMULATION -

Resize the logical volume vo and its filesystem to 290 MB. Make sure that the filesystem contents remain intact.

Note: Partitions are seldom exactly the same size requested, so a size within the range of 260 MB to 320 MiB is acceptable.

    Correct Answer:

    To resize a logical volume and its filesystem to a specific size such as 290 MB while ensuring that the filesystem contents remain intact, follow these steps: First, check the logical volume details using 'lvdisplay' or 'lvscan' to confirm the volume's current size and path. Then, resize the logical volume to the desired size using the 'lvresize' command: 'lvresize -L 290MB /dev/vg0/vo'. If the logical volume is using an XFS filesystem, extend the filesystem using 'xfs_growfs /mount_point'. If the filesystem is ext2, ext3, or ext4, you should use 'resize2fs /dev/vg0/vo'. To ensure that the changes take effect and that the filesystem contents remain intact, you might need to unmount and remount the filesystem if necessary. Verify the changes with 'df -hT'. Note that it's essential to choose the right command according to the type of filesystem in use.

Discussion
PENNSHARK

lvdisplay (to get the logical volume path ) lvresize -r -L 290MB /dev/volumegroup/logical

maxam20

++ depends on the type of the file system , we should resize it. XFS >> $ xfs_growfs "mountpoint" ext2 >> $ resize2fs "lv_path"