User Tools

Site Tools


wiki:create_lvm_debian_7

Create LVM on Debian 7

apt-get install lvm2
etc/init.d/lvm start
pvcreate /dev/sda
vgcreate myVirtualGroup1 /dev/sda
vgdisplay

Create a logical volume in a volume group:

lvcreate -n myLogicalVolume1 -L 10g myVirtualGroup1
lvdisplay

Format the logical volume to the filesystem you want (ext4,xfs…):

mkfs -t ext4 /dev/myVirtualGroup1/myLogicalVolume1''

You can test to see if it's working:

mkdir /test
mount /dev/myVirtualGroup1/myLogicalVolume1 /test
df -h

Expand entire logical volume to whole disk (/dev/sdX):

pvcreate /dev/sdX
vgextend myVirtualGroup1 /dev/sdX
lvextend -l +100%FREE /dev/myVirtualGroup1/myLogicalVolume1
resize2fs /dev/myVirtualGroup1/myLogicalVolume1

Tested on

See also

References

wiki/create_lvm_debian_7.txt · Last modified: 2022/09/29 15:15 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki