Timeshift and mount points

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
SuperBoby
Level 1
Level 1
Posts: 23
Joined: Wed Nov 21, 2018 2:33 pm

Timeshift and mount points

Post by SuperBoby » Wed Nov 21, 2018 3:45 pm

Hi everyone,

Though I am not new to Linux, I am new to Linux Mint ; and I came across something weird.

When I first installed the system, I activated right away the snapshots with Timeshift. I think it worked OK, but never opened Timeshift again to check.

Today at some moment, my system starts to get unstable. I wasn't doing anything critical at all, so I tried some things and finally resorted to rebooting. On the next reboot , lightdm started to loop the login phase, which gave away the problem thanks to BobSongs in this post : viewtopic.php?t=261704

So I went into tty, and $ df -h told me that / was COMPLETELY full. Not a single byte left. :shock:

So I started to # du -hs everything in / to find the culprit (without autocompletion, because apparently bash needs disk space for that :mrgreen: ). And /timeshift was the guilty directory. So I emptied it, restarted lightdm, disabled the scheduled snapshots and it was back to normal.


Then I digged some more into it.

This never happened before today, and I never touched any Timeshift settings since the installation. The one "mistake" I did related to this was to manually editing /etc/fstab to permanently mount my other partitions. I have in total 3 mounted partitions :
  • /dev/sda7 to /
  • /dev/sda6 to /localdisks/os1
  • /dev/sda8 to /localdisks/commonhome
It looks like Timeshift tried to include /localdisks in its snapshot, and of course, both those partitions are bigger than the root one. Hence the saturation caused by Timeshift.


I have several questions regarding this issue :
  • Was I wrong to manually edit /etc/fstab to make my permanent mount points ? Is there a Linux Mint way of doing it that I missed ? I'm asking this, because :
  • Shouldn't there be a disk usage threshold for timeshift ? It would default to the current available disk space, with a user setting on top of it to further restrict it if needed. Then, if Timeshift doesn't have enough space to do a snapshot, it should abort and trigger a warning.
If the answer to the first question is "yes", then, ok, Timeshift wasn't aware of my mount points and saw the directory as any other. But if it is "no", then shouldn't Timeshift automatically exclude external filesystems to its operation ?


Thanks for your time !
LMDE 3 Cindy x64
Lenovo Thinkpad T410

User avatar
philotux
Level 3
Level 3
Posts: 147
Joined: Sat Jul 21, 2018 11:14 am

Re: Timeshift and mount points

Post by philotux » Wed Nov 21, 2018 4:49 pm

One thing you could do is to mount the partitions in question under /mnt. By default, Timeshift will exclude /mnt/* (see: Timeshift-Settings-Filters-Summary).

Another thing is to dedicate a separate EXT-formatted partition (could be on an external drive) for Timeshift to store its snapshots on.

User avatar
philotux
Level 3
Level 3
Posts: 147
Joined: Sat Jul 21, 2018 11:14 am

Re: Timeshift and mount points

Post by philotux » Wed Nov 21, 2018 5:11 pm

You could actually add your own filters too for what to be excluded from the snapshots in Timeshift:Settings:Filters.

User avatar
AZgl1500
Level 9
Level 9
Posts: 2875
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: Timeshift and mount points

Post by AZgl1500 » Wed Nov 21, 2018 5:42 pm

I have all of my backups including Timeshift on a separate partition, so the OS is never effected.
Timeshift might fail, but it won't because I watch it once in a while, and get rid of the older backups.

Setting up filters to negate something you don't want to be included is easy.

The ONLY automatic backups that I allow Timeshift to do, is 5 daily backups, always deleting the 6th one. so it stays at 5 Daily Backups.

I do a few Manual Backups, always just prior to installing new software....
and that is it....

Timeshift is a great tool, but it can be dangerous if allowed to run on the initial default settings.
Last edited by AZgl1500 on Wed Nov 21, 2018 8:10 pm, edited 1 time in total.

SuperBoby
Level 1
Level 1
Posts: 23
Joined: Wed Nov 21, 2018 2:33 pm

Re: Timeshift and mount points

Post by SuperBoby » Wed Nov 21, 2018 6:44 pm

Thanks for your fast answers and recommendations.

I have indeed excluded the mount points from Timeshift when I realised that ; however I think it is a better practice for me to move my mount points under /mnt.

I have a subsequent question : let's say that my new /dev/sda6 mount point is /mnt/localdisks/os1. If I create a symlink /localdisks pointing to /mnt/localdisks, will it be automatically excluded from Timeshift under the default /mnt exclusion rule ?


Also, do you think it would be an interesting feature request for Timeshift to trigger a warning in case of disk space shortage ?
LMDE 3 Cindy x64
Lenovo Thinkpad T410

User avatar
philotux
Level 3
Level 3
Posts: 147
Joined: Sat Jul 21, 2018 11:14 am

Re: Timeshift and mount points

Post by philotux » Wed Nov 21, 2018 6:51 pm

I am not really sure about that. But I think the mountpoint ought to be excluded at any rate.
I can't tell :?

User avatar
AZgl1500
Level 9
Level 9
Posts: 2875
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: Timeshift and mount points

Post by AZgl1500 » Wed Nov 21, 2018 8:16 pm

I went ahead and specifically filtered out the /media/....../backup even though "it should be filtered out anyway"

Filter Timeshift.png

Gparted2.png

SuperBoby
Level 1
Level 1
Posts: 23
Joined: Wed Nov 21, 2018 2:33 pm

Re: Timeshift and mount points

Post by SuperBoby » Sat Nov 24, 2018 7:06 am

Ok thanks for all your replies. I have opened a feature request for a warning for disk usage, because I think many other use cases would be benefiting from this.
LMDE 3 Cindy x64
Lenovo Thinkpad T410

axisofevil
Level 2
Level 2
Posts: 85
Joined: Mon Nov 14, 2011 12:22 pm

Re: Timeshift and mount points

Post by axisofevil » Sat Dec 01, 2018 6:29 pm

Why are there 3 (at least) supplied directories supplied for mounts?
/mnt
/media
/opt
Actually, /media seems to gets used by automount - although I'm not sure about that.

If you allocate a partition for timeshift and give it a label (so you can see what it is in gparted etc).
Mount it via fstab in /mnt as otherwise it will be automounted (like a USB stick) and very likely shown as a device on your desktop.
Example:-

Code: Select all

UUID=a83d70e0-bbf7-4810-8647-d7aa7472927d	/mnt/timeshift   ext4	rw,errors=remount-ro    0 0
A separate partition stops it writing over valuable data!

SuperBoby
Level 1
Level 1
Posts: 23
Joined: Wed Nov 21, 2018 2:33 pm

Re: Timeshift and mount points

Post by SuperBoby » Thu Dec 06, 2018 7:08 am

Since I had the problem I indeed moved my timeshift directory to a separate partition, but thanks !

But even in this case, I think Timeshift should warn the user if it has filled up its partition while creating a snapshot, because it will prevent future snapshots to be made
LMDE 3 Cindy x64
Lenovo Thinkpad T410

Nuts2u
Level 1
Level 1
Posts: 27
Joined: Sun Nov 27, 2011 8:44 pm

Re: Timeshift and mount points

Post by Nuts2u » Thu Dec 06, 2018 3:17 pm

Below is a shot of my timeshift storage on my @home btrfs system. I have it setup using the schedule system as follows: 5 daily, 3 weekly, 2 monthly. As you can see timeshift using the btrfs snapshot is very very space efficent, and I have full access to all the data. BTRFS snapshots are the only way to use timeshift to it's fullest use in my opinion.

There is some work involved converting from ext to btrfs but it is well worth the time and effort...just my opinion. I converted to btrfs about 6 months ago and I would never, never go back to ext 4. Btrfs snapshots are the future....They are not to be used in place of backups...no way. I do a full disk image back up every Sat using Clonezilla. But the esae of reverting to a prior btrfs snapshot using timeshift, (in case you update a system file and it breaks) happens in a instant. You reboot and there is your restored system. I also allow timershift to take snapshots of my @home btrfs volume also, so the totals displayed are also my @home volume.

screen02.jpg
Silence is golden. Duct tape is silver. Welcome to Hell. Here's your copy of Windows.

Nuts2u
Level 1
Level 1
Posts: 27
Joined: Sun Nov 27, 2011 8:44 pm

Re: Timeshift and mount points

Post by Nuts2u » Thu Dec 06, 2018 3:29 pm

Foirgot to add in the above posting...When converting to btrfs you must have two btrfs sub-volumes one is @ which is mounted as / and the other is @home which is mounted as /home. These are not separate partitions......You have one btrfs partition....these are sub-volumes within the btrfs formated partition. When you setup timeshift it will see both sub-volumes and you can then include your @home sub volume in the snapshot. Really helpful if you delete one or more files in your home, then later realize your mistake and want to get those files back without doing a restore from your last backup. Open timeshift, browser to the day before snapshot, open the @home folder, browse to the location where your deleted file or files reside, highlight them, and copy them to your existing location, deleted file restored, problem solved.
Silence is golden. Duct tape is silver. Welcome to Hell. Here's your copy of Windows.

SuperBoby
Level 1
Level 1
Posts: 23
Joined: Wed Nov 21, 2018 2:33 pm

Re: Timeshift and mount points

Post by SuperBoby » Tue Dec 11, 2018 8:15 am

This is very interesting. I'll test it on another computer that I plan to switch to LMDE. Thanks !

On the other hand, I don't see anyone in this thread agreeing on this warning that I'm suggesting to be added. Is there a reason for this ? Am I missing a best practice or something ?...
LMDE 3 Cindy x64
Lenovo Thinkpad T410

Post Reply

Return to “Software & Applications”