Ticker

6/recent/ticker-posts

LVM create, extend and delete




Install pakage LVM dist based in debian

apt install lvm2



Create partition LVM type  8e


cfdisk /dev/sdb

or

fdisk



Create phisical volume


pvcreate /dev/sdb1




Create Group Volume

vgcreate vg /dev/sdb1



Extends group volume

vgextend vg /dev/sdb1




Create logical volumen
lvcreate testing -L 1.99G -n storage

Make system file ext4

mkfs.ext4 /dev/mapper/testing-storage


Add automount fstab

vi /etc/fstab 

add next line

/dev/mapper/testing-storage /storage ext3 defaults 0 2



Extend the LV and filesystem: the quick and automatic way
note check if filesytem is ext

lvresize --resizefs --size +931GB /dev/vg/lv_home



Extend the logical volume

lvextend -L+931GB /dev/vg/lv_home




Extend the ext4 file system

resize2fs /dev/vg/lv_home


if next error

resize2fs: Bad magic number in super-block while trying to open


Check your file system

mount


If your filesytem is xfs run

xfs_growfs /dev/mapper/centos-root




Check with
df -lh





Reacciones:

Post a Comment

0 Comments