You are not logged in.

#1 2016-04-10 17:37:58

Mechanix
Member
Registered: 2016-04-06
Posts: 13

Can't delete a btrfs snapshot

Hi,

I can´t explain how I messed up my snapshots but I can´t delete them any more. Here is the list of all subvolumes und snapshots

ID 257 gen 4276 top level 5 path ROOT
ID 258 gen 4282 top level 257 path home
ID 259 gen 4252 top level 257 path root
ID 261 gen 3651 top level 257 path mnt
ID 262 gen 3197 top level 257 path opt
ID 263 gen 4282 top level 257 path var
ID 264 gen 4276 top level 257 path tmp
ID 266 gen 3182 top level 263 path var/lib/machines
ID 314 gen 4194 top level 5 path 1/snapshot
ID 315 gen 4218 top level 5 path 2/snapshot
ID 316 gen 4217 top level 315 path 2/snapshot/1/snapshot
ID 317 gen 4215 top level 315 path 2/snapshot/2/snapshot
ID 318 gen 4216 top level 315 path 2/snapshot/3/snapshot
ID 319 gen 4270 top level 315 path 2/snapshot/4/snapshot

When I try to delete the snapshot with

 btrfs subvolume delete 2/snapshot/4/snapshot

I get

ERROR: cannot access subvolume 2/snapshot/4/snapshot: No such file or directory

How do I get rid of those snapshots? Thank you.

Offline

#2 2016-04-10 17:55:02

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: Can't delete a btrfs snapshot

You need to give the full path of the subvolume. What subvolume do you have mounted as root?

Offline

#3 2016-04-10 17:58:58

Mechanix
Member
Registered: 2016-04-06
Posts: 13

Re: Can't delete a btrfs snapshot

Thank you for your reply. Here is the fstab entry for root:

UUID=xxxxxxxxxxxxxxx   	/         	btrfs     	rw,noatime,compress=lzo,space_cache,subvolid=257,subvol=/ROOT,subvol=ROOT	0 0 

Offline

#4 2016-04-10 18:03:54

Mechanix
Member
Registered: 2016-04-06
Posts: 13

Re: Can't delete a btrfs snapshot

This are the absolute paths:

D 257 gen 4326 top level 5 path <FS_TREE>/ROOT
ID 258 gen 4327 top level 257 path ROOT/home
ID 259 gen 4292 top level 257 path ROOT/root
ID 261 gen 3651 top level 257 path ROOT/mnt
ID 262 gen 3197 top level 257 path ROOT/opt
ID 263 gen 4327 top level 257 path ROOT/var
ID 264 gen 4322 top level 257 path ROOT/tmp
ID 266 gen 3182 top level 263 path <FS_TREE>/ROOT/var/lib/machines
ID 314 gen 4194 top level 5 path <FS_TREE>/1/snapshot
ID 315 gen 4218 top level 5 path <FS_TREE>/2/snapshot
ID 316 gen 4217 top level 315 path <FS_TREE>/2/snapshot/1/snapshot
ID 317 gen 4215 top level 315 path <FS_TREE>/2/snapshot/2/snapshot
ID 318 gen 4216 top level 315 path <FS_TREE>/2/snapshot/3/snapshot
ID 319 gen 4270 top level 315 path <FS_TREE>/2/snapshot/4/snapshot

Offline

#5 2016-04-10 18:22:40

Mechanix
Member
Registered: 2016-04-06
Posts: 13

Re: Can't delete a btrfs snapshot

OK, I got it working. I booted the arch rescue iso and mounted the fs like:

mount /dev/sda2 /mnt -o subvol=/ 

then I was able to delete those snapshots.

Thanks

Offline

#6 2016-04-12 01:08:53

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: Can't delete a btrfs snapshot

Just a quick note, you can create a mount point in your file system and then mount the snapshot (or in this case its parent subvolume) and delete it from there without having to use the live USB:

mkdir /mnt
mount -o subvol=/2/snapshot /mnt
btrfs delete /mnt/2/snapshot/4/snapshot

You couldn't access /2/snapshot b/c its at the same level as /ROOT, which you had mounted as /.

Last edited by wba072 (2016-04-12 01:09:33)

Offline

Board footer

Powered by FluxBB