Grub rescue: unknown filesystem

Hello, I’ve destroyed my bootloader.

I installed manjaro on my laptop with i3 and it was working great. Then I decided to boot into a liveUSB of ubuntu server with said laptop, using it to install ubuntu onto a separate USB (such that the USB will function as a harddisk). The Ubuntu USB works great. My laptop does not.

When I used the ubuntu server installer I thought that the image wouldn’t touch the actual laptop hard drive, and it looks like the partitions are fine, but I think it screwed up something with booting, probably with grub. I just need a little help restoring grub. It looks like the partitions of the actual disk were left untouched. I have a 500MB sda1 which used to boot in UEFI mode. The partition still has the boot flag enabled, and it looks like the filesystem is Fat32. If I boot into my manjaro liveUSB I can mount sda1 and view the files. My sda2 partiton is encrypted with LUKS, so I can’t mount and view that (I haven’t tried manually mounting and decrypting) but this partition looks untouched as well.

When I try to boot, the laptop asks for my encryption passphrase like usual.

Enter passphrase for hd0,msdos2 (18d87a31...)

However after entering it correctly I get an error:

error: access denied
error: no such cryptdisk found.
error: disk 'cryptouuid/18d87a31...' not found

And I am dropped into grub rescue.

I’ve tried setting the root and prefix, and then running insmod normal but grub’s ls is saying that the filesystem is unknown for both partitions. I’d expect this from the encrypted partition but not the boot partition. This is strange because I can view the boot partition filesystem just fine from terminal in the liveUSB and even from the laptop BIOS menu.

grub rescue> ls
(proc) (hd0) (hd0,msdos2) (hd0,msdos1)
grub rescue> ls (hd0,msdos2)/
error: unknown filesystem
grub rescue> ls (hd0,msdos1)/
error: unknown filesystem

My BIOS settings are set to UEFI mode with legacy disabled & secure boot disabled. In BIOS I can add a boot option and it allows me to select the following file system:

PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(1,MBR,0x37AA4A0A,0x800,0xFA000)

From there I can select the EFI/ folder and select either Manjaro/grubx64.efi or boot/bootx64.efi. I’ve tried both and the cryptodisk cannot be found in either case.

Additionally, oddly, in my BIOS there is a UEFI boot option for HDD1-ubuntu and my actual harddisk (after adding it as described above) is labeled as HDD2-1. The ubuntu server USB is not inserted in the laptop, I can only assume this entry is residue from the install. I can’t seem to remove it from BIOS alone like I can the manjaro boot option that I created.

  • If I select the HDD1-ubuntu option I am taken to the same LUKS decryption screen before getting the same error as always

I think there is a simple answer to this but I haven’t been able to find any solutions browsing the web, namely because grub rescue isn’t recognizing the fat32 filesystem. I’d prefer not to have to reinstall the manjaro OS over top of this one.

If it helps, here is the output from parted:

$ sudo parted -l
Model: ATA WDC WD5000LPVX-7 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  525MB  524MB  primary  fat32        boot
 2      525MB   500GB  500GB  primary


Model: Specific STORAGE DEVICE (scsi)
Disk /dev/sdb: 31.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 2      2177MB  2181MB  4194kB  primary               esp

Disk /dev/sdb is the live USB of manjaro I am using

see this topic if you need to chroot for grub restore

sudo su

cryptsetup luksOpen /dev/sdaX crypto ( here volume mapper encrypted )
cryptsetup luksOpen /dev/sdaY swap ( case out encrypted )

mount /dev/mapper/crypto  /mnt
mount /dev/sda1 /mnt/boot/efi ( if you need Efi )

mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -t devpts pts /mnt/dev/pts/

chroot /mnt
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --verbose
efibootmgr -v
sync
exit ( quit chroot )

see also with gparted to add flag esp on partition sda1 ( boot is ok , missing esp )

1 Like

With UEFI you have to be very careful even when installing to a USB drive and should have created an ESP on the USB drive itself which would have prevented anything being written to your laptop’s ESP. Now you need to:

  • boot a Manjaro USB stick

  • indeed chroot into the Manjaro environment as per @stephane 's instructions and then:

    update-grub
    
  • shut down,

  • remove the Manjaro USB stick

  • boot.

If that would not give the required result, please provide the output to:

efibootmgr --verbose

from the USB stick and we’ll take it from there.

:innocent: