New iSO BTRFS newbie here

Got it :slight_smile:
Had to change the command path to /mnt/@old/.
It was missing the @old part =)

20210827_182430

1 Like

Yes, it’s easier, but not better :slight_smile:
If I liked easy things, I would be using Windows hehe

1 Like

Yep. That is my fault. Sorry about that.

1 Like

No need to sorry Dalto, you helped me a lot, really thanks about that.
Who should be thanking and asking for sorry here is me, mostly about my newbie side about BTRFS in first place… =)

1 Like

Okay so if i have this right you boot on the live ISO. Then you mount the root partition. Then you mv or copy? the @ subvolume which is root to @old. Then you create a subvolume of the snapshot in @old of the one you are replacing it with and then copy the @old to @. Then delete the old. So it copies everything from the snapshot that you select back to the @ and you deleted the one you copied to @old.

Am i understanding this right?

I am eating right now so I don’t have time to elaborate but the short answer is “No” :laughing:

4 Likes

I hate to hear the long answer! :rofl:

2 Likes

Yes, that was it. EDIT: If Dalto says its not right, it’s definitely not kkkkkk
1 First you need to list the snapshots to see what snapshot you will use.
2 Boot to live USB
3 mount the / partition (if you have only one BTRFS partition, that will be it, it’s where root is).
4 move the @ to @old exactly as Dalto showed
5 Assuming the snapshot choosen is 3: use the command: sudo btrfs subvolume snapshot /mnt/@old/.snapshot/3/ mnt/@
6 sudo mv @old/.snapshots/ /mnt/@/.
The command above is in order to move your “.snapshots” subvolume of out of the oldroot into the new as stated by Dalto
7 sudo btrfs subvolume delete /mnt/@old
Command above is to optionally remove the old subvolume if you don’t need it anymore as also stated by Dalto

1 Like

I understand it in my mind sort of? Maybe? Not really…partially? Okay i admit it. No!

That is normal ricklinux, let’s learn together
You can’t move a partition in which you are booted, so you need to boot into live USB
Then, you move the @ to @old, so you can replace @ with something new.
Then, you use the btrfs command to generate the new @
After that, you copy the snapshots from old to the new @ so you don’t lose the snapshots
Last step is to remove @old

Please someone correct me if I got this wrong ok? :slight_smile:

1 Like

An unrelated but somewhat related question:
Is it possible to convert a ro snapshot taken by snapper to rw from a running system?

I have also understood it the same way as you do.
Perhaps we are both wrong :sweat_smile:

1 Like

How do you get the r/w snapshots anyway because @dalto told me it’s not a good idea to make the snapshots r/w?

1 Like

I don’t think you can convert it but you can take a rw snapshot of a ro snapshot.

Looks right to me.

1 Like

During the process, I wasn’t sure about what I was doing… and also, if I would be able to boot back to my system =) Not using a VM
@ricklinux, just stored the commands above in a text file in case things go south, it may save us

1 Like

So let’s assume that I want to “make” rw the snapshot /.snapshot/3/snapshot in running system, will I get a top level subvolume which is rw? (sorry if I am expressing me clumsily).

So actually my idea is to mount it via /etc/fstab in order to boot back to a previous state of the system.

Or another question, will rw ,xxxxx,subvol=nnn in fstab work to boot into an snapshot and kind of have it as a rolled back, functioning system?

I am not sure what you mean by “top level”. The number after top level simply refers to where you put it. If you put it “under” another snapshot that will be the top level. If you put it at the root of the partition, it’s top level will be 5.

Perhaps if you asked a more practical question? In other words, why do you want to have a rw copy of that snapshot?

Please see my post above again. I tried to be more clear about what I have in mind.

The first problem is that the root partition isn’t generally mounted by /etc/fstab, it is mounted by the kernel/initramfs directly. So, what you are trying to do will work but you have to get it into your boot manager, not /etc/fstab

Ahh…that is pretty obtuse. A snapshot is a subvolume so you should just be able to take your existing line in /etc/fstab which either should have something like subvolid=257 or subvol=@ and replace it with either the number or path to the new subvolume.