• Contact
  • About Me
  • Privacy Policy
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Solutions

Timeshift on Linux: How to Create and Restore System Snapshots

by neo
May 15, 2025
in Solutions
0
Timeshift on Linux: How to Create and Restore System Snapshots

Timeshift on Linux: How to Create and Restore System Snapshots

0
SHARES
31
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

About Timeshift

Timeshift Linux snapshots are essential for maintaining a stable and recoverable Linux environment. Whether you’re experimenting with new software or performing system updates, one mistake can potentially break your system.


Timeshift is a powerful tool for Linux users that allows you to take snapshots of your system and easily restore them if something goes wrong. It works similarly to Windows’ System Restore and provides peace of mind without the need to manually manage backups.

Prerequisites

Before using Timeshift, make sure your system meets the following requirements:

  • A Debian/Ubuntu-based distribution (Timeshift also supports Arch and derivatives)
  • Administrative (sudo) privileges
  • Available storage space on your system or an external disk for snapshots
  • Timeshift installed (can be installed via APT or the software center)

To install Timeshift on Ubuntu/Debian:

sudo apt update
sudo apt install timeshift

Benefits and Negatives of Timeshift Linux Snapshots

Benefits

  • Quick system recovery: Restore your OS to a previous state within minutes.
  • Non-destructive backups: User files (by default) are not affected unless you choose to include them.
  • Automated snapshot scheduling: Daily, weekly, or monthly backups.
  • Simple graphical and CLI interface.

Negatives

  • Does not “back up” user data by default (only system files unless manually configured).
  • Can consume a lot of disk space, especially with RSYNC-based snapshots.
  • Not a full substitute for complete system backup (e.g., it doesn’t back up /home unless configured).

Initial Setup

  1. Snapshot type: Choose between RSYNC or BTRFS.
    • RSYNC is suitable for most users.
    • BTRFS is available only on BTRFS-formatted systems with subvolumes.
  2. Select snapshot location: Pick a drive/partition with enough space.
  3. Snapshot schedule: Configure automatic snapshots (daily, weekly, monthly).
  4. User file exclusion/inclusion: By default, Timeshift only backs up system files (not /home). You can include it in settings if desired.

Create a Snapshot

To manually create a snapshot:

Graphical Interface (GUI)

  1. Open Timeshift with sudo privileges.
  2. Click the “Create” button.
  3. Wait for the process to finish. You’ll see the snapshot listed with the date and time.
Linux Timeshift GUI

Command Line Interface (CLI)

sudo timeshift --create --comments "Before software installation"
Troubleshooting: No space left on device

If you encounter the error “No space left on device”, it likely means Timeshift is trying to save snapshots to a partition with insufficient space. To fix this, you can change the snapshot location to a different partition with more free space.

user@2nd-server:~$ sudo timeshift --create --comments "Before software installation"
First run mode (config file not found)
Selected default snapshot type: RSYNC
Mounted '/dev/sda2' at '/run/timeshift/4822/backup'
Selected default snapshot device: /dev/sda2
------------------------------------------------------------------------------
Estimating system size...
Creating new snapshot...(RSYNC)
Saving to device: /dev/sda2, mounted at path: /run/timeshift/4822/backup
Syncing files with rsync...
E: Error writing to file: No space left on device
E: Failed to write file: /run/timeshift/4822/backup/timeshift/snapshots/2025-05-15_09-44-05/rsync-log-changes
E: rsync returned an error
E: Failed to create new snapshot
Failed to create snapshot
------------------------------------------------------------------------------
Removing snapshots (incomplete):
------------------------------------------------------------------------------
Removing '2025-05-15_09-44-05'...
Removed '2025-05-15_09-44-05'
------------------------------------------------------------------------------

IMPORTANT: Store Snapshots on a Separate Partition or Disk

ADVERTISEMENT
  • Avoid saving snapshots on /boot, /home, or the same root partition if space is limited.
  • Ideally, use a separate disk, LVM volume, or large partition with at least:
    • 20–30 GB free for normal snapshots.

Step 1: Check where you have the space, in my case it is on the /dev/mapper/ubuntu--vg-ubuntu--lv

user@2nd-server:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              785M  1.2M  784M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   47G  8.9G   36G  20% /
tmpfs                              3.9G     0  3.9G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G   97M  1.7G   6% /boot
tmpfs                              785M   12K  785M   1% /run/user/1000

Step 2: Change Snapshot Location

To configure Timeshift to use this location via CLI, run:

sudo timeshift --snapshot-device /dev/mapper/ubuntu--vg-ubuntu--lv

Output:

ADVERTISEMENT
ADVERTISEMENT
App config loaded: /etc/timeshift/timeshift.json
Mounted '/dev/dm-0 (sda3)' at '/run/timeshift/5193/backup'
App config saved: /etc/timeshift/timeshift.json
Check the Timeshift Configuration
  • Check Disk Usage and Choose a Storage Location for the Snapshots
user@2nd-server:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              785M  1.2M  784M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   47G   14G   31G  31% /
tmpfs                              3.9G     0  3.9G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G   97M  1.7G   6% /boot
tmpfs                              785M   12K  785M   1% /run/user/1000
  • Ceheck Device UUID for Location /dev/mapper/ubuntu--vg-ubuntu--lv
user@2nd-server:~$ sudo blkid
/dev/mapper/ubuntu--vg-ubuntu--lv: UUID="e013cba3-a33a-4def-afe0-41df1cc1e6d8" BLOCK_SIZE="4096" TYPE="ext4"
/dev/sda2: UUID="51b9ea97-d3a0-43aa-886e-482392a8c724" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3d865301-bb38-4e2c-8a17-81b0e954698f"
/dev/sda3: UUID="YY3s1l-IVE3-5A2C-XUie-lmRe-F4hS-hGvWrd" TYPE="LVM2_member" PARTUUID="1c4b987e-3928-47cd-853b-47fc2f2af2d8"
/dev/loop1: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop2: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop0: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/sda1: PARTUUID="1e77b41b-929e-4ef3-9390-e3beda811e4d"
  • Check Timeshift Configuration:
user@2nd-server:~$ more /etc/timeshift/timeshift.json
{
  "backup_device_uuid" : "e013cba3-a33a-4def-afe0-41df1cc1e6d8",
  "parent_device_uuid" : "YY3s1l-IVE3-5A2C-XUie-lmRe-F4hS-hGvWrd",
  "do_first_run" : "false",
  "btrfs_mode" : "false",
  "include_btrfs_home_for_backup" : "false",
  "include_btrfs_home_for_restore" : "false",
  "stop_cron_emails" : "true",
  "schedule_monthly" : "false",
  "schedule_weekly" : "false",
  "schedule_daily" : "false",
  "schedule_hourly" : "false",
  "schedule_boot" : "false",
  "count_monthly" : "2",
  "count_weekly" : "3",
  "count_daily" : "5",
  "count_hourly" : "6",
  "count_boot" : "5",
  "date_format" : "%Y-%m-%d %H:%M:%S",
  "exclude" : [
    "/home/user/**",
    "/nonexistent/**",
    "/root/**"
  ],
  "exclude-apps" : []
}

Restore a Snapshot

In case your system breaks or becomes unstable, restoring a snapshot is simple.

Using GUI

  1. Launch Timeshift.
  2. Select a snapshot.
  3. Click “Restore”.
  4. Follow the on-screen instructions and reboot once done.
Linux Timeshift Restore

Using CLI

sudo timeshift --list
Mounted '/dev/dm-0 (sda3)' at '/run/timeshift/6709/backup'
Scheduled snapshots are disabled - Nothing to do!
------------------------------------------------------------------------------
user@2nd-server:~$ sudo timeshift --list
Mounted '/dev/dm-0 (sda3)' at '/run/timeshift/6767/backup'
Device : /dev/dm-0 (sda3)
UUID   : e013cba3-a33a-4def-afe0-41df1cc1e6d8
Path   : /run/timeshift/6767/backup
Mode   : RSYNC
Status : OK
1 snapshots, 33.0 GB free

Num     Name                 Tags  Description
------------------------------------------------------------------------------
0    >  2025-05-15_10-03-50  O     Before software installation
sudo timeshift --restore
sudo timeshift --restore
Mounted '/dev/dm-0 (sda3)' at '/run/timeshift/6993/backup'

Select snapshot:

Num     Name                 Tags  Description
------------------------------------------------------------------------------
0    >  2025-05-15_10-03-50  O     Before software installation
1    >  2025-05-15_12-08-40  O     Upgrade      

Enter snapshot number (a=Abort, p=Previous, n=Next):0 <-- Enter snapshot ID

Conclusion

Timeshift is a must-have tool for Linux users who want to keep their system safe and recoverable with minimal effort. It’s especially useful before installing new software or applying major updates. While it doesn’t replace a full backup solution for user data, it’s a reliable way to protect your system’s stability.

If you’re looking for a reliable snapshot tool for your Linux distribution, give Timeshift a try—it might save you hours of troubleshooting in the future.

About The Author

neo

See author's posts

ADVERTISEMENT
Previous Post

Oracle VirtualBox: Port Forwarding in NAT Network Mode

neo

Leave a Reply

Your email address will not be published. Required fields are marked *

Follow Us

  • Trending
  • Comments
  • Latest
Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate: Static Route Configuration via GUI and CLI

MikroTik: Export Configuration in Text File

MikroTik: Export Configuration in Text File

Fortinet FortiGate Upgrade Path Tool

Fortinet FortiGate Upgrade Path Tool

Immich: Installation on Ubuntu 22.04

Immich: Installation on Ubuntu 22.04

NextCloud: Port Forwarding - Essential Ports for Smooth Functionality

NextCloud: Port Forwarding – Essential Ports for Smooth Functionality and Remote Access

Organizing and Managing Photos with Immich: Features I Use

Organizing and Managing Photos with Immich: Features I Use

Install Ubuntu 22.04 on Oracle VM Virtual Box

Install Ubuntu 22.04 on Oracle VM Virtual Box

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Timeshift on Linux: How to Create and Restore System Snapshots

Timeshift on Linux: How to Create and Restore System Snapshots

Oracle VirtualBox: Port Forwarding in NAT Network Mode

Oracle VirtualBox: Port Forwarding in NAT Network Mode

Remote Desktop Access to Ubuntu 24.04 from Windows

Remote Desktop Access to Ubuntu 24.04 from Windows

Fix "blk_update_request: critical target error" on Ubuntu Server (dev sdb, DISCARD Operation)

Fix “blk_update_request: critical target error” on Ubuntu Server with SSD (dev sdb, DISCARD Operation)

Recent News

Timeshift on Linux: How to Create and Restore System Snapshots

Timeshift on Linux: How to Create and Restore System Snapshots

Oracle VirtualBox: Port Forwarding in NAT Network Mode

Oracle VirtualBox: Port Forwarding in NAT Network Mode

Remote Desktop Access to Ubuntu 24.04 from Windows

Remote Desktop Access to Ubuntu 24.04 from Windows

Fix "blk_update_request: critical target error" on Ubuntu Server (dev sdb, DISCARD Operation)

Fix “blk_update_request: critical target error” on Ubuntu Server with SSD (dev sdb, DISCARD Operation)

MikroTik VLAN Configuration

MikroTik VLAN Configuration

ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Browse by Category

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
  • Video Tutorials
    • MikroTik Videos

Recent News

Timeshift on Linux: How to Create and Restore System Snapshots

Timeshift on Linux: How to Create and Restore System Snapshots

Oracle VirtualBox: Port Forwarding in NAT Network Mode

Oracle VirtualBox: Port Forwarding in NAT Network Mode

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.