BBS:      TELESC.NET.BR
Assunto:  Adding a hardware swap partition
De:       bp
Data:     Thu, 12 Mar 2026 10:00:01 +1100
-----------------------------------------------------------
Is there a "recipe" for adding a hardware swap partition to an
existing RasPiOS installation? Ideally I'd like a traditional
layout, with swap situated between / and /usr. I know how to
do it with FreeBSD during the install process but this particular
case involves a running, somewhat valuable RasPiOS installation
and the tools offered on RasPiOS are different enough to warrant
a study of prior art if it's available. 

What I'd like to do is resize the existing root to roughly its
present, occupied size, add a swap partition in the freed space
and then create /usr in the remaining space, copying the old
/usr to the new, cleaning out usr files from the original root 
partition and mounting the new /usr on the empty mountpoint. 

This needs to be done under single-user mode and I don't know
how to get at single-user in RasPiOS. It could be done via booting
from a microSD, but that pitches me into the installer which isn't
exactly familiar territory.

In case it matters, this is on an 8GB Pi5 running Bookworm with
dual monitors and a 1 TB mechanical hard drive. df reports

Filesystem     1K-blocks     Used Available Use% Mounted on
udev             4081296        0   4081296   0% /dev
tmpfs            1650304     6512   1643792   1% /run
/dev/sda2      961067256 61907904 850331260   7% /
tmpfs            4125728   163136   3962592   4% /dev/shm
tmpfs               5120       48      5072   1% /run/lock
/dev/sda1         522230    79520    442710  16% /boot/firmware
tmpfs             825136      272    824864   1% /run/user/1000

The need for "real" swap arises when Chromium and Firefox are both
running with multiple tabs open.

Thanks for reading, and any suggestions!

bob prohaska
 

--- PyGate Linux v1.5.12
 * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)

-----------------------------------------------------------
[Voltar]