2

I cannot delete a the btrfs subvolume "2014-07-28" which is a snapshot of the "@" created by the kubuntu installer to serve as the kubuntu root.

teneighty@teneighty-MS-7924:/$ sudo mount -o subvolid=5 /dev/sda5 /mnt
teneighty@teneighty-MS-7924:/$ sudo btrfs sub list /mnt
ID 257 gen 1782 top level 5 path @
ID 258 gen 1574 top level 5 path @home
ID 266 gen 1761 top level 5 path 2014-07-28
teneighty@teneighty-MS-7924:/$ ls /mnt
@  2014-07-28  @home
teneighty@teneighty-MS-7924:/$ sudo btrfs sub del /mnt/2014-07-28/
Delete subvolume '/mnt/2014-07-28'
ERROR: cannot delete '/mnt/2014-07-28' - Operation not permitted

tried apt-btrfs-snapshot delete:

teneighty@teneighty-MS-7924:/$ sudo apt-btrfs-snapshot delete /mnt/2014-07-28/
Delete subvolume '/mnt/2014-07-28'
ERROR: cannot delete '/mnt/2014-07-28' - Device or resource busy

if it's busy, I shouldn't be able to do this, should I?

teneighty@teneighty-MS-7924:/$ sudo umount /mnt

but it unmounts quietly. Although I tested and it will unmount even if I have /mnt/2014-07-28 open in a file manager.

I created the snapshot after installing kubuntu 14.04, and then performed a substantial system update. After the update I created another snapshot, and I was able to delete that one without a problem. But the one I want to delete is the preupdate snapshot since everything is working fine post-update, I don't expect I will need to roll back to a fresh installion stage.

I have also attempted to delete it using the kubuntu live USB I installed from, that didn't work either. Then I tried apt-btrfs-snapshot delete, and

It is likely that this snapshot was originally located at @/snapshots/2014-07-28, and then I gained a better understanding of the ubuntu BTRFS layout from documentation at help.ubuntu.com, so I moved my snapshots to the root BTRFS volume. I tried to move it back, but it returned the same error.

What could be causing this error on a snapshot? Why would apt-btrfs-snapshot say it is busy? I don't know where to go from here, but as the file system changes, I am going to need that space back.

1
  • Did you use apt-btrfs-snapshot to create the snapshot?
    – mchid
    Jul 19 '16 at 16:44
0

First check which subvol is default by:

$ sudo btrfs subvol list /mnt/
ID 319 gen 508029 top level 5 path @plasma
ID 326 gen 508633 top level 5 path @
$ sudo btrfs subvol get-default /mnt/
ID 319 gen 508029 top level 5 path @plasma

I want to delete @plasma subvol. I had same error while I want to delete (Operation not permitted). You need to change default subvol:

$ sudo btrfs subvol set-default 326 /mnt/

Choose new default subvol by ID. After this you will be able to delete subvol:

$ sudo btrfs subvol delete -v /mnt/@plasma/
Transaction commit: none (default)
Delete subvolume (no-commit): '/mnt/@plasma'
0

check whether it is READ-ONLY and set to RW

 btrfs property set -ts ./MyClone/@home  ro false  

see also https://linuxreviews.org/Btrfs#the_HOWTO

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.