Correct btrfs partitioning for timeshift

Quick to answer questions about finding your way around LMDE as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums within the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
linuxed
Level 3
Level 3
Posts: 109
Joined: Fri Nov 05, 2021 6:00 am

Correct btrfs partitioning for timeshift

Post by linuxed »

Hi. I installed linux on ext4, then converted to btrfs using btrfs-tools, and timeshift does not want to take snapshots in btrfs mode. I know it has to do with subvolumes, but how to edit them to not format them, I don't know. The layout is /dev/sda4 is /, /dev/sda5 is /home
Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
dhril
Level 1
Level 1
Posts: 9
Joined: Sun May 08, 2022 8:02 am

Re: Correct btrfs partitioning for timeshift

Post by dhril »

Hi,

root filesystem has to be mounted on subvolume named @ and same goes for /home on @home

Try creating snapshot of / and name it @ , than edit fstab to mount @ subvol and if you done it correctly you should reboot into @

btrfs subvolume snapshot / /@

Something like this should be in /etc/fstab

/dev/sda4 / btrfs defaults,space_cache,subvol=@ 0 1


Once you are satisfied you can mount volume root (/) and delete all above @ subvolume directory (parent)
Same process is for home.
Be careful as you may end with unbootable system if you mess it up.

You can also look into this once you create @ subvolume snapshot of / if you prefer it

btrfs subvolume set-default <subvolid> <path>
Set the default subvolume of the filesystem mounted as default.




Let me know if it helps
linuxed
Level 3
Level 3
Posts: 109
Joined: Fri Nov 05, 2021 6:00 am

Re: Correct btrfs partitioning for timeshift

Post by linuxed »

I have two btrfs partitions: home and root. Timeshift require on one partition?
linuxed
Level 3
Level 3
Posts: 109
Joined: Fri Nov 05, 2021 6:00 am

Re: Correct btrfs partitioning for timeshift

Post by linuxed »

I edited fstab, but system load in / not /@ (I see @ in root folder)
fstab:

Code: Select all

#UUID=e355ea87-c5b9-4ed8-a054-f50d0c4c4bb9 / btrfs defaults 0 1
/dev/sda4 / btrfs defaults,space_cache,subvol=@ 0 1
dhril
Level 1
Level 1
Posts: 9
Joined: Sun May 08, 2022 8:02 am

Re: Correct btrfs partitioning for timeshift

Post by dhril »

linuxed wrote: Wed May 11, 2022 9:33 am I have two btrfs partitions: home and root. Timeshift require on one partition?
It does not, you can have @ for root / and @home for /home
dhril
Level 1
Level 1
Posts: 9
Joined: Sun May 08, 2022 8:02 am

Re: Correct btrfs partitioning for timeshift

Post by dhril »

linuxed wrote: Wed May 11, 2022 10:16 am I edited fstab, but system load in / not /@ (I see @ in root folder)
fstab:

Code: Select all

#UUID=e355ea87-c5b9-4ed8-a054-f50d0c4c4bb9 / btrfs defaults 0 1
/dev/sda4 / btrfs defaults,space_cache,subvol=@ 0 1
Try adding subvolid option to fstab mount line.

Run

Code: Select all

# btrfs subvolume list /
ID 2210 gen 2251154 top level 5 path @
Then on its output locate ID of your @ snapshot (on my system is 2210) and of @home (do fresh / snapshot if this one is old, you can safely delete @ and recreate it with btrfs subvolume delete /@) recreate it, find its id and add subvolid=XXXX option to you fstab options.

If that fails try running btrfs subvolume set-default leaving the subvolid & subvol mount options in fstab

Be careful so you don't lose data if you mess something
linuxed
Level 3
Level 3
Posts: 109
Joined: Fri Nov 05, 2021 6:00 am

Re: Correct btrfs partitioning for timeshift

Post by linuxed »

linuxed wrote: Wed May 11, 2022 9:33 am I have two btrfs partitions: home and root. Timeshift require on one partition?
gpt partitions, not subvolumes
dhril
Level 1
Level 1
Posts: 9
Joined: Sun May 08, 2022 8:02 am

Re: Correct btrfs partitioning for timeshift

Post by dhril »

linuxed wrote: Sat May 14, 2022 12:02 pm
linuxed wrote: Wed May 11, 2022 9:33 am I have two btrfs partitions: home and root. Timeshift require on one partition?
gpt partitions, not subvolumes
I believe that it does not care because it works with subvolumes, as long as you have it on @ and @home subvolumes, I am not 100%, you can test that by trying.
Also In timeshift you can choose to snapshot only / should there be any issues with @home.

You may wish to look into apt-btrfs-snapshot if you want snapshot on each apt install/remove operation, though with apt-btrfs-snapshot you have to delete snapshots manually.

Let me know if any of this helped you so far.

Thanks
linuxed
Level 3
Level 3
Posts: 109
Joined: Fri Nov 05, 2021 6:00 am

Re: Correct btrfs partitioning for timeshift

Post by linuxed »

What i need to edit - /etc/fstab, or /@/etc/fstab?
dhril
Level 1
Level 1
Posts: 9
Joined: Sun May 08, 2022 8:02 am

Re: Correct btrfs partitioning for timeshift

Post by dhril »

linuxed wrote: Mon May 16, 2022 3:25 am What i need to edit - /etc/fstab, or /@/etc/fstab?
you need to edit /@/etc/fstab

My apologies I forgot to tell one critical part, that you also must modify grub configuration to start system from @ subvolume

I done this a while ago, and forgot the details, I can not offer you further assistance
dhril
Level 1
Level 1
Posts: 9
Joined: Sun May 08, 2022 8:02 am

Re: Correct btrfs partitioning for timeshift

Post by dhril »

Take a look at this one, though you do not need Live bootable media as you can boot the system as is, but I recommend you have one ready in case you render system ubootable

https://forum.peppermintos.com/index.php?topic=10162.0
linuxed
Level 3
Level 3
Posts: 109
Joined: Fri Nov 05, 2021 6:00 am

Re: Correct btrfs partitioning for timeshift

Post by linuxed »

idk
I uninstall LMDE (it works bad) and install ubuntu-mint already on btrfs. Topic is not solved, but I solve it by reinstalling.
Locked

Return to “Beginner Questions”