Create a new partition in an LVM filesystem and mount it, resize it and delete it

Following you can find the commands I used to create a new partition on an LVM (Logical Volume Manager) system where during installation there was some hard disk space left empty.

lvcreate -L 372.3GB -n partitionName /dev/boxname
mkfs.ext4 /dev/boxname/partitionName
mount -t ext4 /dev/mapper/boxname-partitionName /media/someName/
#lvextend -L+122.39G /dev/boxname/partitionName
#resize2fs /dev/boxname/partitionName
##lvremove /dev/boxname/partitionName

After creating the partition, we set it’s type – here we used ext4.
Later we mount the partition to a folder to gain access to it.
Following in comments (#) we show how to resize/extend an already existing partition and how to remove it (##) — make sure to remove all brackets before performing these operations.

Leave a Reply