Installing Debian on a Server with Partitions using LVM¶
The last virtual server (vServer) I had had limited storage space and Docker kept filling up my /var/lib/
directory.
A friend suggested to use lvm
to partition the disk.
Here is how I accomplished it using the Debian installer.
netcup specific preparation
My server is hosted by netcup so the following is specific to their server control panel (SCP).
- Log in to the SCP and choose the server
- Select Steuerung
- Stop the server with Herunterfahren (ACPI)
- Then, select Medien > DVD Laufwerk
- Under Offizielle DVDs select the Debian option
- Enable Bootmodus auf DVD setzen and enter the SCP password
- Then, select DVD einlegen
- Go back to Steuerung and start the server
- Once started, go to Allgemein and on the top right click on the VNC image to open the VNC popup
At the end of the installation, eject the DVD and reboot the system.
Once you see the first screen of the Debian installer, follow these steps:
- Select Install and follow the instructions
- When asked for the partitioning method: Choose Manual
- At the next screen, choose Guided Partitioning
- Select the disk, then All files in one partition as the partitioning scheme
- Agree to the changes and then choose the size of the root partition, e.g.,
50 GB
- At the next screen, choose Configure the Logical Volume Manager
- Now, use Create Logical Volume to create additional volumes and their sizes that you want
- Don't assign all the free space to give you the ability to extend volumes later as necessary
data
: 100 GBvar
: 50 GBhome
: 10 GB
- Then select Finish
- In Partition Disks, select the new volumes to configure them
- Under Use as choose Ext4 journaling file system
- Then define the mount point
- Once you are done, select Finish partitioning and write changes to disk
- The installation will now continue: When asked for the software to be installed, make sure only SSH server and standard system utilities are selected
Once the system is rebooted you should be able to log in via SSH. It seems that root login via SSH is disabled by default, so log in with the user that you chose during the installation.
When you are logged in, you can switch to root
via su -
. (1)
- Don't just use
su
since you will be missing the correct$PATH
. See this comment explaining it: https://www.reddit.com/r/linuxquestions/comments/pcfjo6/comment/haijm8f/
The filesystem looks something like this at the end:
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 794M 680K 793M 1% /run
/dev/mapper/mattsch--vg-root 45G 1.3G 42G 3% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/vda2 456M 138M 294M 32% /boot
/dev/mapper/mattsch--vg-home 9.1G 52K 8.6G 1% /home
/dev/mapper/mattsch--vg-data 92G 24K 87G 1% /data
/dev/mapper/mattsch--vg-var 46G 265M 43G 1% /var
/dev/vda1 512M 6.1M 506M 2% /boot/efi
tmpfs 794M 0 794M 0% /run/user/1000
You can then go ahead and change passwords, and configure things. Take a look at the post setting up Debian on how I set up my Debian server.
Comments
Comments are currently not supported. For the time being, please send me an email.