r/linuxquestions • • 18d ago

Support linux drive not recognised as boot drive after removing and reinstalling the drive into the computer

i have arch linux on my 1 tb m.2 ssd and windows 10 on my 240 gb sata ssd, and i recently had to take the 1 tb m.2 out to test the functionality of a 256 gb m.2 ssd. i took my gpu out, i took the ssd out, i put the 256 in, i booted into my windows drive, and checked the health of the 256 m.2. after that i shut the computer down and removed the 256 and installed the 1 tb m.2 in its place. then, when i booted , for some reason my 1 tb wasn't in the boot options. i thought it didnt get recognised but no, if i boot into windows and check crystaldiskinfo, its clearly visible there. so wtf is going on?Pls help!!!

1 Upvotes

9 comments sorted by

2

u/tanmaynargas2901 18d ago

probably nothing wrong with the drive. when you pulled it, the firmware saw the disk was gone and dropped its UEFI boot entry. windows still boots because its entry points at the sata drive, and crystaldiskinfo sees the m.2 because the drive itself is fine.

easiest fix first: go into the BIOS and look for something like "add boot option" or "boot from file", then point it at the EFI partition on the 1tb, \EFI\GRUB\grubx64.efi (or \EFI\systemd\systemd-bootx64.efi if you used systemd-boot).

if your board doesn't have that, boot the arch ISO from usb, mount your root to /mnt and the EFI partition where it normally goes (usually /mnt/boot), then:

arch-chroot /mnt
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

running it once more with --removable also puts a copy at \EFI\BOOT\BOOTX64.EFI, so next time you swap drives the firmware can find it even without an entry.

lsblk -f will show which partition is the EFI one (vfat, usually around 512M).

2

u/lifelessvessel483 17d ago

 i had to mount my efi and root partitions before running the chroot command and  after i ran the chroot and grub install command but now i just have a grub cli i can boot into idek what that does

1

u/lifelessvessel483 17d ago

ok i reinstalled grub? but i still cant boot into arch so idk what that was for

1

u/lifelessvessel483 17d ago

ok i can just manually pick /efi/arch/grubx64.efi off of supergrub2disk so im probably just gonna do that every single time

1

u/tanmaynargas2901 16d ago

That path explains it. Your loader lives in EFI/arch, and the command I gave (--efi-directory=/boot --bootloader-id=GRUB) put a copy somewhere your firmware isn't looking. My bad on that.

Since you can get in through supergrub2disk, boot into Arch once that way and recreate the boot entry so you don't need it every time:

sudo efibootmgr --create --disk /dev/nvme0n1 --part 1 --label Arch --loader '\EFI\arch\grubx64.efi'

Swap the disk and partition number for whatever lsblk -f shows as your EFI partition. If it drops you at the grub prompt after that, run sudo grub-mkconfig -o /boot/grub/grub.cfg too, a bare grub prompt usually means it can't find its config.

2

u/lifelessvessel483 16d ago

ty 🙏 this worked

1

u/MongooseWonderful198 18d ago

Before using the grub-install command above, check which bootloader you originally installed. That command assumes GRUB and an EFI partition mounted at /boot.

For a UEFI install, boot the Arch USB in UEFI mode and share efibootmgr -v plus fdisk -l. Both only display information. The first shows any remaining loader entries; the second lets you identify the ESP by partition type. A FAT filesystem and approximate size alone aren't enough to identify it. ArchWiki's ESP guide covers checking the existing partition. That avoids choosing a reinstall command before we've identified your setup.

1

u/3grg 17d ago

Normally, I would say SuperGrub2 Disk, but it does not always work well with Arch. You may need to go the archroot route and reinstall grub that way. Arch is kinda fussy that way.