Please guide that how to do following tasks with executing command.
- 1.Create a new physical volume, create a new volume group in the name of
dataconresize, vg extent is 16.00MB. - 2.Create a new logical volume in the name of
datacopyresizewith the size of 50 extents and file system mustext4 - 3.Then mount it under
/dataresize - 4.Resize the logical volume,
logical-dataand it filesystem to 400MB. - 5.Resize the logical volume,
logical-dataand it filesystem to 600MB. Make sure that the filesystem contents remain intact.
Note: partitions are seldom exactly the size requested,so any thing within the range of 370MB to 430MB is acceptable.
I tried first three steps as follows.
fdisk /dev/vdb
----- > Create the Partition and set it's type 8e (which is LVM type)
partprobe /dev/vdb
-----> get the partition
pvcreate /dev/vdb1
vgcreate -s 16M dataconresize /dev/vdb1
vgdisplay
-----> Check the vg extent size, its should be this (PE Size 16.00 MiB)
lvcreate -l 50 -n datacopyresize dataconresize
lvdisplay
-----> Check the size of extents
mkfs.ext4 /dev/dataconresize/datacopyresize
-----> Make a filesystem on it
mkdir -p /dataresize
-----> Create Directory to mount on it
blkid /dev/dataconresize/datacopyresize
-----> Get the UUID of /dev/datacontainer/datacopy
vim /etc/fstab
-----> Create the mount point inside the fstab
UUID=C553-2BF5 /dataresize ext4 defaults 0 0
mount -a
df -hT
-----> get the mount point of it
But I am stuck with task 4 and task 5.