Configure swap space on NBD volume

Using zram to compress pages did not provide enough memory to run
Firefox, Node, and Python for an extended period of time.  Here's hoping
swap-on-NBD will be fast and reliable enough to work.

Note that systemd's default behavior with respect to swap areas is to
enable them all rather early in the boot process, before the network is
fully configured.  As such, we have to use the *noauto* flag to disable
the default dependencies and add our own in a later target.
pull/1/head
Dustin 2022-03-31 11:49:39 -05:00
parent 1e96609ebc
commit 14d0cdcec1
5 changed files with 9 additions and 0 deletions

View File

@ -2,3 +2,4 @@ tmpfs /var/lib/rsyslog tmpfs defaults 0 0
tmpfs /var/log tmpfs defaults 0 0
tmpfs /var/lib/systemd tmpfs defaults 0 0
tmpfs /var/lib/NetworkManager tmpfs defaults 0 0
/dev/nbd1 swap swap noauto,x-systemd.makefs 0 0

1
overlay/etc/nbdtab Normal file
View File

@ -0,0 +1 @@
nbd1 pxe0.pyrocufflink.blue basementhud-swap

View File

@ -0,0 +1 @@
/usr/lib/systemd/system/nbd@.service

View File

@ -0,0 +1,5 @@
[Unit]
# All swap units have a default `Before=swap.target` dependency. This
# does not work for swap devices using NBD, because `swap.target` is
# reached before the network is up.
DefaultDependencies=no

View File

@ -0,0 +1 @@
../dev-nbd1.swap