Do not hesitate to leave a comment. If see an error, you can issue a pullme request om my github
Install GRUB on a USB key
Booting a Manjaro Installation After NVMe Drive Failure
My personal computer is equipped with two 1 TB NVMe PCIe SSDs.
- Drive 1 contains the boot partition and a Windows 11 installation, primarily used for gaming.
- Drive 2 hosts my Manjaro Linux installation.
Unfortunately, disaster struck after a routine Windows 11 update, the first NVMe drive suddenly failed. Although the BIOS still detects it, the reported capacity is 0 GB, and attempting a self-test causes the BIOS to hang.
As a result, the system became unbootable. However, since my second SSD (with Manjaro) remained intact, I decided to install GRUB on a USB key to boot into my Manjaro installation while troubleshooting the faulty SSD.
The process was not overly complex, but it took some time to gather the correct information since most online resources didn’t fully match my situation. Also, the GPTs weren’t big help. Below is the step-by-step guide I followed to install GRUB on a USB key.
Requirements
You’ll need:
- Two USB keys
- One for booting into a Linux live environment.
- Another to install GRUB on.
⚠️ Make sure to correctly identify your devices before proceeding.
In my case:
/dev/nvme0n1→ SSD containing Manjaro/dev/sdb→ USB key for GRUB installation
Step-by-Step Procedure
-
Boot into the Linux live environment.
- Prepare the USB key.
- Create a GPT partition table.
- Add a single FAT32 partition (≈ 200 MB).
- Set the boot and esp flags.
- This partition serves as the EFI partition that the BIOS will use to load GRUB.
- I used GParted, but any partitioning tool will work.
- Mount the Linux root partition.
sudo mount /dev/nvme0n1p3 /mntIn my setup, I don’t have a separate
/bootpartition. If you do, mount it under/mnt/boot.At this point:
/bootshould contain your kernel files./boot/grubshould include GRUB and its configuration filegrub.cfg.
- Mount the EFI partition (USB key).
sudo mount /dev/sdb1 /mnt/boot/efi - Mount the necessary system directories.
sudo mount --bind /dev /mnt/dev sudo mount --bind /proc /mnt/proc sudo mount --bind /sys /mnt/sys sudo mount --bind /run /mnt/run - Chroot into your system.
sudo chroot /mnt - Install GRUB to the USB drive.
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --boot-directory=/boot --recheck --removable /dev/sdb - Exit the chroot and unmount.
exit sudo umount -R /mnt
Final Notes
That’s it! GRUB is now successfully installed on the USB key!
It’s not necessary to run grub-mkconfig or update-grub afterward, since grub.cfg already exists and is up to date.
This setup allowed me to continue using my Manjaro system seamlessly while investigating possible recovery options for the failed SSD.