Linux LVM

1. create LVM partition:

fdisk /dev/[disk]

change partition type from LINUX to LVM

2. initialization LVM partition:

pvcreate /dev/[disk_partiton1] /dev/[disk_partition2]

check commands:

pvs
pvdisplay
3. create LVM group:

vgcreate [group_name] /dev/[disk_partition1] /dev/[disk_partition2]

check commands:

vgs
vgdisplay
4. create logical volumes which is attached to group:

lvcreate -L[size]M -n [vol_name] [group_name]

check commands:

lvs
lvdisplay
5. format volumes:

mkfs.ext3 [LV_name_from_lvdisplay]

 


EXTEND
change size volume:

lvextend -L +[size]M [LV_name_from_lvdisplay]
change size partition:

resize2fs [LV_name_from_lvdisplay]
REDUCE

fsck -f [LV_name_from_lvdisplay]
change size partition:

resize2fs [LV_name_from_lvdisplay] [size]G
change size volume:
lvreduce -L -[size]G [LV_name_from_lvdisplay]

Posted by Rajat Patel at 7:10 AM No comments: 

 

 

Advertisements
Leave a comment

Leave your opinion

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: