Can't chroot - can't repair grub - can't boot - messed up big time BTRFSonLUKS timeshift dual boot

Hey,

So… I dunno how to start… well, long story short, I did mess up :frowning:

I did install some time ago following this wonderful guide.
My install was working so well that i decided to address the message I always had on boot ERROR: resume: no device specified for hibernation and I step across this topic.
And things escalated quite badly…

So, I thought I had the problem of always booting in a past snapshot as mentioned here, so I decided to jump into a live environment and do that.

I then rebooted into my system (reFind was gone, directly grub to decrypt disk, no more invite with the different snap to restore neither from refind nor grub) and realized all my last installed programs and updates weren’t there anymore (but my files seemed to be)… so i went into live environment again, installed timeshift, restored a snapshot, rebooted back… to see nothing changed… except the snapshot i just restored disappeared from the list in timeshift… then i restored another snap from live again, and same when i booted back…
So i think i went live, chroot, and did that again.

Last time i started the system, when i shut it down i had this screen
IMG_20210720_120747_tigr

and then when started up again this one
IMG_20210720_121525_tigr

and now if i boot into live environment i am able to
Decrypt and mount your luks partition (e. g. /dev/sda2)

sudo cryptsetup luksOpen /dev/sda2 crypt &&
sudo mount -o compress=zstd,subvol=@ /dev/mapper/crypt /mnt

but when i want to:
Mount your EFI boot folder (e. g. /dev/sda1)

sudo mount /dev/sda1 /mnt/boot/efi

I got mount: /mnt/boot/efi: mount point does not exist.
which sounds kind of bad… i might have fail i guess :confused: did i mount the wrong partition before doing grub-mkconfig -o /boot/grub/grub.cfg mkinitcpio -p linux grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS I guess i’ve no idea, it was late (let’s put it that way…)

At that point, if you have any idea if i can restore some of my system (don’t even know if any of the snapshots are good as it seems restoring one from yesterday rolled back way before yesterday)… but most of all, if at least I could retrieve my data, then i wouldn’t (of course i would… a lot… but hey :roll_eyes:) mind redoing a fresh install.

If @2000 is around… :stuck_out_tongue:

Thanks in advance for your time and consideration !

I’m not using btrfs so I’ll leave it to others here to help you with that.

But whatever you do now, don’t change anything on your disk.
Simply copy your personal data to an external disk so that you don’t lose your data permanently.

This kind of incident is a perfect lesson about the benefits of always having good backups of your personal data. :wink:
Everything else can be restored easily.

1 Like

Can we see the output of sudo btrfs subvolume list /mnt

1 Like
sudo btrfs subvolume list /mnt
ERROR: not a btrfs filesystem: /mnt
ERROR: can't access '/mnt'

I’m in live environment

You have to do these steps first:

1 Like

[liveuser@eos-2021.04.17 ~]$ sudo cryptsetup luksOpen /dev/sda6 crypt &&
sudo mount -o compress=zstd,subvol=@ /dev/mapper/crypt /mnt
Enter passphrase for /dev/sda6:
[liveuser@eos-2021.04.17 ~]$ sudo btrfs subvolume list /mnt
ID 256 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-11_13-18-36/@
ID 257 gen 42959 top level 5 path @home
ID 260 gen 42383 top level 256 path timeshift-btrfs/snapshots/2021-07-11_13-18-36/@/var/lib/portables
ID 261 gen 42383 top level 256 path timeshift-btrfs/snapshots/2021-07-11_13-18-36/@/var/lib/machines
ID 267 gen 42687 top level 5 path @var-cache-pacman-pkg
ID 268 gen 42830 top level 5 path @swap
ID 424 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-11_13-24-34/@
ID 430 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-11_13-46-42/@
ID 500 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-18_14-00-01/@
ID 531 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-19_17-50-27/@
ID 535 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-19_20-01-44/@
ID 536 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-19_20-04-49/@
ID 537 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-19_20-23-42/@
ID 541 gen 42961 top level 5 path timeshift-btrfs/snapshots/2021-07-19_21-00-01/@
ID 692 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-20_04-22-48/@
ID 712 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-20_04-37-37/@
ID 713 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-20_05-30-20/@
ID 714 gen 42963 top level 5 path timeshift-btrfs/snapshots/2021-07-20_03-41-21/@
ID 715 gen 42968 top level 5 path @
ID 716 gen 42946 top level 5 path timeshift-btrfs/snapshots/2021-07-20_12-00-02/@

Can we see ls /mnt/boot

1 Like
$ ls /mnt/boot
ls: cannot access '/mnt/boot': No such file or directory

Can we see ls /mnt

1 Like
ls /mnt
bin  crypto_keyfile.bin  lib  lib64  mnt  opt  root  sbin  srv  swap  usr

Well…that is bad. You seem to be missing some things…like /etc, /var and /boot

You probably need to mount some of those snapshots and find the last good one.

You can do that with something like:

sudo umount /mnt
sudo mount -o compress=zstd,subvol=timeshift-btrfs/snapshots/2021-07-20_12-00-02/@ /dev/mapper/crypt /mnt

Then go backwards through the snapshots until you find a good one.

1 Like

$ lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
loop0 squashfs 4.0 0 100% /run/archi
sda
├─sda1 ntfs Récupération A4AC25A5AC25734A
├─sda2 vfat FAT32 1A26-42F7
├─sda3
├─sda4
├─sda5 vfat FAT32 99BB-CD47
└─sda6 crypto_L 1 709702e8-da92-4d9b-8d93-287f311a5a05
└─crypt btrfs 84f7e9e8-2e40-4ad1-a9dd-616306520173 237.9G 37% /mnt
sdb iso9660 ENDEAVOUROS 2021-04-17-11-08-44-00 0 100% /run/archi
├─sdb1 iso9660 ENDEAVOUROS 2021-04-17-11-08-44-00
└─sdb2 vfat FAT16 ARCHISO_EFI 0749-E1B8

:frowning: will do
thanks so much for your help.

any easy way to save my data before hand? (but i guess trying restoring the snapshots won’t mess with the files in /home?)

You can make a copy of your data to another disk. Backups are always a good idea.

That being said, we can restore your btrfs snapshots in a totally non-destructive way as long as your filesystem isn’t corrupted.

You can also take a snapshot of @home, that isn’t really a backup though. Still worth doing:

sudo btrfs subvolume snapshot -r /mnt/@home /mnt/@home-snap-20210720
1 Like

how could i make sure of that?

alright so, restoring one snapshot

$ sudo umount /mnt
[liveuser@eos-2021.04.17 ~]$ sudo mount -o compress=zstd,subvol=timeshift-btrfs/snapshots/2021-07-20_03-41-21/@ /dev/mapper/crypt /mnt
[liveuser@eos-2021.04.17 ~]$ ls /mnt/boot
efi

…a sign of life ?

shall I

sudo mount /dev/sda2 /mnt/boot/efi

?

Just so you know, that doesn’t restore anything, you are just looking at it.

No, that is probably a read-only snapshot you have mounted.

First we should take a look at ls /mnt

We should also be concerned that your /boot is empty. Your kernels and initramfs should be there.

1 Like

indeed

ls /mnt
bin  boot  dev  home  proc  run  swap  sys  tmp  var

I dunno what i did :frowning:

You still don’t have an /etc. Unmount the current snapshot and mount the one from before that one.

Also, that snapshot it missing /usr . Did you exclude that from your timeshift snapshots?

1 Like