Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Unix >> Linux >> RHEL >> LVM >> How to add new disk to lvm and create new volume group and logical volume and create new filesystem on it

# lsblk

e.g. there is new disk sdb

# pvcreate /dev/sdb

NOTE: if using partition /dev/sdb1 instead of whole disk /dev/sdb and partition was newly created but not visible, use partprobe /dev/sdb

# pvs

# vgcreate vg1 /dev/sdb

# vgs

create new logical volume using 100% of the space in the vg

# lvcreate -l 100%FREE -n lv1 vg1

( to create 20g for example : lvcreate -L 20g -n lv1 vg1  or  lvcreate --size 20g --name lv1 vg1)

# lvs

create new file system on that lv

# mkfs -t ext4 /dev/vg1/lv1

mount the file system to /app

# mkdir /app

# mount -t ext4 /dev/vg1/lv1 /app

 

References

[1] https://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/index.html
[2] https://www.thegeekstuff.com/2010/08/how-to-create-lvm/

 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]