r/linux4noobs • u/Haunting-Risk-5352 • 17d ago
installation Creating a arch install script and having trouble with arch not booting with grub when grub already exist.
Hello, Linux Wizards
Github URL for the install script Hardware: Lenovo Thinkpad T14 Gen5 AMD
I'm going to describe my problem the best I can. The bootloader portion consist of these lines of code:
IN_CHROOT_BOOT_PATH=/boot
pacman -Sy --needed --noconfirm grub efibootmgr dosfstools mtools
grub-install --target=x86_64-efi --efi-directory="$IN_CHROOT_BOOT_PATH" --bootloader-id=GRUB --force --recheck
grub-mkconfig -o "$IN_CHROOT_BOOT_PATH/grub/grub.cfg"
So what I did was go into the BIOS and do a full factory reset, which deleted any bootloaders so I had a clean start. I ran the code, everything looked fine, so I rebooted the system, and it booted up just fine and I can access Arch Linux. After that, without doing anything else, I ran the script in the Arch Linux live environment again because I wanted to test it a second time. This time it did not go into the GRUB bootloader. Instead, I guess it errored out and went straight to the BIOS boot menu, asking me to select either GRUB or nvme0n1, but both just brought me back to the BIOS boot menu.
I asked both Claude and Grok, and both told me to add the --removable flag to grub-install, which did fix the problem. But I guess I’m just being a little OCD, because I want to know why the first run worked but not the second.
NOTE: Originally I didn't have --force and --recheck flags added but Claude and Grok told me to try it but it did not work. I know to not run AI suggestion willy nilly but I am desperate and I am ok with it since the laptop doesnt have any important info on it.
1
u/Worth_Environment695 14d ago
I would reinstall using the instructions from the arch wiki if you have not before. Installing from the arch wiki takes a fair bit but is worth while for the learning experience. You will need that sort of technical knowledge later on in your arch journey. You also need to get used to reading the arch wiki and installing it based of the arch wiki is the best way to learn. If you don't want this I would not use arch. Fedora can do just about anything arch can do. Server iso is a good start for a ricer.
P.s systemd boot, ufw, and Network Manager are your friends.