48
submitted 20 hours ago* (last edited 19 hours ago) by Cornflake@pawb.social to c/linux@lemmy.ml

Hey there, folks! Currently playing around with a laptop that's got three SSDs. Running Arch but that isn't quite related. I have everything configured on one SSD, the other two are totally fresh. What do I need to do to setup one of those fresh SSDs for Timeshift backups? Please walk me through it from the very start- I think I understand some parts but I'm not too certain.

I can format the drives using mkfs.btrfs without any issues, but I'm confused about how I can add subvolumes and configure their root permissions properly to allow Timeshift snapshots.

EDIT: I see now that I misunderstood what Timeshift does. New question- which tool can I use to make a backup of my entire filesystem onto another drive such that it can be restored?

all 19 comments
sorted by: hot top controversial new old
[-] glitching@lemmy.ml 3 points 11 hours ago

borg + vorta. borg is the undelying tech, vorta is the UI. the UI is a little bit rough around the edges but it's immensely powerful for a wide array of use cases.

[-] catloaf@lemm.ee 20 points 19 hours ago

https://github.com/linuxmint/timeshift

For btrfs snapshots, storage on other disks is not supported.

Timeshift is designed to protect system files and settings. It is NOT a backup tool and is not meant to protect user data.

[-] Cornflake@pawb.social 1 points 19 hours ago

That makes more sense to me now. If I did want to backup system files and settings on another drive, what tool could I use?

[-] Eyedust@lemmy.dbzer0.com 2 points 16 hours ago

I mean, I just plug the drive in once every week or so, move any new personal, irreplaceable files to the drive via whichever file manager I fancy at the time, and then set it aside for next backup.

There's no replacement for physically backing up your data. Automation can even be the cause of file loss. Take it from someone who has spent days recovering their files via disk recovery tools.

External drives are camping kits for PCs. If you have one, then it doesn't matter if you lose your system, just reinstall or install something new, open your camping kit and make camp. Make a dotfiles repository if you want to save your home and app configs.

Windows and Mac is like a long term home ownership with a car, kids, partner, and too many bills to be free again. Linux is a nomad life. Nothing is for certain and you could lose your tent in a thunderstorm if you don't stake it down properly.

Also, Timeshift is a very rudimentary and first-layer protection. Something that got configured wrong could have been configured wrong months ago and you may not have caught it at the time and all the restore points you've kept could have the same problem.

[-] AtariDump@lemmy.world 1 points 16 hours ago* (last edited 16 hours ago)

~~Borg~~

Edit: wrote this when I thought you wanted to back up data.

[-] zarenki@lemmy.ml 9 points 17 hours ago

The command you're looking for is btrfs send. See man btrfs-send.

I know of at least one tool, btrbk, which automates both automatic periodic snapshots and incremental sync, but here's an example manual process so you can know the basic idea. Run all this in a root shell or sudo.

As initial setup:

  • Create a btrfs filesystem on the sender drive and another on the receiver drive. No need to link them or sync anything yet, although the receiver's filesystem does need to be large enough to actually accept your syncs.
  • Use btrfs subvolume create /mnt/mybtrfs/stuff on the sender, substituting the actual mount point of your btrfs filesystem and the name you want to use for a subvolume under it.
  • Put all the data you care about inside that subvolume. You can mount the filesystem with a mount option like -o subvol=stuff if you want to treat the subvolume as its own separate mount from its parent.
  • Make a snapshot of that subvolume. Name it whatever you want, but something simple and consistent is probably best. Something like mkdir /mnt/mybtrfs/snapshots; btrfs subvolume snapshot /mnt/mybtrfs/stuff /mnt/mybtrfs/snapshots/stuff-20250511.
  • If the receiver is a separate computer, make sure it's booted up and running an SSH server. If you're sending to another drive on the same system, make sure it's connected and mounted.
  • Send/copy the entire contents of the snapshot with a command like btrfs send /mnt/mybtrfs/snapshots/stuff-20250511 | btrfs receive /mnt/backup. You can run btrfs receive through SSH if the receiver is a separate system.

For incremental syncs after that:

  • Make another separate snapshot and make sure not to delete or erase the previous one: btrfs subvolume snapshot /mnt/mybtrfs/stuff /mnt/mybtrfs/snapshots/stuff-20250518.
  • Use another send command, this time using the -p option to specify a subvolume of the last successful sync to make it incremental. btrfs send -p /mnt/mybtrfs/snapshots/stuff-20250511 /mnt/mybtrfs/snapshots/stuff-20250518 | btrfs receive /mnt/backup.

If you want to script a process like this, make sure the receiver stores the name of the latest synced snapshot somewhere only after the receive completes successfully, so that you aren't trying to do incremental syncs based on a parent that didn't finish syncing.

[-] DonutsRMeh@lemmy.world 10 points 19 hours ago

Use pika backup instead of timeshift. Pika is an actual backup tool that puts your files on any drive you tell it to use (including remote). Timeshift is a snapshots tool, it reverts things to a previous state, it doesn't backup actual files and folders.

[-] Cornflake@pawb.social 4 points 18 hours ago

Thank you- this is exactly the direction I was needing

[-] DonutsRMeh@lemmy.world 1 points 6 hours ago

Absolutely. Good luck to you.

[-] moonpiedumplings@programming.dev 2 points 17 hours ago

I'm pretty sure it's possible to use timeshift to create backups on another drive using rsync (instead of btrfs). They are incremental, and deduplicated, as well.

But the other commenters are correct, timeshift is not a backup tool, it's more for snapshots to undo system changes you may not want. In addition to that, it doesn't do user files by default — because again, it's not a backup tool.

btrfs send/receive technically does what you want, using btrfs to do backups to another drive, but I don't think any GUI app supports it. Plus, you would have to create snapshots for btrfs from the command line.

Your best bet are apps explicitly designed for this usecase, like someone mentioned pika, or borg or restic are good choices. They don't do BTRFS, but they do incremental, deduplicated updates in a user friendly way.

[-] mutual_ayed@sh.itjust.works 2 points 17 hours ago* (last edited 17 hours ago)

Build the snapshot with the below file

btrfs subvolume snapshot -r /path-to-sv/subvol /path-to-sv/subvol.ro

# send the subvolume to file, compress with parallel ZSTD & monitor progress
btrfs send /path-to-sv/subvol.snap.ro | \
    pv -c | pzstd -16 |  pv -c | \
    dd of=/path-to-external-backup/subvol.zstd.back

# delete read-only snapshot
btrfs subvolume delete /path-to-sv/subvol.ro

To restore subvolume from backup we run the process in reverse:

# read backup file and decompress the stream, redirect to temporary read-only snapshot
dd if=/path-to-external-backup/subvol.zstd.back | \
    pv -c | pzstd -d | pv -c | \
    btrfs receive /path-to-sv/


# make a RW subvolume 
btrfs subvolume snapshot subvol.ro subvol

# delete temporary snapshot
btrfs subvolume delete /path-to-sv/subvol.ro    

From here

https://superuser.com/questions/1396241/btrfs-imaging-a-volume-to-an-external-file

You might want to make this into a systemd timer to run at boot or before shutting down

https://linuxconfig.org/how-to-schedule-tasks-with-systemd-timers-in-linux

[-] nanook@friendica.eskimo.com 0 points 16 hours ago

@Cornflake I prefer good old fashioned dump/restore, but whatever works for you. Most people seem to opt for no backups at all, obviously not a good choice.

[-] just_another_person@lemmy.world 0 points 19 hours ago* (last edited 19 hours ago)

Timeshift is not a backup tool, so it's meant to run on the filesystem you've configured it for. If you ran it across many volumes or targets like RAID, it wouldn't work as you'd expect because it's not designed to work that way.

[-] Cornflake@pawb.social 4 points 19 hours ago

Perhaps I'm misunderstanding how Timeshift works. If Timeshift isn't a backup tool then what does it do? I thought that I could use my primary SSD and save snapshots to a secondary SSD using Timeshift. Everything is formatted to BTRFS by the way, it's not like the primary drive is in ext4 or something like that.

Can I configure it to do what I want it to do or do I need some other sort of tool for that?

[-] vhstape@lemmy.sdf.org 8 points 19 hours ago

Timshift is to Linux what Time Machine is to Macs. It’s a snapshot tool that lets you roll back a certain file or your entire filesystem to an earlier state

[-] Cornflake@pawb.social 4 points 18 hours ago

That makes more sense- kinda like nondestructive editing when working with audio/video. The snapshot is more or less a list of instructions to revert a system back to a previous state, not an actual copy of everything.

[-] just_another_person@lemmy.world 1 points 19 hours ago

Exactly. A backup tool makes an entire copy of a filesystem. A time-based snapshot tool only covers the delta of changes to the filesystem.

So if you want a fully functional copy of your filesystem, then you make a full or incremental copy.

If you just want to be able to "rewind" to a point-in-time version of it, then Timeshift or snapshots allow you to do that.

[-] Cornflake@pawb.social 5 points 18 hours ago

Exactly the information I needed, thank you for this :)

this post was submitted on 11 May 2025
48 points (98.0% liked)

Linux

54100 readers
896 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS