Possible Solution. How to restore a Timeshift snapshot with BTRFS

Don’t get me wrong, Timeshift is fantastic. But, if you ever got caught out there like me, you probably felt trapped and took to talking like a Sailor pretty seriously. I don’t blame you. If it could just do what it says on the box, you know it’ll save that booty. So how in the world do you simply restore a snapshot and move on with your life?

Believe it or not, it’s pretty simple (Requires GRUB or you knowing what to do)

  1. Select a Timeshift snapshot to restore to.
  2. Click restore, follow the instructions, then reboot.
  3. At the Grub selection screen press E to edit the highlighted selection
  4. Find the option rootflags=subvol=timeshift-btrfs/.../@ and change it to rootflags=subvol=@
  5. After you’re back in, immediately run sudo update-grub
  6. You’re done :slight_smile:

At this point, that’s about it. The snapshot is restored and you’ve got nothing left to do.

Here are some questions…

  1. Why doesn’t Timeshift suggest, advise, tell or warn of these critical steps?
  2. Why does restoring a snapshot even change rootflags=subvol=@ to rootflags=subvol=timeshift-btrfs/.../@
  3. At the moment, if one keeps booting into a particular snapshot, they’ll destroy it (the opposite of its purpose), so why?

Hopefully you never get caught out there like I did. I got so tired of the unreliability, I took to installing and configuring Snapper and in the process of doing that, I discovered the above solution for Timeshift. It should never have come to that but I’m glad it did. If Timeshift ever fails, Snapper is pretty much ready to go. But, in the meantime, Timeshift works fine after you know what to do.

Just not out of the box?

3 Likes

About a year ago, and still somewhat new to BTRFS; I ran into possibly the same issue?

But as you may see, it took quite a bit to figure out what that restore button actually did. (I took the loooong route to fix. But I was still new to BTRFS.)

I am still afraid to go near that Timeshift restore button, and I have restored via btfs send/receive since then.

1 Like

I do believe what happened to you has happened to me. I read that thread many times and I just couldn’t figure it out. I kept googling “Timeshift restore” and never got a clue on how to restore a snapshot correctly. At the moment, without Google and just going through the process of “restore”, I would swear I’m all done… but the truth is, I’m making things worse.

I took screenshots of the process because Timeshift only ever told me two things.

After opening up the Timeshift GUI, selecting a snapshot and hitting restore…

  1. Warning Data will be modified. Please save your work and close all applications. System will reboot after files are restored (but the system never reboots like the rsync version).
  2. After hitting next, the last prompt I see: Restore completed. Restored subvolumes will become active after system is restarted. You can continue working on the current system. After restart, the current system will be visible as a new snapshot…

Here is what I thought would/should happen.

Reboot and be done with it.

But, what actually happens is, silently my Grub has changed to boot me into one specific snapshot. On first boot, it does look like the restore worked. Without any more prompts, notices, suggestions otherwise, I think I’m all done but the truth is, it’s a sinister time bomb.

Why? Did you know booting into a snapshot you could get caught up in Timeshift cleaning that snapshot out from under you? Seriously. One moment, it’s all good and the next, your apps start to lock up, your wallpaper is gone, no mouse or keyboard input and nothing left to do… It’s as if it’s all being erased before your eyes. You hard boot the computer and realize that snapshot is now gone because you just can’t boot the system up…

This happened to me 3 or 4 times before I went into the Timeshift schedule and made every option 9999.

Although that doesn’t really fix anything, it stopped Timeshift from cleaning out the snapshot I might be currently working with.

The last update (a few days ago) completely broke my Pipewire sound server. Pipewire crashed almost all the time and caused the system to lag and choke. I only knew of one option to quickly roll back and hope for the best. So, I pulled up Timeshift and hoped for the best. I restored an update and it seemed to work but what I didn’t know was, I was about to get stuck in a loop of frustration and cursing the heavens.

After restore, I thought I was free to experiment but it just so happens, I can’t seem to restore from a restore that wasn’t committed yet? I would go through the process to restore but upon reboot, I’m right back in a broken system. Timeshift is saying “restore complete” but after a reboot, it’s just as broken as how I left it. It was so bad I spent several hours figuring out Snapper. In the process of figuring out Snapper I discovered how to truly restore with Timeshift.

But, does it work? Yeah. Does it work the way I imagine it? Yeah. When it works its great but you just need to finish it up. No one told me this. I never got a clue about it and I had to figure it out on my own from a competitive product. I’m so deep in with Snapper at this point I might as well go all the way. But, I love Timeshift and it was reliable with rsync. I recommended it to everyone and I believe in it.

So, I think, Timeshift on Manjaro with BTRFS must be broken. We’re not being told to “finish” anything. If you make a restore with Timeshift and follow my first post, you’re good. After that, Timeshift becomes reliable. But it just doesn’t work this way right out of the box. I’m thinking it must be a bug.

I wish I knew more about BTRFS at the time, I even have trouble reading my own words.

My thoughts exactly. You boot into a read/write snapshot and just start using that. If you did this regularly, it would create an absolute mess.

My plans were to rip it out and move to Snapper, but I’m hesitant to rip out and replace “installed by default” packages on a rolling release distro unless absolutely I have to, and 100% know what I’m doing. In this process I understood BTRFS. btrfs-progs, and of course, Timeshift a lot more.

So ended up I just setting read only to certain Timeshift snapshots and deal with them differently. (And avoid the restore button.)

I wish I knew your fix then… I did something like /s/timeshift-btrfs\/snapshots\/2023-10-16_21-39-06\/@/@/g in vim, since I ended up having replacing a bunch in grub.cfg. Feels like I would of tried something so simple first, in one of the hundred times I chroot’d in, but who knows.

I’m sorry you went through that pain. Timeshift isn’t an app we use for fun. Timeshift is meant to save the ass; not make things worse. Technically, if you restore a snapshot, reboot (edit your boot selection), log-in and finally update-grub, it’s perfect and as it should be.

But, if you don’t know this, it’s possibly the worse experience you’ll ever have on Manjaro. Hopefully it’s a bug and will be fixed. So, until then, just finish it manually and you’re good to go <3

1 Like