What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

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
Kobalt
Level 2
Level 2
Posts: 57
Joined: Sat Jan 17, 2015 2:33 pm

What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by Kobalt »

Hi there,

this short tutorial will describe how to respond if your system got screwed by Timeshift.

Symptoms
Linux Mint suddenly reports shortage of disk space (e.g. < 500 MB) for no obvious reason. You didn't install anything large which explains why your system should have not much disk space left.

If you fail to react this leads to the so called "Login Loop". This is the phenomenon, that you are getting to your login screen at system start up as usual, but after entering correct username and passoword you are presented with a black screen for a short period of time and get right back to the login screen. This is an endless loop.

If you fail to understand what happens here, you finally end up in a situation where not even the login screen appears anymore. On system start up you are stuck at the point where the command line login is shown. (This is also seen for a short while right before the login screen loads on usual start up.)

Reasons
If Timeshift is configured wrongly or buggy, it will consume all your disk space to save system/file backup data. This seems to be a long known issue by developers and more experienced users, surely not for newbies like me, but never got fixed.

It is known that one reason for the Login Loop can be the lack of disk space on your root partition. For running correctly your root partition needs some free space to save temporary files and such. And even the login screen itself needs some disk space left. If your root partition has no disk space left, even the login screen will fail to load.

Solution
1) If you are presented with the Login Loop, press [Ctrl]+[Alt]+[F1] which will switch to the command line prompt. If you are already presented with it, nothing to do so far.

2) Check for your disk space:

Code: Select all

df -hT
This will show you all the partitions and there used space. If you use >90% of your disk space of, e.g. /dev/sda1 (or whatever your root partition is), then it is considered dangerously full. Example screenshot: https://unix.stackexchange.com/question ... disk-space.

3) If it is indeed the case, that you have not enough disk space, you should free some immediately. You may try to delete some Timeshift snapshots but for me this didn't work, because......... not enough disk space... The same is true for many other commands to delete files. They will fail because not enough disk space is left. You need just enough free space to be able to delete the snapshots which occupy all the space.

Hint: Also it will not work to start the desktop environment by

Code: Select all

startx
because some errors will describe that it is unable to write .Xauthority files and such (also reports of this are found on the internet); this is due to the lack of disk space again. So this is no way to go from here.

Delete Order
Remove unrequired packages.

Code: Select all

sudo apt-get autoremove
Remove outdated packages.

Code: Select all

sudo apt-get autoclean
Remove all packages in the system cache (not necessary to run your system; these packages are still installed!)

Code: Select all

sudo apt-get clean
Remove all journal log files (up until 3 days ago):

Code: Select all

sudo journalctl --vacuum-time=3d
Further good ideas to free space can be found here: https://itsfoss.com/free-up-space-ubuntu-linux/. That is where I got my ideas from in the first place.

Use rerserved disk space for root partition
As suggested here: viewtopic.php?t=253502, you could also try to use the reserved space for the root partition.

Code: Select all

sudo tune2fs -m0 /dev/sda1
Anyway, this didn't work for me as Timeshift seems to already have consumed even this space (there wasn't literally nearly not even 1 byte left!) If you try this, do not forget to reserve the disk memory for the root partition.

Code: Select all

sudo tune2fs -m5 /dev/sda1
Deleting Snapshots via Timeshift (command line)
There is a command line version of Timeshift which can be used to manage it.
List all snapshots:

Code: Select all

timeshift --list
Delete a single snapshot (use the complete snapshot name):

Code: Select all

timeshift --delete --snapshot '2020-04-30_...'
Delete all snapshots:

Code: Select all

timeshift --delete-all
4) If you free enough disk space, immediately the login screen comes up again (if it wasn't loading before). You may decide yourself and according to your circumstances if you try to login to your account or go back to the command line by [Ctrl]+[Alt]+[F1] and free further disk space (e.g. by deleting further snapshots).

In case you are in the command line, and you want to switch to the desktop environment, use

Code: Select all

startx
If enough disk space is available, it should work like a charm now.

Of course, you could also just restart your pc by

Code: Select all

shutdown -r
(Be patient, it will restart in a short while.) From the login screen you can then login to your account.

Hello Desktop, we're back!
5) Immediately after logging in to your account, start Timeshift. Menue > System management > Timeshift or by the search. Go to settings > time table and unclick all planned snapshot plans and confirm (this deactivates Timeshift, highly recommended). Also delete all remaining snapshots from your partition through this application (if these are available, which doesn't seem always to be the case).

EDIT: If you really want to use TimeShift, read this tutorial by Havea Mint and TimeShift's manual. If you don't understand everything, do not use TimeShift.

I hope this tutorial helps you to identify and fix this problem rather quickly, it took me around 6h to understand everything the newbie I am (time I actually planned to do work in Linux Mint, not fixing it).

Kobalt
Last edited by Kobalt on Sat May 23, 2020 12:19 pm, edited 1 time in total.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by pbear »

Good work on the how-to-recover-space side of it. You've left out the solution on the Timeshift side.

This problem generally occurs because the user has separate root and home partitions. In that case, Timeshift snapshots should not be saved in root. Either save them on the home partition or a USB drive. It's a very simple problem to fix.

And it's a configuration error, not a bug. If you don't know how to configure for a home partition, perhaps you shouldn't be using one.
Kobalt
Level 2
Level 2
Posts: 57
Joined: Sat Jan 17, 2015 2:33 pm

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by Kobalt »

Thanks for your reply! I addressed your other reply in the respective thread.
You've left out the solution on the Timeshift side.
Well, I presented my solution (rather at the bottom of my tutorial):
Go to settings > time table and unclick all planned snapshot plans and confirm (this deactivates Timeshift, highly recommended).
Then about your statement:
And it's a configuration error, not a bug. If you don't know how to configure for a home partition, perhaps you shouldn't be using one.
I accept that I'm not experienced enough in the inner workings of Timeshift that I may have done a configuration error. My conclusion therefore is, that I shouldn't be using Timeshift. This is exactly why my solution to this problem (and for everybody who happens to have the same issue with Timeshift) to immediately deactivate it as stated.

I appreciate Linux Mint, because it is quite user friendly, and as I understand it, that is exactly one of the goals of the Mint project. I do not understand why Mint advises users right after the installation to run a backup system (Timeshift) which will lead to such severe results if misconfigured (actually I just used the standard settings...). - I used to use Mint some years ago, and I was amazed since it ran like a charm. This backup system was not adviced at the time though.
This problem generally occurs because the user has separate root and home partitions. In that case, Timeshift snapshots should not be saved in root. Either save them on the home partition or a USB drive. It's a very simple problem to fix.
This isn't the case for me.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by pbear »

Broadly advising people to turn off a key feature of the operating system because you don't understand it is outrageous.

To anyone finding this "tutorial," no, that is not the right answer. The right answer is to learn how to configure Timeshift correctly. Start with HavaMint's tutorial in the sticky section (sticky means considered especially useful by the administrators of the Forum). Notably, anyone can post a tutorial and there's no review for quality or accuracy, so the fact this tutorial appears on the Forum is no sort of endorsement. Then, review the developer's GitHub page, which has much useful information. Then, if you'd like more info, there are many articles about it on the Internet.

In my observation, there are three ways folks get into trouble with Timeshift. All are easily avoided. First, mentioned above, if you up a separate home partition, don't keep saving snapshots in root. Instead, change the location setting to use the home partition. Second, do not hijack Timeshift as a convenient way to backup data files. If you need to restore the system, your data files will be reverted to their prior state. You don't want that. Back up data files separately. There are many options. Third, do not fiddle with the filters unless you understand them.

Timeshift is a valuable tool. The developers added it to Mint for a reason. It is a daily occurrence on the Forum for someone to report a problem and the first piece of advice is, restore a Timeshift snapshot. Don't jettison it on advice of a single user who had a bad experience.
Kobalt
Level 2
Level 2
Posts: 57
Joined: Sat Jan 17, 2015 2:33 pm

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by Kobalt »

Sorry for the really delayed reply!
pbear wrote: Fri May 01, 2020 6:20 pm Broadly advising people to turn off a key feature of the operating system because you don't understand it is outrageous.
Well, I agree in principle. it would be outrageous. Linux Mint is a wonderful operation system which I appreciate using. I'm not the expert (and honestly also have not enough time) to read about all the internals of every application which is used to run the system. I have to have trust in the correct working of these internals (similar to my trust for working internals in a car or whatever, although I do not understand everything in full detail). My advise to turn off TimeShift is not meant to say that it is a useless or bad application, rather than an application which should not be run unless you have the expert knowledge (or the time to get it) about it, which is obviously necessary to prevent it from screwing up the system (with standard settings). Also, earlier versions of Linux Mint don't come with TimeShift (at least it has not been asked to be set up on installation), and it worked like a charm. I conclude, it is not really a crucial application for a stable running Linux Mint. If people mess around with their system so much that they expect a backup application should be running, then they particularly should run applications like TimeShift. They also will know enough about setting it up in a correct way.
pbear wrote: Fri May 01, 2020 6:20 pm To anyone finding this "tutorial," no, that is not the right answer. The right answer is to learn how to configure Timeshift correctly. Start with HavaMint's tutorial in the sticky section (sticky means considered especially useful by the administrators of the Forum). Notably, anyone can post a tutorial and there's no review for quality or accuracy, so the fact this tutorial appears on the Forum is no sort of endorsement. Then, review the developer's GitHub page, which has much useful information. Then, if you'd like more info, there are many articles about it on the Internet.
I extended my tutorial by this information. Thanks.
pbear wrote: Fri May 01, 2020 6:20 pm Timeshift is a valuable tool. The developers added it to Mint for a reason. It is a daily occurrence on the Forum for someone to report a problem and the first piece of advice is, restore a Timeshift snapshot.
I have no doubt about that.
User avatar
sdibaja
Level 5
Level 5
Posts: 900
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by sdibaja »

We all have opinions:
I say with quality control of the updates Before they are pushed up Timeshift has no purpose.
Mint just does not have the resources to do that QA and testing in-house, so you get nagged to use the funky tool.
I applaud the effort, but I also advise disabling it or uninstalling.

Backup of personal data and reinstall is a better solution...Or have someone install and setup a Stable Operating System for you.
Kinda like 99.99% of the masses get when they buy a computer.

Let us make it easier for the Users and allow the Hobbyists to indulge in the unknowns
Peter
Mate desktop https://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
User avatar
Schultz
Level 9
Level 9
Posts: 2920
Joined: Thu Feb 25, 2016 8:57 pm

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by Schultz »

What to do if Timeshift screwed over your system?
The problem isn't Timeshift, it's PEBCAK. Linux Mint could have done a better job explaining how to set it up, though.
User avatar
AndyMH
Level 21
Level 21
Posts: 13503
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by AndyMH »

sdibaja wrote: Sat May 23, 2020 4:18 pm I say with quality control of the updates Before they are pushed up Timeshift has no purpose.
You've forgotten the user. Lost count of the number of times I've borked my system, it's part of the learning process :D
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by pbear »

sdibaja wrote: Sat May 23, 2020 4:18 pm Backup of personal data and reinstall is a better solution...
Very few users have the ability to do that painlessly. If not using Timeshift, the sensible thing for almost all users is to back up the system some other way. Telling people to go bare back because it happens to work for you is pretty outrageous also.
User avatar
Moem
Level 22
Level 22
Posts: 16193
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by Moem »

Schultz wrote: Sat May 23, 2020 4:42 pm Linux Mint could have done a better job explaining how to set it up, though.
I strongly agree. The documentation is not on the level of newcomer-friendliness that we see elsewhere in Mint. There is clearly room for improvement here.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
all41
Level 19
Level 19
Posts: 9473
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by all41 »

For me the best part of Timeshift is never having the occasion to restore from
it, except once to verify it's ability. Best to have the files and never need, though--as opposed
to needing and not having.
Timeshift is still rewriting system files on an internal hd once daily, keeping but one daily instance (plus
one manual instance of a fresh install with all needed apps). Truthfully hope I never need
them.
Everything in life was difficult before it became easy.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by pbear »

Moem wrote: Sat May 23, 2020 5:49 pm The documentation is not on the level of newcomer-friendliness that we see elsewhere in Mint.
Which documentation would that be? The Installation Guide is good, albeit two years old and refers to a swap partition no longer used. The Help pages for Update Manager are good. That's pretty much it. Meanwhile, TS has better than average usage notes. Not perfect, but better than average.

If you want to see good documentation, take a look at MX Linux's Manual and FAQs.
User avatar
sdibaja
Level 5
Level 5
Posts: 900
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by sdibaja »

pbear wrote: Sat May 23, 2020 5:45 pm
sdibaja wrote: Sat May 23, 2020 4:18 pm Backup of personal data and reinstall is a better solution...
Very few users have the ability to do that painlessly. If not using Timeshift, the sensible thing for almost all users is to back up the system some other way. Telling people to go bare back because it happens to work for you is pretty outrageous also.
cherry picking Part of a one line statement? and out of context to boot. how sophisticated!
it completely changes what I actually said.

BTW: backups (data and systems) are the industry standard in the workplace. Transparent, scheduled.
Usually off machine backups, but not always if hardware is scarce.
Seems odd that Hobbyists have not yet learned to use those tools.
Peter
Mate desktop https://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by pbear »

Not out of context. And it's a short space between the full post and the quote. I'm confident anyone interested can follow the conversation.
User avatar
Moem
Level 22
Level 22
Posts: 16193
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by Moem »

pbear wrote: Sat May 23, 2020 8:12 pm
Moem wrote: Sat May 23, 2020 5:49 pm The documentation is not on the level of newcomer-friendliness that we see elsewhere in Mint.
Which documentation would that be? The Installation Guide is good, albeit two years old and refers to a swap partition no longer used. The Help pages for Update Manager are good. That's pretty much it.
Well, that's part of the problem really. Timeshift could do with a manual or a decent 'Help' file. But I used the word 'documentation' too loosely; I really meant it needs to be explained better. So many people, for example, believe Timeshift is a backup application.
pbear wrote: Sat May 23, 2020 8:12 pmMeanwhile, TS has better than average usage notes. Not perfect, but better than average.
It's a good program as far as I know (I've never needed to restore anything so far). It just needs to be explained better.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
gittiest personITW
Level 12
Level 12
Posts: 4287
Joined: Tue May 28, 2019 4:27 pm

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by gittiest personITW »

Just to add that I've used TS quite a few times for restoring the system, or even a few settings that I played around with too much.
The number of problems on the forum about TS have dropped off recently but a few months ago there were quite a few ppl who had filled up their drives and set TS to infinite loops of backups.

Yes, it could be explained better but also, in my opinion, it should only be allowed to backup to a non-system partition.
Moem - please don't do a gm10 (whom we all miss) You are very close to 11000.
User avatar
Moem
Level 22
Level 22
Posts: 16193
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by Moem »

No plans in that direction! (That's another step closer.)
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
AndyMH
Level 21
Level 21
Posts: 13503
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by AndyMH »

gittiest personITW wrote: Sun May 24, 2020 4:30 am in my opinion, it should only be allowed to backup to a non-system partition.
Moem - please don't do a gm10 (whom we all miss) You are very close to 11000.
Agree on all counts. :)
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by trytip »

if you buy a knife and cut your hands severely because you were holding the blade instead of the handle are you going to put out a disclaimer "if you really must use use knives, here's what not to do"?
that's all i'm going to say about that
Image
tnimxunil22

Re: What to do if Timeshift screwed over your system? | Login Loop | No Disk Space

Post by tnimxunil22 »

trytip wrote: Sun May 24, 2020 6:16 am if you buy a knife...
I am not sure if such analogy is applicable.
To distinguish a blade from a handle requires probably something like a "pair of neurons". To understand the dangers, etc. another pair. Additionally this knowledge doesn't have to be dependent, or at least not that much, on external source.
To know how timeshift works, or home and root directories, etc., requires much more computing power and knowledge, that could not be just extrapolated just from the experience and just from looking, contrary to blade example, where even if handling it for the first time in life, if one doesn't know or is not sure what it is and whats are it's properties, uses, dangers etc., it could be usually easily and and clearly received from just playing with it for short time.

I also didn't know that
1) filling the partition up to the brim is possible and more difficult to reverse(having windows experience, where when it happens, after the system restart, because of many reasons, some space will be automatically recovered)
2) that filling up to the brim will/could break in some ways the system/some things.
3) and one way being blocking the common login way.
4) and that therefore it would be above average difficulty of freeing some free space in order to be able to put the system back to workable state, not even knowing that it will do that for sure
5) and what is more, that it could happen because of timeshift and I could not even get that at first, that all those things happened because of that.
Locked

Return to “Tutorials”