Skip to content

Can't delete @.snapshots subvolume (BTRFS)

Heya! Loving BTRFS so far. Decided to do a new install with the archinstall script and use the default BTRFS subvolume layout. I'm trying to delete my @.snapshots subvolume in order to create a @snaphots subvol due to my OCD.

I've tried changing the permissions from RO to RW, deleting the default mount point at /.snapshots and re-mounting the subvol at /mnt/snapshots to no avail.

I'm running sudo btrfs subvolume delete /mnt/snapshots/@.snapshots with the error "ERROR: Could not statfs: No such file or directory"

If I try a different syntax with sudo btrfs subvolume delete /mnt/snapshots/ /@.snapshots I end up getting back

"Delete subvolume (no-commit): '/mnt/snapshots'

  ERROR: Could not destroy subvolume/snapshot: Invalid argument"

Any help would be much appreciated.

Cheers!

Edited 28 Jun 2022. We only hold this version.

11 points10 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
11 · 88% up
Kind
Text
ID
vm07ae

Author

10
posts
15
comments
2
media
View profile

10 comments

Why would you just not rename your subvolume?

mv @.snapshots @snapshots
8 points

When I run this I'm getting mv: cannot stat '@.snapshots': No such file or directory

Here are the results of sudo btrfs subvol list /.snapshots

ID 258 gen 1889 top level 5 path @log
ID 259 gen 1677 top level 5 path @pkg
ID 260 gen 1762 top level 5 path @.snapshots
ID 271 gen 1889 top level 5 path @home
ID 274 gen 1889 top level 5 path @

and sudo findmnt -nt btrfs

/                       /dev/sdb2[/@]           btrfs  rw,relatime,ssd,space_cache=v2,subvolid=274,subvol=/@
├─/.snapshots           /dev/sdb2[/@.snapshots] btrfs  rw,relatime,ssd,space_cache=v2,subvolid=260,subvol=/@.snapshots
├─/var/log              /dev/sdb2[/@log]        btrfs  rw,relatime,ssd,space_cache=v2,subvolid=258,subvol=/@log
├─/home                 /dev/sdb2[/@home]       btrfs  rw,relatime,ssd,space_cache=v2,subvolid=271,subvol=/@home
└─/var/cache/pacman/pkg /dev/sdb2[/@pkg]        btrfs  rw,relatime,ssd,space_cache=v2,subvolid=259,subvol=/@pkg

I'm also wondering why my @log and @pkg, and basically all my other subvolumes have lower ID's than my @ and @home. It should be reversed. I was playing around with timeshift BTRFS snapshots and it completely decimated my ID's and ended up having to delete the snapshots as they were in a completely different subvolume and directory. I ended up having to go back and change my actual ID, as it was providing the wrong subvolid on boot and would not boot. Going to use snapper from here on out, but would like to resolve these issues first.

1 points

It's easier to mount toplevel somewhere then just rename the subvol:

sudo mkdir /mnt/toplevel

sudo mount -o subvolid=5 /dev/disk... /mnt/toplevel

sudo mv /mnt/toplevel/@.snapshots /mnt/toplevel/@snapshots

5 points

So I'm just re-mounting top level to a different directory? What's the point of that, just curious. Can I not rename top level subvols unless it is mounted elsewhere than the default?

1 points

You need to mount it, so that you can access it. What do you mean by remounting? Top-level shouldn't be mounted, just sub volumes.

2 points

what does btrfs subvol list /mnt report?

Find the path for your @.snapshots subvol from above, and you should be able to delete that with the btrfs command.

Edit: you can also move/rename the @.snapshots subvol with just a mv [old/path] [new/path]

1 points

It reports this.

ID 258 gen 1889 top level 5 path @log
ID 259 gen 1677 top level 5 path @pkg
ID 260 gen 1762 top level 5 path @.snapshots
ID 271 gen 1889 top level 5 path @home
ID 274 gen 1889 top level 5 path @
2 points

Try:

# mkdir -p /mnt/btrfs_top
# mount -o subvol=/ /dev/sdb2 /mnt/btrfs_top
# btrfs subvolume delete /mnt/btrfs_top/@.snapshots
1 points

This worked. Thank you! :) Do you know why my subvol id's are basically upside down? Most of the time I see @ and being the lowest subvol ID, but in my case it's basically reversed.

It's super annoying this way, and the fact that there are also gaps in the subvolume ID's is also triggering my OCD, lol.

Maybe if I somehow umount them, they will re-order the IDs?

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.