How it works?
When you boot your server it asks for password (not your system user password) for getting the access to data on hard drive(s). You only need to enter decryption password for once in boot process.
LVM is made of logical volumes, volume group and physical volumes
- Logical volume is place where the actual data is located.
- Volume group is name for your group.
- Physical volume is your hard drive.
Logical volume is the part where encryption and decryption happens
We can manage whole LVM setup with Webmin.
1 server, monitor + keyboard
Desktop pc or Laptop with Ssh like Putty
usb stick (2gb) or empty dvd
some files might take more then 10 minutes to download so consider starting the downloads right now.
Ubuntu server iso
Ubuntu desktop iso /kali linux (for verifying your data is safe)
Installing Ubuntu server with live cd/usb
Make your language selections.
Select No and select it manually from the list.
Choose guided use entire disk and set up encrypted lvm.
Choose the disk where you wan’t to install the main system. Ignore all other disks for now.
Create another password for encryption.
You can manage empty space later on if you don’t like to use 100% of your disk.
At least select openssh.
If it shows you list of disks just select the one where you are installing right now.
Now it’s time to reboot.
And this is the part where you type encryption password.
And after boot.
Up to date installing instructions are located at:
Go for the option:
”Using the Webmin APT repository”
Adding a hard drive in LVM
Login to Webmin. Look for Dasboard and expand Hardware and go to Logical Volume Management.
You don’t need to do anything here if you already have a volume group like in picture below.
Click: Add a physical volume to ubuntu-gv
Select hard drive you wan’t to add, from list. If you can’t guess it from the list. Type in shell fdisk -l and type device name in the box located next to list. Device name like: /dev/sdc.
Click: Create a logical volume in ubuntu-vg.
Add name in Volume name… extend_1 …extend_2
Click Logical Volume you just created.
Now you need to format it, so select from list the ext4 and click Create Filesystem of Type:
Continue by clicking Create.
If everything worked out:
How to format with shell command:
Use fdisk -l and when you find it do: mkfs -t ext4 /dev/mapper/ubuntu–vg-extend_2 (replace /dev/mapper/xxxxx with your version of course). Even tho it shows /dev/ubuntu-vg/extend_2 .. in the picture just use the version fdisk gives you.
Go back to your Logical Volume details and mount it. Example:
Make sure you have it right in LVM logical volume and click Create.
That’s the basics how you can manage it. If you wan’t add more hard drives just shutdown your server and plug a new hdd in. You might even be able to add it without shutdown if your motherboard allows it, just make sure you test that in the beginning when you drives are still empty. Now you can share it easily with Samba using the mount location: /home/xxxxxx.
Remember if you wan’t to remove hard drives and add them back later on, make sure you add comment mark # in /etc/fstab file.