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?

  • glitching@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    15 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.

    • Xanza@lemm.ee
      link
      fedilink
      English
      arrow-up
      1
      ·
      33 minutes ago

      I’d like to keep using borg+vorta, but unfortunately no native windows support just yet.

      Borg keeps my cluster running, but the fact that I can’t use it on desktop makes me sad.

    • Cornflake@pawb.socialOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      22 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
        link
        fedilink
        English
        arrow-up
        2
        ·
        19 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.

  • zarenki@lemmy.ml
    link
    fedilink
    English
    arrow-up
    11
    ·
    20 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
    link
    fedilink
    arrow-up
    9
    ·
    22 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.

  • moonpiedumplings@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    21 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
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    21 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