From 79dddd7f49a855bcf708d3b69f1936a83b99da7f Mon Sep 17 00:00:00 2001
From: Le0xFF <43521247+Le0xFF@users.noreply.github.com>
Date: Wed, 27 Jul 2022 16:30:45 +0200
Subject: [PATCH] Improve README with instruction for adding more space Added
some instructions for how to add more space easily with LVM
---
README.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 7d2d287..a67dd1b 100644
--- a/README.md
+++ b/README.md
@@ -156,7 +156,7 @@ reboot
-# What to do if system breaks?
+## What to do if system breaks?
In case anything will break, you will just have to delete the `@` subvolume, create it again and reinstall your distro. `/home` folder won't be affected in any way.
@@ -209,6 +209,59 @@ chown -R : /home/
+## How to add more space with a new drive with LVM
+
+> Probably the following could also be done from a running system, but maybe it's better to boot a LiveCD just in case.
+
+First a new physical drive must be added to the system. This drive in the following example will be called `/dev/sda`.
+
+After booting a LiveCD, mount the encrypted partition:
+
+``` bash
+cryptsetup open /dev/nvme0n1p2
+```
+
+Scan for Volume Groups and then enable the one you need:
+
+``` bash
+vgscan
+vgchange -ay
+```
+
+Scan for Logical Volumes and then enable the one you need:
+
+``` bash
+lvscan
+lvchange -ay /
+```
+
+Then a new Physical Volume for the new drive must be created:
+
+``` bash
+pvcreate /dev/sda
+```
+
+After that it must be added to the existing Logical Volume:
+
+``` bash
+vgextend /dev/sda
+```
+
+Then the Logical Volume must be extended to cover the new free space:
+
+``` bash
+lvm lvextend -l +100%FREE /
+```
+
+Finally also the BTRFS filesystem must be extended to cover all the free space; to do that, the BTRFS partition must be mounted:
+
+``` bash
+mount -t btrfs /dev/mapper/- /mnt/
+btrfs filesystem resize max /mnt/
+```
+
+
+
## Notes
- To speed up decryption at boot you could lower the number of iteration for each key as described on the [Arch Wiki](https://wiki.archlinux.org/title/GRUB/Tips_and_tricks#Speeding_up_LUKS_decryption_in_GRUB), but keep in mind that this comes with its own security concerns.