After having extended my own installation, I have tried to create the following Guide on how to do it.
How to extend your data disk permanently.
Applies to UmbrelOS 1.2.2 (Debian 12.6 [Bookworm] based)
Disclaimer
In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this guide.
Skill level: Medium
Requirements
I am going to utilize LVM2 and XFS for performance reasons.
ext4 has been out performed by LVM and XFS for the past 12 years.
Also I opened a root session instead of using sudo all the time.
To do so type “sudo -s”
The following packages needs to be installed:
lvm2, btrfsprogs, xfs-progs, fdisk
Install requirements
- sudo apt update; sudo apt upgrade -y;
- sudo apt install -y lvm2 btrfs-progs xfsprogs fdisk rsync;
- sudo mkdir -p /mnt/newdata
Your main disk is probably /dev/sda
Use “sudo lsblk” command to find your new disk(s).
I my case I added 2 SSD’s and they are named /dev/sdb and /dev/sdc
Use cfdisk to clear to disks and then create a new partition of 100% on each disk.
- sudo cfdisk /dev/sdb
- Delete all partitions
- Select “Write” and “Yes” (Uppercase Y)
- Select “New” and press Enter
- Select “Write” and “Yes” (Uppercase Y)
Repeat for the next disks.
LVM (Striping disks)
-
sudo pvcreate /dev/sdb /dev/sdc
-
sudo pvs
root@umbrel:/# pvs PV VG Fmt Attr PSize PFree /dev/sdb1 lvm2 --- 465.76g 465.76g /dev/sdc1 lvm2 --- 232.88g 232.88g
-
sudo vgcreate /dev/sdb /dev/sdc
root@umbrel:/# vgcreate vg_data /dev/sdb1 /dev/sdc1 Volume group "vg_data" successfully created
root@umbrel:/# vgs VG #PV #LV #SN Attr VSize VFree vg_data 2 0 0 wz--n- 698.64g 698.64g
-
sudo lvcreate --extents 100%FREE --name datastore vg_data
root@umbrel:/# lvcreate --extents 100%FREE --name datastore vg_data Logical volume "datastore" created.
root@umbrel:/# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log datastore vg_data -wi-a----- 698.64g
-
mkfs.xfs /dev/mapper/vg_data-datastore (for XFS) OR mkfs.btrfs /dev/mapper/vg_data-datastore (for BTRFS)
root@umbrel:/# mkfs.xfs /dev/mapper/vg_data-datastore ... Discarding blocks...Done.
-
mount /dev/mapper/vg_data-datastore /mnt/newdata/
-
rsync -a /data/ /mnt/newdata
(Wait for it to finish) -
vim /etc/fstab
-
Edit for your needs and add the following line after the /root line
/dev/mapper/vg_data-datastore /data auto defaults,x-systemd.growfs 0 0
-
Run:
systemctl daemon-reload
-
Run:
mount -a
-
Run:
ls -lah /data
-
Run:
lsblk
sdb 8:16 0 465.8G 0 disk └─sdb1 8:17 0 465.8G 0 part └─vg_data-datastore 254:0 0 698.6G 0 lvm
- Web-UI
Open the Umbrel Web UI and checkout your new and bigger data disk.