-------------
Create a linux partition, make it a LVM by toggling the linux partitions id to
8e.
Convert it to a physical volume by issuing the command
#pvcreate devicename
Then, make the volume group in that physical volume,
#vgcreate vgname
Then make logical volumes in the volume group,
#lvcreate -L size
Make a linux filesystem in the logical volume,
#mkfs.ext3 /dev/
This device is a softlink to the device /dev/mapper/vgname-lvname
Then mount that logical volume,
#mount /dev/
LVM Resizing:
-------------
LVM format 2.0 is now implemented which supports online resizing of filesystems.
check the current size of the filesystem by 'df -h'
Extend the above created logical volume BY X MB,
#lvextend -L +XM /dev/
we are doing it without unmounting the filesystem
Now to make the extension effective, issue
#resize2fs /dev/
now recheck the filesystem size by 'df -h',
now the filesystem will be extended by X MB.
Now if u want to reduce the logical volume TO X MB,
u must first umount the device, online reducing of logical volumes cannot be done..!
#umount
then u need to scan the filesystem for integrity.
#e2fsck -f /dev/vgname
now resize the filesystem
#resize2fs /dev/vgname
then reduce the volume with lvreduce and mount it..
#lvreduce -L XM /dev/vgname
#mount /dev/vgname
No comments:
Post a Comment