Timeshift and the Settings

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
SteveR
Level 3
Level 3
Posts: 166
Joined: Fri May 24, 2019 12:02 pm
Location: Morehead City, NC
Contact:

Re: Timeshift and the Settings

Post by SteveR »

MrEen wrote: Tue Sep 22, 2020 7:19 pm
Pjotr wrote: Tue Sep 22, 2020 3:15 pm
SteveR wrote: Tue Sep 22, 2020 2:55 pm I read it, but obliviously not fully comprehending. :?:
In that case I'm sorry, because I can't make this difficult matter clearer than that....
I never understood how this works myself. The way I interpret what Pjotr's site has is this:

When you delete the first snapshot (while newer snapshots exist) all you're actually deleting is the list (the links) not the files themselves.

Is that more or less correct?

And I believe an inspection of the location where snapshots are stored would give a clue on this. i.e., deleting the first snapshot didn't clear up as much space as it gobbled up when creating it. (emphasis added)
Now that I understood. :D
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: Timeshift and the Settings

Post by MrEen »

SteveR wrote: Tue Sep 22, 2020 11:30 pm Now that I understood. :D
With luck, I was accurate in my assessment! :D
Petermint
Level 9
Level 9
Posts: 2976
Joined: Tue Feb 16, 2016 3:12 am

Re: Timeshift and the Settings

Post by Petermint »

When you delete the first snapshot (while newer snapshots exist) all you're actually deleting is the list (the links) not the files themselves.
The list is the directory entries pointing to inodes by number. An idnote points to the file extents. So long as there is a directory entry pointing to a file, the file remains. When the last directory entry is deleted, the inode is deleted which means the file is deleted.

For Backintime, deleting old snapshots is different. You might want to go back to the last snapshot in the previous financial year to retrieve a spreadsheet you accidentally deleted.

Then there is the directory from the 1980s you might have deleted years ago to save space. It contains the only pictures of your favourite children/puppy/motorcycles when they were still new. :shock:
User avatar
Pjotr
Level 23
Level 23
Posts: 19800
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Timeshift and the Settings

Post by Pjotr »

MrEen wrote: Tue Sep 22, 2020 7:19 pm The way I interpret what Pjotr's site has is this:

When you delete the first snapshot (while newer snapshots exist) all you're actually deleting is the list (the links) not the files themselves.

Is that more or less correct?
Well, very roughly, yes. Files only get deleted once they're no longer on any existing "list" (one or more of the later snapshots).

Of course this is only an imperfect analogy, blah blah blah. But it's a useful way to make clear, or at least as clear as possible, that all snapshots can be deleted in random order, without any snapshot deletion having any effect at all on the remaining snapshots.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: Timeshift and the Settings

Post by MrEen »

Thanks Pjotr.

I mostly "get it" now. :D
HoskaPamma
Level 1
Level 1
Posts: 32
Joined: Thu Nov 12, 2020 8:27 pm

Re: Timeshift and the Settings

Post by HoskaPamma »

I tried to figure out what schedule settings would make sense and ended up with 1 monthly, 2 weekly & 3 daily snapshots. Fast forward a bit, I ended up here and read that 2 monthly snapshots is enough. I have no experience with this but for some reason I feel like it would make sense to make snapshots more often.

Anyways, I then tried to figure out how much space the actual snapshots (I now have M / W / D / D / DW) are taking right now (to make some adjustments to my snapshot schedule if the snapshots take too much space). This turned out to be difficult. Every folder in /run/timeshift/backup/timeshift/snapshots/ says about 11,x GB, totalling about 55 GB, which is the same number as the "System Monitor - File Systems" says for the partition (it also lists the timeshift "fake device" with the same GB). Is there a way to see how much space the snapshots actually take?

EDIT: My home folder has 3,7 GB of files, and that folder is excluded from snapshots (default), so I'd expect to see at least that much difference in the actual space used by the root partition and with the snapshots (on same partition).

BTW. I have a big swapfile (22 GB, for hibernating + swap) in "/", is timeshift taking a snapshot of that too?
User avatar
Pjotr
Level 23
Level 23
Posts: 19800
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Timeshift and the Settings

Post by Pjotr »

HoskaPamma wrote: Fri Nov 20, 2020 12:21 pm I have no experience with this but for some reason I feel like it would make sense to make snapshots more often.
What reason?
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
HoskaPamma
Level 1
Level 1
Posts: 32
Joined: Thu Nov 12, 2020 8:27 pm

Re: Timeshift and the Settings

Post by HoskaPamma »

All I wanted to know if there is a way to see how much space the snapshots actually take? It's odd that the Timeshift program doesn't tell you that. EDIT3: Ok, found Disk Usage Analyzer that seems to show the actual space taken by snapshots. 5 snapshots take 18,7 GB. I'm fine with that now. I guess it might fluctuate so I might check on it again later.

EDIT: And also: I have a big swapfile (22 GB, for hibernating + swap) in "/", is timeshift taking a snapshot of that too? EDIT2: /swapfile is excluded automatically by Timeshift.
HaveaMint
Level 6
Level 6
Posts: 1088
Joined: Fri Feb 02, 2018 9:56 pm

Re: Timeshift and the Settings

Post by HaveaMint »

Pjotr was leading you with a question by asking Why do you feel you need so many snapshots of the system. I only have it do one snapshot monthly on my machines. Even if it gets messed up on day 29 just before the next snapshot is scheduled to run it doesn't take much time to bring the updates back to present on it. The Only reason I can see one wanting more snapshots is if they are on a metered internet connection, then you may want more.
"Tune for maximum Smoke and then read the Instructions".
foberle
Level 3
Level 3
Posts: 127
Joined: Fri Oct 13, 2017 4:52 pm

Re: Timeshift and the Settings

Post by foberle »

Sorry to beat a dead (well, actually still live) horse, but I've read through reams and reams of discussion regarding Timeshift, and am still very confused. So in order to convince myself that I've got a sufficient enough grasp to trust Timeshift (and even delete some of the snapshots), can anyone comment on the following observations:

In the location assigned to an rsync-type Timeshift (and named /whatever/whatever/timeshift), there are several major subdirectories.

The first major subdirectory (alphabetically) is 'snapshots', which contains one date-stamped subdirectory for each of the snapshots listed in the Timeshift GUI.

There are a number of other major subdirectories for each type of snapshot created, namely snapshots-boot, snapshots-daily, snapshots-hourly, snapshots-monthly, and snapshots-ondemand. Taken together, the total number of date-stamped subdirectories under these five equals the number under /whatever/timeshift/snapshots.

In my case, I only create snapshots on demand, so the number and NAMES of the dated subdirectories in timeshift/snapshots-ondemand and those in timeshift/snapshots are identical.

Based on some of what I'd read, I initially suspected that the timeshift/snapshots subdirectory contains backup copies (not links) of actual operating system files on this machine at the time the first snapshot was created, and that the corresponding dated subdirectories in timeshift/snapshots-ondemand contain EITHER nothing but LINKs to the files in the snapshots subdirectory if the files are unchanged, OR actual FILEs in cases where they are different than the one of the same name in the snapshots subdirectory.

Comparing the directory and file sizes between the timeshift/snapshots-ondemand and those in timeshift/snapshots, however, seem to suggest that they are identical to each other. (i.e. I saw no links other than those that already existed on the OS itself, though I'll admit I didn't do a thorough examination.)

So, what purpose is the timeshift/snapshots directory serving? And where are the file "backups" themselves? Many past discussions of this subject even on this forum have convinced me not to throw out the term "repository," but somewhere there must be backup copies of the actual OS files (otherwise, what purpose does it serve?).

Or am I missing the point of Timeshift entirely? Is Timeshift not actually a "backup" (incremental or otherwise, and, yes, I know it isn't intended for user files and such) program at all, and only intended to recover from OS updates that "break" something.

Thanks for listening ...
User avatar
Pjotr
Level 23
Level 23
Posts: 19800
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Timeshift and the Settings

Post by Pjotr »

foberle wrote: Sun Nov 22, 2020 6:33 pm in order to convince myself that I've got a sufficient enough grasp to trust Timeshift (and even delete some of the snapshots)
Don't overthink it; it's not worth the effort. What you need to know is this: Timeshift is merely a tool for repairing a broken system. Practically nobody needs to have more than two Timeshift snapshots for repairing a broken system. That's all.

This may help to clarify:
https://easylinuxtipsproject.blogspot.c ... t.html#ID7
(item 7)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Menard
Level 7
Level 7
Posts: 1730
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Timeshift and the Settings

Post by Menard »

I am a new Timeshift user, 3 weeks and I allready get problems with it
7 years with Clonezilla Live : no problems

Now I ve just recovered from a bad shutdown, thanks to Timeshift used from the Mint installation Device and thanks to this forum, but I see on the journal, this :

Code: Select all

PC1 systemd[1]: kerneloops.service: Found left-over process 1105 (kerneloops) in control group while starting unit. Ignoring.
PC1 systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.


so it is not exactly as if I had used Clonezilla Live ... :!:

And as I had chosen to install a encrypted home partition (I am new with both) I understand that I could have lost my data, so I d advice to people to use Clonezilla if they choose a encrypted home

This because Mint by default don't support the no swap mode ... and a memory deal that would allow not to have to shutdown hard
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5695
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: Timeshift and the Settings

Post by Lady Fitzgerald »

Pjotr wrote: Sun Nov 22, 2020 7:38 pm
foberle wrote: Sun Nov 22, 2020 6:33 pm in order to convince myself that I've got a sufficient enough grasp to trust Timeshift (and even delete some of the snapshots)
...Practically nobody needs to have more than two Timeshift snapshots for repairing a broken system...
I somewhat disagree with this. There have been rare occasions when I had to go back to a third snapshot to correct a problem (usually one I stupidly created) that showed up later on. I keep no more snapshots than what will fill up the default Timeshift window. When the window fills up, I have Timeshift delete roughly half of the old snapshots, although, out of habit from my Windows days, I (probably unnecessarily) keep the first snapshot. I can keep on using the computer while Timeshift is deleting so I don't worry about how long it takes. I can't see having the extra snapshots causing any problems and I'm the type of person who would rather have something and not need it than to not have something, then need it.
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
User avatar
AZgl1800
Level 20
Level 20
Posts: 11113
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: Timeshift and the Settings

Post by AZgl1800 »

Lady Fitzgerald wrote: Wed Jan 27, 2021 8:58 am
Pjotr wrote: Sun Nov 22, 2020 7:38 pm
foberle wrote: Sun Nov 22, 2020 6:33 pm in order to convince myself that I've got a sufficient enough grasp to trust Timeshift (and even delete some of the snapshots)
...Practically nobody needs to have more than two Timeshift snapshots for repairing a broken system...
I somewhat disagree with this. There have been rare occasions when I had to go back to a third snapshot to correct a problem (usually one I stupidly created) that showed up later on. I keep no more snapshots than what will fill up the default Timeshift window. When the window fills up, I have Timeshift delete roughly half of the old snapshots, although, out of habit from my Windows days, I (probably unnecessarily) keep the first snapshot. I can keep on using the computer while Timeshift is deleting so I don't worry about how long it takes. I can't see having the extra snapshots causing any problems and I'm the type of person who would rather have something and not need it than to not have something, then need it.
You can liken this to the Spare Tire in your car.....
a lot of people have one that has never been used, but still, it is tucked away hidden somewhere ( or not ).
What did it cost to carry that Spare Tire/Tyre? nothing, but OMG is it ever useful if required.

I too, keep my snapshots within the default Window Size. Auto-Daily covers my arse if I make a stupid mistake.
A few manuals to document some special event that occurred, or was about to occur.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: Timeshift and the Settings

Post by APSchmidt »

I also set Timeshift to run daily and I keep seven snapshots, plus the first one I did after installation (on demand). They are all stored on a separate partition set on an also separate drive, just in case. You might think "it's using both a belt and suspenders but, well, I sometimes had to go back in time after making choices I regretted so I'm happy like that.

Now, why seven? Well, weeks have seven days so... ;)
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5695
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: Timeshift and the Settings

Post by Lady Fitzgerald »

AZgl1500 wrote: Wed Jan 27, 2021 9:07 am
Lady Fitzgerald wrote: Wed Jan 27, 2021 8:58 am
Pjotr wrote: Sun Nov 22, 2020 7:38 pm

...Practically nobody needs to have more than two Timeshift snapshots for repairing a broken system...
I somewhat disagree with this. There have been rare occasions when I had to go back to a third snapshot to correct a problem (usually one I stupidly created) that showed up later on. I keep no more snapshots than what will fill up the default Timeshift window. When the window fills up, I have Timeshift delete roughly half of the old snapshots, although, out of habit from my Windows days, I (probably unnecessarily) keep the first snapshot. I can keep on using the computer while Timeshift is deleting so I don't worry about how long it takes. I can't see having the extra snapshots causing any problems and I'm the type of person who would rather have something and not need it than to not have something, then need it.
You can liken this to the Spare Tire in your car.....
a lot of people have one that has never been used, but still, it is tucked away hidden somewhere ( or not ).
What did it cost to carry that Spare Tire/Tyre? nothing, but OMG is it ever useful if required.

I too, keep my snapshots within the default Window Size. Auto-Daily covers my arse if I make a stupid mistake.
A few manuals to document some special event that occurred, or was about to occur.
I love that spare tire/tyre analogy.

I don't do Auto-Daily backups because I read somewhere shortly after coming to Mint that occasionally, if something is going on in the OS while the snapshot is being taken, it could result in the snapshot being corrupted. How true that is, I don't know enough to say, but I feel better being safe rather than possibly sorry later on. Instead, I make a manual snapshot once a week and, as you do, before doing anything that has the potential of gumming up the works. It doesn't take long to just sit there while Timeshift churns out a snapshot.

Just forf (forf? :roll: stupid fat fingers) excrement and merriment, I made an image just to see how long it took. It took a minute from the time I clicked on the Timeshift icon and finished annotating the new snapshot. Big deal! Even with my ??ADHD, that's not a problem. On the weekly snapshots, I also make one on an external drive for a backup. That takes a minute and a half since I have to connect the drive and change location in Timeshift's settings, then disconnect the drive and restore Timeshift's settings. Again, big deal. I have yet to need a snapshot on the external drive but, again, better safe than sorry.

However, overall, what one does boils down mostly to personal preference.
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
SteveR
Level 3
Level 3
Posts: 166
Joined: Fri May 24, 2019 12:02 pm
Location: Morehead City, NC
Contact:

Re: Timeshift and the Settings

Post by SteveR »

An FYI for Backing-Up to a USB flash drive (solid state). Evidently there is a significant time delay between what appears to be the "end" of the backup and when it actually completes. Right after the backup "completes", I go to change the backup location from the USB flash drive back to its default location on the hard drive only to find that Timeshift appears unresponsive. Additionally, even-though the backup appears completed, I get a message that I can't eject the USB flash drive because it is "busy". Waiting a while solves these concerns. Just one of those idiosyncrasies.
User avatar
AZgl1800
Level 20
Level 20
Posts: 11113
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: Timeshift and the Settings

Post by AZgl1800 »

SteveR wrote: Tue Feb 02, 2021 11:16 am An FYI for Backing-Up to a USB flash drive (solid state). Evidently there is a significant time delay between what appears to be the "end" of the backup and when it actually completes. Right after the backup "completes", I go to change the backup location from the USB flash drive back to its default location on the hard drive only to find that Timeshift appears unresponsive. Additionally, even-though the backup appears completed, I get a message that I can't eject the USB flash drive because it is "busy". Waiting a while solves these concerns. Just one of those idiosyncrasies.
there is a LOT of overhead that has to be completed before all of the Write Buffers have been cleared out.
Never, ever, pull a USB drive out unless you have verified that it is not being "used" or "written to".

I always use "Disks" anymore, to verify that the drive has been "powered down"
Pull a USB drive out while it is being written to, is a guaranteed method to destroy all of the file headers on it. You will be crying a lot to discover that all of those backup images are not any good :twisted:
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
Petermint
Level 9
Level 9
Posts: 2976
Joined: Tue Feb 16, 2016 3:12 am

Re: Timeshift and the Settings

Post by Petermint »

You can run the sync command to force the write of all the buffered data. Wait until the sync command returns before removing the USB stick.
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5695
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: Timeshift and the Settings

Post by Lady Fitzgerald »

I just open up the external USB drive/partition I want to shut down, right click on the drive/partition in the left hand pane, click on Safely Remove Drive, then wait until the message in the upper right hand corner of the screen says the drive can be safely unplugged.
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
Locked

Return to “Tutorials”