Problem trying to import/restore BTRFS Snapshot

It’s been a bad night… I was cleaning up, found a bunch of old snapshots not showing in Timeshift and went to remove them.


I managed to get a liveUSB and send the BTRFS-snapshot out to my BTRFS storage drive now mounted at /mnt/W2.

So what we have is this:

Current snapshots (new install)

sudo btrfs subvolume list / ─╯
ID 256 gen 307 top level 5 path @
ID 257 gen 307 top level 5 path @home
ID 258 gen 302 top level 5 path @cache
ID 259 gen 307 top level 5 path @log
ID 260 gen 53 top level 5 path @swap
ID 261 gen 35 top level 5 path timeshift-btrfs/snapshots/2024-01-21_14-00-05/@
ID 262 gen 158 top level 5 path timeshift-btrfs/snapshots/2024-01-21_15-00-02/@
ID 263 gen 160 top level 5 path timeshift-btrfs/snapshots/2024-01-21_15-00-02/@home
ID 264 gen 222 top level 256 path mnt/sys-back/@
ID 265 gen 207 top level 5 path timeshift-btrfs/snapshots/2024-01-21_15-20-33/@
ID 266 gen 209 top level 5 path timeshift-btrfs/snapshots/2024-01-21_15-20-33/@home

The one of interest is at /mnt/sys-back/@.

This is the system snapshot which I need to restore… made with timeshift, now I converted it to read-only, and after exporting to W2 I have re-imported it to /mnt/sys-back/@.

So really, I have 2 questions:

  1. Is there a way to get it recognised by Timeshift and use Timeshift to restore it?
  2. Is there a way to directly restore it to the default system boot?

Assuming you are booting the system off your current @ subvolume, I would do it this way.

  1. mkdir /mnt/btrfsroot
  2. mount subvolid=5 of your main btrfs filesystem at /mnt/btrfsroot
  3. mv /mnt/btrfsroot/@ /mnt/btrfsroot/@old
  4. mv /mnt/btrfsroot/@old/mnt/sys-back/@ /mnt/btrfsroot/@
  5. reboot

All those commands need to be run as root.

Just be aware, since you are restoring your root from a different install, you might need to chroot in and clean some things up. Especially if your UUIDs changed.

1 Like

Yup, had to reinstall Grub - but it’s all good now.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.