Timeshift snapshots are taking a very big amount of space on my SSD

Timeshift and Space complexity.

So I’ve been using Manjaro Plasma from last one year.
I am a aspiring programmer studying legitimate programming degree from a university.
I install and experiment here and there, as a programmer we are supposed to do.
Sometimes, while creating personal projects I do have to tinker with bash scripts and linux commands.
So as all linux users are aware, our systems break.
Yes, they break, and there were times even spending week to solve that problem it didn’t solved by.
But the recovery done through the help of snapshot taken by the timeshift did it in less then a hour or so.

But, here is the problem.
As I am a aspiring programmer,
I have few languages installed.
Few language specific (mostly python) library installed.
Few IDE(s) like

  • VS Code.
  • PyCharm Professional Edition
  • Sublime text editior
  • Kate
  • Vim
    and no videos I have on this whole ssd.
    Multiple screenshots, few pdf books, and some small programs written by me.
    Still they combined except the installed files, does not amount to more then 40 gb at highly estimated max.
    I only use my pc for reading books, surfing(researching, learning) the internet using firefox, and programming that too using VIM.

Today, there was only 250 mb total left in my whole drive.
Yesterday it was free 40 gb.
I didn’t downloaded or installed anything.
Just watched videos.
So, I suspected the timeshift snapshots.
Deleted 1-2 snapshots, and 50 gb was freed up.

So, I wonder how to reduce the space it takes up for snapshot creation.

Yes, in settings I ticked mark the setting “Include all files.” for root and local user.

Is there any alternative to using timeshift, so if my system breaks I can recover it?

That’s your problem. Timeshift is not a backup tool but a tool for system recovery.

For user files, I can recommend restic or borg.

2 Likes

You don’t need to backup the entire $HOME folder, 99% of its contents are redundant in the backup.

Google what dotfiles are, it will make your life easier.

1 Like

What filesystem do you use ?

Timeshift depends on the capabilities of the underlying filesystem.

  • With ext3/4 snapshots are heavyweight, (because ext3/4 has no internal snapshot-capability)
  • With btrfs snapshots are lightweight (because snapshots are part of the design of btrfs)

You can find good Information about Btrfs in the wiki

Whenever my system breaks, i do a :mag: rollback :smiling_face_with_three_hearts:

I do have separate snapshots for / and for /home. (with snapper)

You can split your snapshots into segments if you use different subvolumes in btrfs and different snapper configurations for them.

The result would be the same whatever backup software you use if configured the same way. It’s up to you to figure how to backup your data.
https://wiki.archlinux.org/title/Synchronization_and_backup_programs

Also, including user files in Timeshift backups is usually not a good idea if you intend to use it for restoring your system – as it should – since those files would then also be restored to that previous state. As previously pointed, you should use something else for your personal files.

2 Likes

I guess you already figured it out but for good measure:

DO NOT DO BACKUP OF THE HOME WITH TIMESHIFT THIS IS NOT WHAT THE TOOL IS MADE FOR

A quote from TimeShift developers:

User Data is Excluded by Default

Timeshift is designed to protect system files and settings. It is NOT a backup tool and is not meant to protect user data. Entire contents of users’ home directories are excluded by default. This has two advantages:

  • You don’t need to worry about your documents getting overwritten when you restore a previous snapshot to recover the system.
  • Your music and video collection in your home directory will not waste space on the backup device.

You can selectively include items for backup from the Settings window. Selecting the option “Include hidden items” from the Users tab will back up and restore the .hidden files and directories in your home folder. These folders contain user-specific config files and can be included in snapshots if required.

Note: It is not recommended to include user data in backups as it will be overwritten when you restore the snapshot.

2 Likes

What are best settings one should be using for Timeshift.

Like one setting is that it is not made for backups of personal files.
But should be considered to be used for recovering system files only when broken.
So include all files should not be ticked marked.

A quote from TimeShift developers:

User Data is Excluded by Default

Timeshift is designed to protect system files and settings. It is NOT a backup tool and is not meant to protect user data. Entire contents of users’ home directories are excluded by default. This has two advantages:

  • You don’t need to worry about your documents getting overwritten when you restore a previous snapshot to recover the system.
  • Your music and video collection in your home directory will not waste space on the backup device.

You can selectively include items for backup from the Settings window. Selecting the option “Include hidden items” from the Users tab will back up and restore the .hidden files and directories in your home folder. These folders contain user-specific config files and can be included in snapshots if required.

Note: It is not recommended to include user data in backups as it will be overwritten when you restore the snapshot.

So, like this what other things are to be considered?

Please feel free to discuss and post anything worth sharing.
It will be quite beneficial for everyone.
Like RSYNC and BTRFS, and the latter is not available for selection.
If there is anything more to know then it would be quite wonderful.
Some insights like which come from regular use of it.

Keep the default settings (that means not backing up the home or root folders, only the system), but, to me, you should not do the automatic planned snapshots. Disable all planned snapshots, and do them manually when you feel like it, or install timeshift-autosnap-manjaro to create a snapshot before you update the system automatically (but to me this would create too much snapshots, this is why I recommend to manually do a snapshot once in a while before or after a big system update).

BTRFS is only available if your system is installed on a BTRFS file system, so use Rsync if this is your case.

Also, delete the old snapshots, you don’t need them, keep a couple of them or more (but more snapshots equals more space wasted for snapshots).

I only needed to use Timeshift a couple times in multiple years of using Manjaro, and most likely it was on purpose when I was breaking my system.

Something I like to do before creating a snapshot with Timeshift, is cleaning useless things like the package cache, the journal logs, things like that I don’t want to backup, as it takes too much space for absolutely no benefit (if you make a snapshot this is from a working system, so you don’t need the old packages backed up).

I do my backups on the system disk itself (the default), some do to an external drive (that could be better in some case maybe, if the drive fails, but in this case to me I would reinstall completely anyway so… and also external drives are usually slow), it is up to you

1 Like

Haha exactly the problem I had.

The next problem I had was that restoration could fail (I used rsync to another disk) because there were just too many files.

So the solution is to use Timeshift ONLY as a ‘system snapshot’. Don’t include ‘all files’ and to run back-in-time to do rsync backup to another drive, and Timeshift just keep a couple of local snapshots - locally.

2 hourly, 1 daily, 1 weekly - that’s good enough for me for snapshots.

That’s insane, especially with Rsync snapshots of your system, and you recommend to keep a couple snapshots to which I agree, but what you suggest is 12x7 +7 +1 = 92 snapshots per week. Even on BTRFS I wouldn’t do that, makes no sense to me.

No, I only KEEP 2 hourly snapshots, not take a snapshot every 2 hours.

I never have more than a couple of snapshots.