Squoggle
Mac's tech blog
Tag Archives: ubuntu
Linux Mint 22 – Custom UEFI LVM Installation
Posted by on December 30, 2024
Linux Mint’s Cinnamon desktop is one of the most productive and visually clean environments. However, its installation process has limitations, such as minimal support for Logical Volumes (LVM) on multiple devices. This guide provides a detailed walkthrough for configuring Linux Mint 22 with UEFI and LVM across multiple storage devices, allowing for advanced customization.
This guide documents the steps I followed to install Linux Mint 22 using Logical Volumes across multiple physical storage devices. By sharing this process, I aim to help others replicate this setup, whether on virtual machines or physical hardware
My Setup
For this installation I am doing the installation and configuration on a VirtualBox Virtual machine to test the process and in theory duplicate the process on a physical host. The salient details of the hardware are follows:
| Hardware | Virtual Machine | Physical Machine |
| Memory | 32 GB | 64 GB |
| Processors | 4 | 8 |
| Disk via SATA Controller | 100 GB | 1 TB |
| Disk via NVME Controller | 10 GB | 2 TB |
Partitioning
One of the reasons I’m doing this custom installation is that the automated installation does not allow me to customize the partitioning. One of the things I want to accomplish is customizing the amount of swap space so that I can configure Hibernation on this host. In order to do so I need more swap space defined than I have configured in memory. The below table is an outline of the physical devices and partitions I want to create:
Partition Setup Overview
/dev/sda:
- /dev/sda1: EFI partition (1 GB, FAT32).
- The EFI partition only needs to hold the bootloader and essential EFI files. A 1 GB size provides ample space for future updates or additional boot entries, without wasting disk space.
- /dev/sda2: 4GB ext4 filesystem mounted at /boot
- The
/bootpartition houses the Linux kernel, initramfs, and other boot-related files. A 4 GB allocation ensures sufficient space for kernel updates, multiple kernels, and recovery options, especially useful if the system uses custom kernels.
- The
- /dev/sda3: Physical Volume (PV) for LVM for swap space (48 GB) and for root file system (remaining space).
- Allocating the remaining space to an LVM PV provides flexibility. It allows dynamic resizing of logical volumes for swap and the root filesystem as needs evolve. By defining a large swap space (48 GB), the system supports hibernation, which requires swap space to be at least equal to the amount of installed memory. The rest is allocated to the root filesystem to hold the operating system and application files.
/dev/nvme0n1:
- Physical Volume (PV) for LVM for
/home(entire device).- Using the entire NVMe device for the
/homelogical volume ensures fast access to user data and provides a clear separation from the root filesystem. This approach enhances performance and simplifies backups or future migrations of user data.
- Using the entire NVMe device for the
Steps to Configure /dev/sda
1. Open GParted
- Boot into the Linux Mint live session.
- Launch GParted from the menu.
- Select /dev/sda from the dropdown at the top-right.
2. Create GPT Partition Table on /dev/sda
- Go to
Device > Create Partition Table. - Select GPT as the new partition table type and click Apply.
3. Create EFI Partition
- Right-click on the unallocated space and select New.
- Configure:
- Size: 1 GB.
- File System: fat32.
- Label: EFI.
- Click Add.
- Apply all changes:
- Click the checkmark (green tick). Click Apply.
- Set flags:
- Right-click the partition >
Manage Flags. - Enable boot and esp flags.
- Right-click the partition >
4. Create Boot Partition
- Right-click on the unallocated space and select New.
- Configure:
- Size: 4 GB.
- File System: ext4.
- Label: Boot.
- Click Add.
5. Create LVM Physical Volume
This LVM Physical Volume will contain both the SWAP space and the Root (“/”) file system.
- LVM/PV Partition:
- Right-click the remaining unallocated space and select New.
- Configure:
- Size: Remaining Space.
- File System: lvm2 pv
- Label: SDA PV.
- Click Add.
- Apply all changes:
- Click the checkmark (green tick). Click Apply.
6. Check your work
You can check your work with the following terminal commands:
sudo pvdisplay
sudo fdisk -l /dev/sda
You should see indications of what you have created with Gparted.
Steps to Configure /dev/nvme0n1
Since the entire nvme device is going to be configured as LVM, nothing needs to be done other than what is done below in the terminal.
Setup LVM Using the Terminal
1. Prepare Physical Volumes
Run these commands in the terminal:
sudo pvcreate /dev/nvme0n1 # Physical Volume for /home
Verify the Physical Volumes have been created:
sudo pvdisplay
2. Create Volume Groups
sudo vgcreate vg_sda /dev/sda3
sudo vgcreate vg_nvme0 /dev/nvme0n1
Verify the Volume Groups:
sudo vgdisplay
3. Create Logical Volumes
- Swap:
sudo lvcreate -L 96G -n lv_swap vg_sda - Root:
sudo lvcreate -l 100%FREE -n lv_root vg_sda - Home:
sudo lvcreate -l 100%FREE -n lv_home vg_nvme0
Verify the Logical Volumes:
sudo lvdisplay
4. Format Logical Volumes
I will be formatting the lv_root and lv_home Logical Volumes during the next section. It is not required to do it here.
Enable the swap Logical Volume:sudo mkswap /dev/vg_sda/lv_swap
Verify everything with this:
lsblk -f
You should see a representation of how you have partitioned your devices
5. Mount Points in Installer
I’m using ext4 for compatibility and performance.
- During installation, choose Something Else.
- Assign:
- /dev/mapper/vg_nvme0-lv_home: /home and format to ext4
- /dev/mapper/vg_sda-lv_root: / and format to ext4
- /dev/mapper/vg_sda-lv_swap: swap space
- /dev/sda1: EFI System Partition automatically formatted to (FAT32)
- /dev/sda2: /boot and format to ext4
- Set Device for boot loader installation to /dev/sda.
/dev/sdais used for boot loader installation because it houses the EFI System Partition, ensuring compatibility, reliability, and ease of management in a UEFI-based system.
6. Install Linux Mint
- You should now be ready to install. Click the Install Now button.
- You will see a summary of what the installer is going to do. If you are satisfied, click the Continue button.
Install and Set Up Ubuntu 22.04 Server
Posted by on March 13, 2023
This page will walk through what I did to install Ubuntu 22.04 Server for use in my home network.
I’m installing it as a Virtual Machine using Virtual Box 7.0, but these instructions should be valid if you are installing on a Physical Machine as well which I will do once I have confirmed this is working the way I expect it to.
Virtual Machine Specs
The Virtual Machine Specs I set up for this are:
| Memory | 4096 MB |
| Processor | 2 CPUs |
| Storage SATA Port 0 | 25 GB |
| Network | Bridged Adapter |
In VirtualBox 7.0 you can do what is called an Unattended Installation. I believe this is only available for certain Operating Systems but since I have not explored that option fully I am skipping it for now.
Follow these instructions to install Ubuntu 22.04 Server:
- Power on the Machine.
- When Presented with the GNU GRUB screen, select ‘Try or Install Ubuntu Server‘.
- Ubuntu starts the boot process.
- When Presented with a Language Selection Menu, select your language.
- Your keyboard configuration may already be selected for you. If not select your keyboard and then select ‘Done‘.
- Choose the Type of install. For this document I am going to choose ‘Ubuntu Server‘ and also select ‘Search for third-party drivers’.
- On the Network connections screen my network settings have been filled in automatically by DHCP. This is satisfactory for me so I choose ‘Done‘.
- On the Configure proxy screen you can choose to configure a proxy. This can be common in a corporate environment but in my case as my home network I don’t need to do this. Click ‘Done‘ when satisfied.
- On the Configure Ubuntu archive mirror screen you can safely click ‘Done‘ unless you know otherwise.
- On the Guided storage configuration screen I chose Use an entire disk and Set up this disk as an LVM Group. I did NOT encrypt. Select ‘Done‘.
- On the Storage configuration screen I accepted the summary and selected ‘Done‘.
- On the Confirm destructive action dialogue box I selected ‘Continue‘ since this is a new machine and I am confident I am not overwriting anything.
- On the Profile setup screen I typed my name, chose a server name, chose a user name and password then selected ‘Done‘.
- On the Upgrade to Ubuntu Pro screen select ‘Skip for now‘ then select ‘Continue‘.
- On the SSH Setup screen select ‘Install OpenSSH server’, then select ‘Done‘.
- On the Third-party drivers screen I see that “No applicable third-party drivers are available locally or online.” so I select ‘Continue‘.
- On the Featured Server Snaps screen I’m leaving it all blank. This document is about installing Ubuntu and not about snaps so I may do another document on that later. Select ‘Done‘.
- You will see a message that it is installing the system and then security updates. When it is ready you will be able to select ‘Reboot Now‘.
- Once you have rebooted you should be given a login prompt. You can now login with the user you created.
- When you login you will get some statistics about the system, one of which is the IP address. You can use that IP address to ssh to the host now and do some of the other things outlined in this document.
Additional Resources
Here are additional resources that will be useful in configuring your server.
Additional Useful Tools
Install additional packages:
$ sudo apt install members $ sudo apt install net-tools
Additional Pages to review
How to Install and Configure an NFS Server on Ubuntu 22.04
How to Install and Configure an NFS Server on Ubuntu 22.04
Recent Comments