how can I delete an existing btrfs subvolume? The documentation is poor, so I tried this:
btrfs subvol list /
ID 256 gen 114 top level 5 path @
ID 257 gen 135 top level 256 path @/.snapshots
ID 258 gen 137 top level 257 path @/.snapshots/1/snapshot
ID 259 gen 114 top level 256 path @/boot/grub2/i386-pc
ID 260 gen 114 top level 256 path @/boot/grub2/x86_64-efi
ID 261 gen 130 top level 256 path @/home
ID 262 gen 114 top level 256 path @/opt
ID 263 gen 114 top level 256 path @/srv
umount /home
btrfs subvol delete @/home
ERROR: cannot access subvolume @/home: No such file or directory
btrfs subvol delete @home
ERROR: cannot access subvolume @home: No such file or directory
btrfs subvol delete /@home
ERROR: cannot access subvolume /@home: No such file or directory
btrfs subvol delete /home
ERROR: not a subvolume: /home
btrfs subvol delete home
ERROR: cannot access subvolume home: No such file or directory
how can I delete an existing btrfs subvolume? The documentation is poor,
so I tried this:
btrfs subvol list /
ID 256 gen 114 top level 5 path @
ID 257 gen 135 top level 256 path @/.snapshots
ID 258 gen 137 top level 257 path @/.snapshots/1/snapshot
ID 259 gen 114 top level 256 path @/boot/grub2/i386-pc
ID 260 gen 114 top level 256 path @/boot/grub2/x86_64-efi
ID 261 gen 130 top level 256 path @/home
ID 262 gen 114 top level 256 path @/opt
ID 263 gen 114 top level 256 path @/srv
umount /home
btrfs subvol delete @/home
ERROR: cannot access subvolume @/home: No such file or directory
btrfs subvol delete @home
ERROR: cannot access subvolume @home: No such file or directory
btrfs subvol delete /@home
ERROR: cannot access subvolume /@home: No such file or directory
btrfs subvol delete /home
ERROR: not a subvolume: /home
btrfs subvol delete home
ERROR: cannot access subvolume home: No such file or directory[/color]
What does “btrfs subvol show /home” output?
HTH.
Simon
SUSE Knowledge Partner
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below. Thanks.
Sorry, I don’t mean to hijack this old thread, but it perfectly describes my scenario as well, and the originator never replied to your question. Here’s the output from executing the command on my system:
#btrfs subvol show /home
@/home
Name: home
UUID: 70dac317-4b49-a94e-b047-39b738307260
Parent UUID: -
Received UUID: -
Creation time: 2019-03-09 09:02:37 -0600
Subvolume ID: 264
Generation: 217
Gen at creation: 25
Parent ID: 257
Top level ID: 257
Flags: -
Snapshot(s):
#
even though this thread is old, the answer needs to be documented:
you can’t just do btrfs subvol delete /opt (or whatever) because the parent root filesystem isn’t technically “mounted” on the system in the normal way (it’s a “Flat” layout as described in https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Flat )
you have to re-mount the filesystem on another path & then delete the subvolume using that path. for example:
the necessary approach is to find the mount the filesystem again on a separate mountpoint and then delete that path, for example: