# how to delete btrfs subvolume?

**URL:** <https://forums.suse.com/t/how-to-delete-btrfs-subvolume/32053>\
**Category:** SLES Configure-Administer\
**Created:** [February 22, 2018, 4:08pm UTC](https://forums.suse.com/t/how-to-delete-btrfs-subvolume/32053 "2018-02-22T16:08:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oz42](https://avatars.discourse-cdn.com/v4/letter/o/5e9695/32.png) [@oz42](https://forums.suse.com/u/oz42)\
**Post date:** [February 22, 2018, 4:08pm UTC](https://forums.suse.com/t/how-to-delete-btrfs-subvolume/32053/1 "2018-02-22T16:08:41Z")

</div>

Hi,

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

Olaf

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [February 22, 2018, 6:36pm UTC](https://forums.suse.com/t/how-to-delete-btrfs-subvolume/32053/2 "2018-02-22T18:36:37Z")

</div>

On 22/02/18 14:14, oz42 wrote:  
[color=blue]

> 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.

---

<div class="post-metadata">

**Author:** ![ElliottRScott](https://avatars.discourse-cdn.com/v4/letter/e/f6c823/32.png) [@ElliottRScott](https://forums.suse.com/u/ElliottRScott)\
**Post date:** [March 9, 2019, 7:03pm UTC](https://forums.suse.com/t/how-to-delete-btrfs-subvolume/32053/3 "2019-03-09T19:03:24Z")

</div>

Hi Simon,

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:

```auto
#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):
#
```

Thanks! Elliott

---

<div class="post-metadata">

**Author:** ![pwl0lwp](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pwl0lwp](https://forums.suse.com/u/pwl0lwp)\
**Post date:** [August 27, 2019, 5:12am UTC](https://forums.suse.com/t/how-to-delete-btrfs-subvolume/32053/4 "2019-08-27T05:12:22Z")

</div>

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](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:

# btrfs device usage /  
/dev/vda2, ID: 1  
Device size: 36.24GiB  
Device slack: 0.00B  
Data,single: 3.01GiB  
Metadata,DUP: 2.00GiB  
System,DUP: 16.00MiB  
Unallocated: 31.22GiB

(shows us the underlying device in this case is /dev/vda2)

we then use the “magic” subvolID 5 which always refers to the root filesystem  
(not sure where this is referenced)

[B]# mount -o subvolid=5 /dev/vda2 /mnt

# btrfs subvolume delete /mnt/@/opt

# umount /mnt[/B]

the good news is that if you use the YAST partitioner to delete the subvolumes, it will just work.
