2

I created a btrfs snapshot some time ago and now I want to delete it, as it appears to be taking up a lot of space.

When I list snapshots, I get:

11:59:16::root@pounamu::/mnt 
↪ btrfs subvolume list /
ID 257 gen 99338 top level 5 path @
ID 258 gen 99338 top level 5 path @home
ID 263 gen 99315 top level 5 path @home/.ecryptfs/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29

I believe the snapshot I want to delete is the last one, so I run:

11:58:29::root@pounamu::/mnt 
↪ btrfs subvolume delete /home/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29/
Delete subvolume '/home/.ecryptfs/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29'
ERROR: cannot delete '/home/.ecryptfs/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29' - Device or resource busy

Unfortunately, it says, "Device or resource busy". This makes me very nervous because it makes it appear that I might be deleting something I shouldn't. Nevertheless, I've tried logging in as another user in order to free up the device. Unfortunately, when the user is not logged in, the directory (snapshot) doesn't exist because the encrypted directory isn't mounted! This feels like a major cache 22: I can't delete it when logged in because it's busy; I can't delete it when logged out because it doesn't exist!

I'm fairly certain all my headaches are because I'm trying to use an encrypted home directory with btrfs. Can somebody help me to 1) Confirm that I'm not deleting something I should keep, and 2) Sort out how to delete the snapshot?

1 Answer 1

4

After having a very fruitful conversation on the btrfs IRC channel, we were able to get this fixed. The solution, as I understand it, was to:

1. Remount the root (top-level) subvolume to a new mount point (this moves it out of the working directories)

mount -o subvol=/ /dev/sda6 /mnt/

2. Delete the snapshot

btrfs subvolume delete /home/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29/

3. umount the root subvolume.

umount /mnt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .