How to delete a btrfs snapshot?

Solution 1:

From the output, I am guessing that the subvolume of which you have snapshots is actually an ecryptfs private directory. If that is correct, can you try unmounting the private directory and then try to delete the snapshots?

The error message states that the device is in use. Assuming you are not using that directory as a current working directory, and no other process is actively using the data in the snapshot, that leaves the encryption layer to worry about.

EDIT: my original assumption was that you only had a Private folder encrypted. From your comments, I guess that your whole home is encrypted. So if we want to manipulate that, we need your home to be inactive. For a convenient way to deal with this, you can try the following:

A. Add another user to the system giving that other user administrative rights (i.e. the right to use sudo). Instructions for how to do this in Ubuntu: add a user, then give the user administrative rights

B. Log on with the newly created user. Now try to list and destroy the snapshots. Make sure the original user is not logged in, as that will trigger the decryption (and thus, the use) of you home directory.

C. Remove the user created in the first step, unless you see a need to keep it around.

Oh, and, please make sure you have a back-up of the file systems you manipulate. A mistake is quickly made.