Trying to create a read-only snapshot of the root subvolume using

sudo btrfs sub snap -r /mnt/@ /mnt/@_20200510

leads to error message

Create a readonly snapshot of '/mnt/@' in '/mnt/@_20200510'
ERROR: cannot snapshot '/mnt/@': Text file busy

Also, snapper and other backup tools stopped working.

1 Answer 1


Turn off and delete the swapfile.

Linux 5.x introduced official swapfile support for Btrfs. Unfortunately, this support appears to be, ahem, incomplete. I suppose what is happening is that a subvolume which contains an open non-COW file cannot be snapshotted (snapshot? snapfleshwounded?). On some level this makes complete sense. On another, wtf. sigh.

If you want to use a swapfile, I think it should be fine to create a separate subvolume, however I have not tested this. Otherwise, you really do need to delete the swapfile before making the snapshot otherwise the file will get reflinked, stop being non-COW even though you marked it as such, and swapon won't work.

  • Creating a separate subvolume is described here, and works for me under Ubuntu 21.04 with 5.11 kernel.
    – rvf
    May 24, 2021 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.