Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8037

General discussion • Re: Moving root to LVM on Raspberry Pi OS Lite 64 bit...

$
0
0
How would I go about setting this up so that I can limit the actual OS to say 100GB of the first drive, set up as the first PV and then attach the 2nd and 3rd drives (The USB 3 SSDs) as additional PVs, add them all to a VG, and slice out my LVs from there...
You will have to read manuals; typically 'man lvm' you'll see an overview, then basics like vgcreate ... and lvcreate ... can do what you want as first setup.
I would not put RPiOS64 itself on LVM, instead use a simple basic bootfs and rootfs (partition 1 and 2). So you can maybe swap OS or even architecture. I currently have setup my Pi4 and some intel PC in such a way that I can transparently swap the OS. So the LVM (cached setup, 1 HDD, 1 SSD) can be operated by both Arm and Intel Linux (similar Debian Linux flavor).

Putting root on LVM is a matter of making sure LVM tools are called/run in initrd. Is not RPi specific, better search internet. What is RPi specific is that RPL does offer a normal Linux setup method. For RPi3 and RPi4 there is good enough free UEFI firmware available https://github.com/pftf/RPi4 , if you use that, you can install vanilla Debian Linux on RPi (or generic whatever aarch64 computer) like you can on x86-64.
For an existing running system, it is a matter of copying to an extra LVM prepared block device and change/fix cmdline.txt and fstab with the correct UUID of the filesystem.

If you do not intent to use caching or any other LVM specific features, you are more flexible with using Btrfs for your multiple devices. It is very easy to add (and also remove) devices adhoc in a running system. Also there, read documentation https://btrfs.readthedocs.io/en/latest/ ... ement.html and maybe more important, practice first. Test things and maybe do some small sabotage yourself first and see if you can recover it. I have also some older PC with several older smaller HDDs put as 1 volume, it is great, but of course if 1 HDD fails (or flaky power, cable) your whole filesystem is more or less lost. But great for extra backup clones etc.

Statistics: Posted by redvli — Sat Feb 08, 2025 10:14 am



Viewing all articles
Browse latest Browse all 8037

Trending Articles