lvm


Lubuntu LVM Encrypted

While trying to setup a lubuntu GNU/Linux that would use an encrypted LVM file-system we run into several problems that should have not been there.
For example, the installer would not continue as swap memory was not encrypted and it was blocking the operation.
An other issue was that the LVM support package was not installed by default although it is needed by the installer.

Our solution requires an active internet connection so that you can install the lvm2 package.

Methodology

After booting into the live session, before we started the installation process, we opened a terminal from the main menu (Start Menu) and executed the following two commands:

sudo apt-get install lvm2 -y;

sudo swapoff --all;

These two commands disabled all swap (so that we do not get the error that swap is not encrypted) and it installed the lvm2 package that is needed by the installer to create our LVM setup.

The following video presents the full successful installation procedure by making the changes before starting the procedure.

The next video, shows our attempts to fix the installation after encountering the errors instead of fixing them beforehand.

Advertisements

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.