Sample Header Ad - 728x90

Error in btrfs-receive when directory was replaced with subvolume

2 votes
0 answers
49 views
One the directories in my machine has a high turn-over of very large files, so as I was snapshotting the file-system, those files began to fill-up my hard-drive. I transformed it into a btrfs subvolume so that the snapshots wouldn't contain them. I used something like the following commands:
mv $DIR $DIR.old
btrfs subvolume create $DIR
cp --reflink=always $DIR.old/. $DIR
rm -r $DIR.old
But now btrfs receive throws an error when I try to send the snapshots to my backup HD. The relevant lines when running it with --log debug are these:
unlink o822875-724-0/$FILE
rmdir o822875-724-0
ERROR: rmdir o822875-724-0 failed: Directory not empty
where $FILE is a file that was added to the directory just before the snapshot that is being sent. The question: how do I fix this? I don't care about preserving the contents of that directory across snapshots in my main HD or the backup one. I'd like to avoid doing a complete backup from scratch, both because I'd like to keep the current history, and because that takes time. Notes: I'm using btrbk for backups, but I managed to isolate the faulty command to the btrfs receive on the backup HD side. I know that directories with names such as o822875-724-0 have something to do with btrfs internals, even more so because I have no such directory in my filesystem, but I don't quite understand how that works.
Asked by Juan F. Meleiro (36 rep)
Jan 23, 2025, 02:46 PM