Technology, Linux

Installing Proxmox

In the previous article I discussed the plans for my new home server and covered the specs and overall topology.  In the following articles I will get into more specifics.  This one will be focusing on how I installed Proxmox on USB flash and then relocated various directories to minimize writes to the flash media to maximize its life.

For those who may not know, Proxmox is an open-source enterprise virtualization platform based on Debian Linux, KVM hypervisor, and LXC containers.  More info can be found here.  I downloaded the 5.0 installer via BitTorrent from the downloads page and used dd to copy it onto a USB flash drive.

I then inserted that flash drive, along with the SanDisk UltraFit drive that was to be the target of the install, into my newly built server.  I booted from the installation drive, and then chose the UltraFit drive as installation location.  It was a fairly straight forward process, unfortunately I don’t remember the specifics, but I believe you select your installation disk, file system (I used ext4 which also defaults to LVM), set your root password, and assign name/IP address.  It will then run through the install and instruct you to continue by pointing your browser to the web interface (https://IPorHostname:8006).  I chose to first connect via SSH and install updates:

I then poked around the OS a bit and discovered I was seeing some ZFS errors on boot and in journalctl, I wasn’t going to be using ZFS anyway, so went ahead and disabled it:

I then noticed that the console-setup service was in a failed state and refused to start.  In order to remedy that I ended up needing to uninstall/reinstall the keyboard-configuration package, which also removes console-setup.

At this point, everything was looking good and it was time to go ahead and setup my raid array.  Proxmox does not officially support software raid, but acknowledge in their wiki that it is in use by experienced users, but they of course recommend hardware raid instead.  So I needed to install mdadm:

I am using five 1 TB drives in a Raid 5 configuration, you can ind your drives with the following command:

Now you’re ready to create the actual array:

If I recall, I believe it took around 2 hours to create the array, you can check progress with the following command:

Once the array is built, the configuration needs to be saved so that it will be available on reboot and won’t be assigned some random device number.  To accomplish that, issue the following command:

I also added the following line to the config to receive an email if something happens to the array (ie, a failed disk)

In order for this to work, you’ll need to make sure that mdmonitor is running and also configure postfix to send mail to an external source (I’ll cover that in the next post).

At this point, I was ready to start creating my LVM partitions.  As I mentioned previously, I needed to make some changes to keep from constantly writing to my USB boot device and causing it to fail.  One of those changes was to move /var off of it.  You can also accomplish this by redirecting it to RAM, but I didn’t want to lose my logs with a reboot, so I choose to create an LVM partition and mount it to /var instead.  To do that, I performed the following steps:

  • First I created a physical volume on /dev/md0

  • Next, I created a volume group named RAID5

  • Then I created my first logical volume to use for /var, made it 15 GB in size, and named it lvvar

  • I then created a second logical volume to use the remaining space in the raid, and named it lvstorage

  • The final step was to create ext4 filesystem on each of these

Now I was ready to relocate /var onto the newly created file system /dev/RAID5/lvvar. To do that, I performed the following:

I then needed to go to single user mode, so that there would be no activity in /var by issuing the command:

And then entering the root password.

Now I needed to backup the data in /var

Once the copy is complete, rename the exising /var directory and then create a new one

Now I needed to unmount /dev/RAID5/lvvar and remount it in /var instead

Add an entry to /etc/fstab

And finally, return to multi-user

I then created a mount point for the remainder of the raid

And added an entry to /etc/fstab for it

One more change that I wanted to make was to mount /tmp to tmpfs (aka into memory), to accomplish that in Proxmox (which is based on Debian Stretch) you can issue the following commands:

The final change was to completely disable swap, the server has 32 GB of RAM, so I didn’t feel it was going to be needed at any point, so rather than move it to disk, I just got rid of it.  To do that, issue the command:

and then remove any mounts for swap from /etc/fstab.

At this point, I rebooted the system to make sure everything mounted ok, verified there were no issues, and I was then ready to start creating VMs.

Series Navigation<< New Home ServerProxmox Quirks & Configurations >>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.