System not bootable after restore timeshift on btrfs

Hello all, i use EndeavourOS since 6 months, i just come to see a problem of language of xfce this morning after some update yesterday evening i suppose, passing from french to english and with some strange error message in terminal emulator about wrong caracters.

But the worse thing is not there, i did try to solve my problem of language by restoring a previous snapshot with timeshift via BTRFS.
My system is using luks on LVM+BTRFS with SYSTEMD-BOOT, not grub.

The result after to proceed to the change in TimeShift is that the system can’t boot anymore.

I don’t know how to read the log jounalctl knowing that i have the access to the partitions via a older system installed in another disk.

I don’t know neither how to identify what is the right btrfs subvolume to point out to come back to the situation before to use the restore of TimeShift. i proceed to the restore at 9:31am

image

my fstab point on / with @ with id 256 :

image

1 Like

You have a separate /boot. That requires extra steps after a restore since the kernel and initramfs no longer match the kernel modules in your install.

You will probably need to boot off the ISO, arch-chroot into your system and reinstall the version of the kernel that matches your kernel modules.

1 Like

i just want to come back at the situation of this morning, my fstab root pointed on @ that was id 256 and it seems that this id point now to a snaptshot.
i would have just to move to original snapshot, i would have :
ID 256 gen 345300 top level 5 path @
ID 943 gen 345329 top level 5 path timeshift-btrfs/snapshots/2022-02-16_09-31-59/@
no ?

I don’t use timeshift specifically so I don’t what it does when it performs a restore but if it preserved the old subvolume you can just move or snapshot it back.

I have never tried Timeshift with systemd-boot.
The program’s website says that only Grub2 is supported.
Bootloader must be GRUB2. GRUB legacy and other bootloaders are not supported.

It will probably be able to rollback the snapshot. However, extra work will be needed to make it bootable as described above.

Have you tried using timeshift --restore after you have arch-chrooted into your system?
It lists your snapshots and makes moves for you.

Thanks, do you know what is the commandline executed when doing timeshift --restore ?

I am not sure if I understood the question correctly.
But, that timeshift --restore is that commandline command.
It will print a list of your snapshots from which you can choose the one you want to try to jump to.
You just need to first chroot to your system.

how can i get the syslog if i’m logged on another system(same machine) , seen the original system is not bootable, to see the error messages !?

You use chroot.

Here’s an example of how I did it in a virtual machine. You have different names for the hard disks. Change your own names to the commands. And you probably have a different number of subvolumes, take all these into account. So those commands are not directly applicable to you.

  • Boot from EndeavourOS LiveISO

  • Open XFCE Terminal

  • Find your non bootable root: lsblk -f

  • Decrypt that disk: sudo cryptsetup open /dev/vda2 levy
    And enter that passphrase.

    Mount it:

  • sudo mount -o subvol=@ /dev/mapper/levy /mnt

  • List all subvolumes from /mnt sudo btrfs su li /mnt

Summary

ID 256 gen 87 top level 5 path timeshift-btrfs/snapshots/2022-02-17_09-42-54/@
ID 257 gen 110 top level 5 path @home
ID 258 gen 90 top level 5 path @cache
ID 259 gen 111 top level 5 path @log
ID 260 gen 29 top level 5 path @swap
ID 261 gen 27 top level 256 path timeshift-btrfs/snapshots/2022-02-17_09-42-54/@/var/lib/portables
ID 262 gen 28 top level 256 path timeshift-btrfs/snapshots/2022-02-17_09-42-54/@/var/lib/machines
ID 263 gen 52 top level 5 path timeshift-btrfs/snapshots/2022-02-17_08-35-24/@
ID 264 gen 85 top level 5 path timeshift-btrfs/snapshots/2022-02-17_08-37-42/@
ID 265 gen 121 top level 5 path @

  • Mount rest of subvolumes:
sudo mount -o subvol=@cache /dev/mapper/levy /mnt/cache  
sudo mount -o subvol=@log /dev/mapper/levy /mnt/log  
sudo mount -o subvol=@home /dev/mapper/levy /mnt/home  
sudo mount -o subvol=@swap /dev/mapper/levy /mnt/swap
sudo mount /dev/vda1 /mnt/boot
  
and so on...

Then chroot:

  • sudo arch-chroot /mnt

    Now you can example do this and that

  • journalctl -b -0

  • sudo timeshift --restore

When you are done:

  • exit

  • sudo umount -l /mnt

  • sudo poweroff (or sudo reboot)

1 Like

Thanks a lot i will try later today, like i’m working now.

But can you explain me how it is possible the subvolume id 256 was /@ and became timeshift-btrfs…/snapshot…

i tried to understand which btrfs command can do that and make the subvomule id 943 the new /@.

i’m curious to deeply understand the reverse process to come back to previous situation via command line. i suppose between command to create new snaptshot, mv old subvolume and so on ?

thanks in any case.

I don’t know the history of your system but one way would be to rename it with the mv command.

The safest way to do this is to mv the current @ to old@. Then take a snapshot of the subvolume you want to restore with a destination of @

it doesn’t work because of use of luks on top LVM on my system, with the last endeavouros livecd , i have the error : mount: unknown filesystem type ‘LVM2_member’

After decrypt, use lsblk-f to list your disks.
Find out you volume group name. (i think its: vg-endeavouros) and use it with mount command.

I don’t have btrfs example, but i do have one vm with ext4:

Summary

Edit. sorry for the late reply. I’m rarely around these days. And good luck.

i did try with le VG name : * sudo mount -o subvol=@ /dev/mapper/vg-endeavouros /mnt and it give me the error message mentioned, i have the same structure as your screenshot (replacing ext4 by btrfs)

/dev/mapper/vg-endeavouros

I think it has to be:
/dev/vg-endeavouros/home
/dev/vg-endeavouros/var

etc

for the root it has to be /dev/vg-endeavouros ?! non ?
the structure is :
/dev/vg-endeavouros/@
/dev/vg-endeavouros/@home
/dev/vg-endeavouros/@var

as mentioned in the fstab (in first post)

Try /dev/vg-endeavouros/root

i will thanks