Credit to @ryanc@infosec.exchange

I just did the graphic

you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 3 hours ago

btrfs's handling makes sense. The kernel talks to the disk directly, the file is just a pointer for what range it uses, and a placeholder for the filesystem. Something like raid, balancing, cow, all won't work because the kernel doesn't even go through btrfs to change the swap"file".
If you want a proper file as swapfile, with the corresponding overhead, you can make a regular file and mount it via loopback then use it as a swap device.

  • source
  • parent