0% found this document useful (0 votes)
64 views3 pages

Extend Existing Logical Volume by 200MB and Add Label To It

The document discusses extending an existing logical volume by 200MB and adding a label. It notes that the XFS filesystem does not allow shrinking, only growing. It provides the commands to extend the logical volume and filesystem to 200MB using lvextend with the -r flag, and to add a label using xfs_admin after unmounting the filesystem.

Uploaded by

Maher Mechi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views3 pages

Extend Existing Logical Volume by 200MB and Add Label To It

The document discusses extending an existing logical volume by 200MB and adding a label. It notes that the XFS filesystem does not allow shrinking, only growing. It provides the commands to extend the logical volume and filesystem to 200MB using lvextend with the -r flag, and to add a label using xfs_admin after unmounting the filesystem.

Uploaded by

Maher Mechi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Extend existing logical volume by 200MB and

add label to it
Question:
Extend the existing xfs file system to a total size of 200MB and add a label called myFS.

(scroll down for an answer)


Answer:
Before any kind of operations on LVM it is good to know what we actually have in the system.
The proper command to list all devices we can use is in order pvs, vgsand lvs. It shows all
physical storages and devices, volume groups and logical volumes.

Exam objectives require extending of logical partitions. The tricky part here is to remember
that XFS filesystem (which is the default setting for RHEL) does not allow downsizing
of XFS partition (the only possibility is to grow that volume). So please be careful when reading
LVM related questions during the exam.

When question is presented in a form we have in this task we can assume that the logical
volume is less than given 200MB we have to set. Then we can use:

# notice -r flag which indicates not only to resize logical volume but also filesystem on
it
lvextend –size 200M -r /dev/VOLUME_GROUP/LOGICAL_VOLUME

In order to give a logical volume a label we have to unmount it first, set a label and then
mount it again:

# umount /LINK/TO/FILESYSTEM/MOUNT/POINT
# xfs_admin -L "myFS" /dev/VOLUME_GROUP/LOGICAL_VOLUME
# mount /LINK/TO/FILESYSTEM/MOUNT/POINT

You might also like