3

I have an Arch Linux Installation on a btrfs filesystem partition "/dev/sda1":

[root@larch ~]# mount | grep sda
/dev/sda1 on / type btrfs (rw,relatime,ssd,space_cache,subvolid=266,subvol=/subvol_root)

As you can see, I do not mount the root volume but a subvolume called "subvol_root". When I mount the whole partition to /root/BTRFSROOT, you can see the current subvolumes:

[root@larch ~]# pwd
/root
[root@larch ~]# mount -o subvol=/ /dev/sda1 BTRFSROOT/
[root@larch ~]# btrfs sub list -apt BTRFSROOT/
ID  gen parent  top level   path    
--  --- ------  ---------   ----    
257 3239    5   5       subvol_root_borked
264 3350    5   5       snapshots
266 3358    5   5       subvol_root
267 3223    264 264     <FS_TREE>/snapshots/20190103-fresh-arch
268 302     264 264     <FS_TREE>/snapshots/20190104-pre-graphics
272 2275    264 264     <FS_TREE>/snapshots/20190106-pre-intel-driver
276 3250    264 264     <FS_TREE>/snapshots/20190107-pre-vbox
[root@larch ~]# 

I want to get rid of the subvol_root_borked, but I get the following error:

[root@larch ~]# btrfs sub delete BTRFSROOT/subvol_root_borked/
Delete subvolume (no-commit): '/root/BTRFSROOT/subvol_root_borked'
ERROR: Could not destroy subvolume/snapshot: Operation not permitted
[root@larch ~]# 

I created the subvol_root_borked by making a snapshot of subvol_root, but I have renamed it since the creation. I don't know the original snapshot name anymore. It may have also been initially created under the snapshots subvolume, but I'm not sure about that.

I was able to delete all of the contents within the subvolume, however:

[root@larch ~]# ls -lah BTRFSROOT/subvol_root_borked/
total 16K
drwxr-xr-x 1 root root  0 Jan  7 20:13 .
drwxr-xr-x 1 root root 94 Jan  4 00:24 ..

What is the problem with this subvolume / how can I further analyse this issue?

1
  • Worth checking to see if the subvolume you're trying to delete is set as the default volume - if so, you can't delete it without making another volume the default first.
    – Steve Dee
    Mar 5, 2022 at 10:18

1 Answer 1

2

If the subvolume in question is read-only, it cannot be deleted directly (even as root), it must be made writable first:

sudo su
btrfs property set -ts /BTRFSROOT/subvol_root_borked/ ro false
btrfs sub delete BTRFSROOT/subvol_root_borked/

You must log in to answer this question.

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