For a quite a while I’ve had an old desktop machine gathering dust in a corner. It hasn’t been powered up in about a year, and I’ve even been thinking about what I could still do with it. The machine itself is still quite capable, it has a first generation core i7 CPU at 2.8GHz, and 4GB of RAM.
And recently a new option presented itself, my employer is starting up self-study gatherings and knowledge sharing sessions about “Cloud”. They’ve been doing these kinds of knowledge sharing gatherings for everything Linux Kernel for quite a while, the quadcopter was a project that I’ve started in light of that Linux Kernel knowledge sharing.
For this Cloud knowledge sharing I was thinking to set up OpenStack on this desktop machine. I ordered some more RAM, and a couple of SSDs to upgrade the machine so it can handle a few virtual machines.
There are couple of options when it comes to virualization, there are hypervisors like Hyper-V from Microsoft, ESXi from VMWare, XEN from Citrix, and there are virtualization tools like Qemu, KVM, VirtualBox, VMWare Player. From all this, only two options that are free, open source, and perfectly supported by OpenStack, stand out: Xen and KVM. Qemu fits into those requirements too, but this is an emulator, and performance is quite low, but fun can be had with this for very specific purposes later. I’ve decided to go with KVM running of off Debian, just because…
So there I go, installing Debian. I’ve configured the BIOS of my desktop to create a RAID0 volume with the two SSDs I bought, and followed this guide.
It took me alot longer than it should’ve but eventually it worked when I just put everything in one partition, without LVM (I didn’t know what it was at first).
I wasn’t too happy with this, I really like the idea of having my /home folder in a separate partition. And I’ve been reading up on this LVM thing, and this seemed like something that could come in really handy. LVM creates a layer on top of physical disks/partitions: a volume group. The volume group can be dynamically extended or reduced at will. Within that volume group you can create logical volumes, which are also easily extended/reduced. Within such a logical volume you typically have your favorite file system.
OK, now things start getting hairy, when setting up those LVM volumes during the Debian install everything that guide says still seems to apply. After that rescue step to install Grub, I reboot the machine. Grub comes up, Debian starts to boot, but ends up in an emergency mode:
Welcome to emergency mode! After logging in, type "journalctl -xb" to view system logs
The logs says something like:
debian systemd[222]: Failed at step EXEC spawning /bin/plymouth: No such file or directory
Plymouth seems to have nothing to do with the error here, plowing through the logs I noticed that all the disk checks on those LVM partitions are failing, and I believe this is more likely the cause, but I haven’t investigated this any further.
I came across this link instead. I reverted the RAID configuration in the BIOS, and I went with the software RAID option instead. This worked, Debian boots up completely, I have RAID, LVM.
But I used the guided partitioning from the Debian installer, the /home partition was 470GB large because of this, and I’d rather have a separate partition for the images and instances for the virtual machines I’ll be setting up next. But resizing a logical volume does require that the volume is not used (it’s file system mounted), and unmounting a filesystem is only possible when it’s not in use by anything or anyone.
Crtl-Alt F1 gets you in a terminal, log in with your user credentials:
$ pwd
Normally when you are logging in as a user, the current working directory for the shell is your home dir
/home/panic1
This changes the current working dir of the shell
$ cd /
Become root
$ sudo su
This kills off the complete graphical desktop and all applications within
# systemctl isolate multi-user.target
Shows you which users are still using /home. Should return empty
# fuser /home
Lists open files. Should return empty
# lsof /home
With no open files, /home can be unmounted
# umount /home
Resize the home volume and the filesystem to 100GB
# lvreduce -L 100G -r /dev/PANICLOUD-vg/home
Create new “images” logical volume
# lvcreate -n images -L 100GB PANICLOUD-vg
Create new “instances” logical volume
# lvcreate -n instances -L 100GB PANICLOUD-vg
This will start the graphical desktop again
# systemctl isolate default.target
Within the graphical desktop I used the Disks utility to format and mount the volumes to /opt/images and /opt/instances respectively.