I am not able to include @home partition in Timeshift snapshotst

I do not use home for your user storage, but instead symlink all my storage locations to your home

1 Like

Not sure why your setup would be an issue. I just included my home directory in timeshift's settings and created a snapshot an it was not a problem.

Are you symlinking a garbage file system such as NTFS into your home directory? If so, that may be your issue.

1 Like

No.

My home is a separate partition, is this the problem?

 ~  lsblk                                     
NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0
       7:0    0  55.4M  1 loop /var/lib/snapd/snap/core18/2074
loop1
       7:1    0 110.9M  1 loop /var/lib/snapd/snap/sosumi/15
loop2
       7:2    0 162.9M  1 loop /var/lib/snapd/snap/gnome-3-28-1804/145
loop3
       7:3    0  65.1M  1 loop /var/lib/snapd/snap/gtk-common-themes/1515
loop4
       7:4    0  32.3M  1 loop /var/lib/snapd/snap/snapd/12398
loop5
       7:5    0 290.5M  1 loop /var/lib/snapd/snap/photogimp/141
loop6
       7:6    0 164.8M  1 loop /var/lib/snapd/snap/gnome-3-28-1804/161
loop7
       7:7    0  61.7M  1 loop /var/lib/snapd/snap/core20/1026
loop8
       7:8    0 260.7M  1 loop /var/lib/snapd/snap/kde-frameworks-5-core18/32
loop9
       7:9    0 225.3M  1 loop /var/lib/snapd/snap/riseup-vpn/172
loop10
       7:10   0 431.3M  1 loop /var/lib/anbox/rootfs
sda    8:0    0 931.5G  0 disk 
├─sda1
│      8:1    0     1G  0 part /boot/efi
├─sda2
│      8:2    0   100G  0 part /var/lib/anbox/rootfs/data
│                              /var/lib/anbox/rootfs/cache
│                              /root
│                              /var/log
│                              /var/cache
│                              /srv
│                              /var/tmp
│                              /
├─sda3
│      8:3    0   100G  0 part /home
├─sda4
│      8:4    0    16M  0 part 
├─sda5
│      8:5    0 324.5G  0 part 
├─sda6
│      8:6    0   280G  0 part /run/media/austin/5914db71-e77a-474e-8143-edad647064bd
├─sda7
│      8:7    0     6G  0 part [SWAP]
├─sda8
│      8:8    0    20G  0 part /mnt/data
├─sda9
│      8:9    0    50G  0 part 
└─sda10
       8:10   0    50G  0 part 
sr0   11:0    1  1024M  0 rom  
zram0
     254:0    0  11.4G  0 disk [SWAP]


1 Like

Any suggestions?

1 Like

Can we see the output of findmnt /home

1 Like

░▒▓    ~  findmnt /home                                                                                         ✔ ▓▒░
TARGET SOURCE    FSTYPE OPTIONS
/home  /dev/sda3 btrfs  rw,noatime,compress=zstd:3,space_cache,autodefrag,subvolid=5,subvol=/

1 Like

I am fairly certain that timeshift requires your subvolumes to start with @. I am nearly positive it won't support snapping the root of a btrfs partition.

I don't know if it supports snapshotting subvolumes across separate partitions.

A quick test would be to logout, switch a TTY and login as root. The do this:

btrfs subvolume snapshot /home /home/@home
umount /home
mount /dev/sda3 /home -o rw,noatime,compress=zstd:3,space_cache,autodefrag,subvolid=5,subvol=@home

Switch back to your graphical session, log in as your normal user and try timeshift again.

If it works, update /etc/fstab with the new subvolume.

5 Likes

But root snapshots work, it’s only a problem with home partition.
I will update you soon after following your instructions.

1 Like

I think you are confusing the root of the btrfs partition with your root filesystem. aka /.

More than likely, your root filesystem is not mounted at the root of your partition. It is probably in a subvolume named @

4 Likes

This is actually what happened,

  • I logged out and switched to TTY and ran the first command:
    btrfs subvolume snapshot /home /home/@home - it worked

  • Then, I tried the second command:
    umount /home - it gave error umount: /home: target is busy.
    I tried rebooting, and switching directly to TTY without logging in to graphical session, still didn't work.
    Then, I had to remove /home from /etc/fstab and then reboot.
    Now the /home directory was not mounted!

  • Then I tried the third command:

mount /dev/sda3 /home -o rw,noatime,compress=zstd:3,space_cache,autodefrag,subvolid=5,subvol=@home

it gave me errors -->

  • Then I tried to directly add the subvolume to /etc/fstab
    UUID=b04944ca-424b-4c09-8597-ded059f54bf5 /home btrfs subvol=/@home,defaults,noatime,space_cache,autodefrag,compress=zstd 02

Then I rebooted and logged in back to the graphical Interface. /home was mounted!

I created a snapshot from Timeshift, with /home enabled,
And it worked!

Thanks a lot @dalto

Now, I want to learn how all this BTRFS works.
Please suggest, if you know any nice source.

1 Like

I think your image link is broken.

I am not sure if it succeeded or failed. :neutral_face:

2 Likes

@dalto I have edited the above post.
Please do check, if I have done it correctly. :slightly_smiling_face:

Now my question is why didn't it work out-of-the box for me, but it worked for others? :thinking:

Your subvolumes seem to be setup wrong. Timeshift specifically requires @ and @home subvolumes. Now that its been fixed it works.

2 Likes

This is because you logged into the TTY as austin which puts the partition in use. You need to login to the TTY as root so that /home doesn’t get used.

That is my fault, you need to remove the subvolid=5 part. Sorry about that.

Yes. That works because you didn’t add the wrong part I gave you subvolid=5 :smiley:

Congrats!!!

A great idea!

I don’t know of one. I learned about btrfs by trying to do things, those things not working and me having to figure out how to fix them.

That being said, there probably is some stuff out there somewhere.

Because you created a separate /home partition which is a pretty non-standard thing to do on a btrfs install. In that case, the installer doesn’t create the @home subvolume.

One last important thing:
You need to cleanup the duplicate data in your btrfs partition.

Please be careful with this as we will be deleting data. You don’t need to do it from a TTY, you can use a normal terminal. It is something like this:

sudo mkdir /mnt/oldhome
sudo mount /dev/sda3 /mnt/oldhome
ls /mnt/oldhome

What you should see when you ls is something like this:

@home
austin

If you see something different, report back before deleting things.

If that is what you see then you should be able to delete that extra austin directory in /mnt/oldhome.

As always, it is a good idea to have backups on a separate disk before you delete things.

5 Likes

So when I did ls From /mnt/oldhome
I got the following results:

@home
austin
guest
timeshift-btrfs

I did sudo rm -rf austin guest
What about timeshift-btrfs is it supposed to be there?

Thanks a lot for supporting me :upside_down_face:

1 Like

That is probably your timeshift snapshots. I would leave that one alone.

I think you are good now.

If you want to double check you can use:

sudo btrfs subvolume list /home

That should show @home and all the timeshift snapshots.

4 Likes
~  sudo btrfs subvolume list /home                                                                      
ID 351 gen 73350 top level 5 path @home
ID 352 gen 73266 top level 5 path timeshift-btrfs/snapshots/2021-07-16_23-52-56/@home
ID 353 gen 73266 top level 5 path timeshift-btrfs/snapshots/2021-07-17_08-00-01/@home
ID 354 gen 73266 top level 5 path timeshift-btrfs/snapshots/2021-07-17_08-43-24/@home
ID 355 gen 73266 top level 5 path timeshift-btrfs/snapshots/2021-07-17_12-14-37/@home

Mission successful I think!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.