How to Install Arch Linux with LVM
Categories:
4 minute read
Installing Arch Linux is a rewarding journey for users who prefer control, customization, and a deeper understanding of Linux. When combined with LVM (Logical Volume Manager), Arch becomes even more flexible, especially for disk management tasks like resizing partitions or creating snapshots. This guide walks you through the process of installing Arch Linux with LVM, from booting into the ISO to the final reboot into your new system.
1. Introduction to LVM
LVM stands for Logical Volume Manager. Unlike traditional partitioning, LVM abstracts physical storage into flexible volumes. You can resize, move, or snapshot these logical volumes on the fly, which is particularly useful for complex setups or systems expected to grow.
Benefits of using LVM include:
- Dynamic resizing of volumes.
- Easier management of multiple file systems.
- Snapshot capabilities.
- Combine multiple disks into one volume group.
2. Prerequisites
Before starting the installation:
- Back up your data: Installing Arch will erase all data on the target drive.
- Have an internet connection: A working network is required to fetch packages.
- Download Arch Linux ISO: Get it from archlinux.org.
- Create a bootable USB drive: Use
dd
,Rufus
, orEtcher
. - Familiarity with terminal commands: This guide assumes basic command-line knowledge.
3. Booting into Arch Linux
- Boot from the USB drive.
- At the boot menu, choose the first option: “Arch Linux Install Medium”.
- Once booted, you will land in a terminal environment.
4. Setting up Networking
Check internet connectivity:
ping archlinux.org
If you are connected via Ethernet, DHCP usually takes care of networking. For Wi-Fi:
iwctl
Inside iwctl
, run:
station wlan0 scan
station wlan0 get-networks
station wlan0 connect <SSID>
Verify connection:
ping archlinux.org
5. Disk Partitioning
Identify your disk:
lsblk
Assume the disk is /dev/sda
. Partitioning with gdisk
:
gdisk /dev/sda
Create:
- EFI System Partition (ESP) (if using UEFI): 512M, type
ef00
- LVM Partition: Rest of the space, type
8e00
(Linux LVM)
Write and exit gdisk
.
6. Creating LVM Setup
Load LVM kernel module
modprobe dm_mod
Create Physical Volume
pvcreate /dev/sda2
Create Volume Group
vgcreate vg0 /dev/sda2
Create Logical Volumes
lvcreate -L 30G vg0 -n root
lvcreate -L 4G vg0 -n swap
lvcreate -l 100%FREE vg0 -n home
You now have three logical volumes:
/dev/vg0/root
/dev/vg0/swap
/dev/vg0/home
Activate Logical Volumes
vgchange -ay
7. Creating Filesystems
Format the partitions:
mkfs.fat -F32 /dev/sda1 # EFI Partition
mkfs.ext4 /dev/vg0/root # Root filesystem
mkfs.ext4 /dev/vg0/home # Home filesystem
mkswap /dev/vg0/swap # Swap
8. Mounting the Filesystems
Mount root:
mount /dev/vg0/root /mnt
Create and mount boot and home directories:
mkdir /mnt/boot
mkdir /mnt/home
mount /dev/sda1 /mnt/boot
mount /dev/vg0/home /mnt/home
Enable swap:
swapon /dev/vg0/swap
9. Installing the Base System
Use the pacstrap
command:
pacstrap /mnt base linux linux-firmware lvm2 vim nano networkmanager
Generate fstab:
genfstab -U /mnt >> /mnt/etc/fstab
10. Configuring the System
Chroot into the installed system
arch-chroot /mnt
Set time zone
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc
Set locale
Edit /etc/locale.gen
and uncomment your locale (e.g., en_US.UTF-8 UTF-8
), then run:
locale-gen
Create /etc/locale.conf
:
echo "LANG=en_US.UTF-8" > /etc/locale.conf
Set hostname
echo "archlvm" > /etc/hostname
Edit /etc/hosts
:
127.0.0.1 localhost
::1 localhost
127.0.1.1 archlvm.localdomain archlvm
Set root password
passwd
11. Installing and Configuring the Bootloader
Install bootloader packages
pacman -S grub efibootmgr
Mount EFI if not already
mount /dev/sda1 /boot
Enable LVM support for the initramfs
Edit /etc/mkinitcpio.conf
, find the line:
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
Change it to:
HOOKS=(base udev autodetect modconf block lvm2 filesystems keyboard fsck)
Then regenerate the initramfs:
mkinitcpio -P
Install GRUB
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
Configure GRUB
grub-mkconfig -o /boot/grub/grub.cfg
12. Post-Installation Tips
Before rebooting:
- Enable the network manager:
systemctl enable NetworkManager
- Exit chroot and unmount:
exit
umount -R /mnt
swapoff -a
- Reboot:
reboot
Remove the installation media and boot into your new Arch Linux system.
13. Conclusion
Installing Arch Linux with LVM is not overly complicated, but it does require attention to detail and a basic understanding of how disks and volumes are managed. LVM provides significant flexibility and is especially useful for users planning to host multiple virtual machines, grow their storage over time, or snapshot systems before major changes.
This guide gave you a step-by-step walkthrough of the entire process—from booting into the live environment to creating logical volumes and finally configuring a working Arch system. Once your system is up and running, you can customize it to your liking—whether it’s setting up a desktop environment, hardening security, or automating updates.
With Arch Linux and LVM, you’re in full control.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.