Manual btrfs management

Thanks to forum and especially @eugen-b I know a lot about btrfs.

I would like to ask about one more.

I feel that I can’t be wrong.

If I have btrfs formatted partition. Let’s call it sda1
On this partition I have 2 subvolumes
@ for /
@home for /home

Fstab configured to boot from @

Can I in RUNNING system mount sda1 in /mnt with subvolud=5
So in mnt I’ll have @ and @home subvolumes visible
Then create snapshot of @ and @home
Let’s say @_bak @home_bak
Unmount /mnt
Do some things with the system
For example install Firefox and its configuration

Then mount sda1 in mnt again
Do btrfs subvolume delete for @ and for @home
Then do snapshots of @_bak and @home_bak
With original names so @ and @home

Can I do something like this on running system ?
Will this revert all changes made to @ and @home ?

If it’s not possible then can I just run live system and mount my hard disk inside and then do the btrfs operations ?

I would risk an experiment on a test system. I bet btrfs has some kind of precaution not to delete a subvolume of a running system.

I’ll try and let know

But a live cd way is proper right?

I can just do a snapshot of system partition and if I decide that I don’t like changes then I can just boot into live cd, delete subvolume with system and rename snapshot to the name of deleted subvolume.

Ok
I decided to try in my system
I have 3 subvolumes

@
@home
@cache

I did snapshots of ebery one with suffixes _test

In fstab I changed subvolumes
From @ to @_test
Etc

After reboot my system booted from test subvolumes

Then I did
mount -o subvolid=5 /dev/sda2 /mnt

I deleted subvilumes @_test, @home_test, @cache_test
Those actively mounted

Enter deletion I did edition of my fstab
@_test → @
@home_test@home
@cache_rest@cache

After reboot everything is working.
On test subvolumes I did some tests. Crated folders on desktop
Everything is gone :slight_smile: