[Freedombox-discuss] Occasional freezes

Sam Hartman hartmans at debian.org
Thu Jan 31 22:07:27 GMT 2019

>>>>> "permondes" == permondes  <- sagen <sagen at permondes.de>> writes:

    permondes>    Oh Sh....  Swap files are not allowed on btrfs

    permondes>    manpages say:

You can use a loop device though.
So something like
touch /swap.out
chattr +C /swap.out #disable copy on write
dd if=/dev/zero bs=1024k count=size_in_mb of=/swap.out # allocate space

losetup --show --direct-io=on -f /swap.out # prints loop device
mkswap /dev/loopnnn
swapon /dev/loopnnn

This will introduce a performance penalty through the loop driver, but
will avoid the issues the btrfs man page is talking about.
It's almost certainly faster than zram.

More information about the Freedombox-discuss mailing list