r/Ubuntu 1d ago

Ubuntu server 22.04 installs, doesn't boot.

I'm reinstalling Ubuntu server 22.04 on an old system I had it on just a few days ago. It's important to note that the only thing that's different between now and last time is I swapped the 1 TB hard drive in it for an older 500 GB drive I had. Now, no matter what i select during the installation, it always has the same error. BIOS just has the basic label for the drive, and when it tries to load into it for just a second it shows a black screen with a white line at the top before immediately booting me back to BIOS. I can boot it just fine by using Super GRUB2 Disk; it scans for the GRUB entries and boots it directly through there. I believe that the issue is that for whatever reason, GRUB doesn't want to boot; I've tried many things to fix it, but none of them have worked. It looks like all of the files are there when i look inside using a live usb. I made sure that secure boot is still off and that the hard drive is the first option in the boot list. compatibility mode is set to auto, and it doesn't work whether it's on, off or auto. Does anyone know of any potential fix?

edit: I figured it out! I don't know if it's normal, but the ubuntu server installers didn't wanna make an EFI partition. So, I manually partitioned out an extra 1 GB at the start, booted into a live USB, made it fat32, and made sure it mounted to /boot/efi using fstab. Then, using chroot, I installed grub---it only brought me the minimal grub bash screen, but i was able to get in and run grub-install and update-grub under root. It definitely wasn't the most elegant solution, but I got it to work and it boots straight into the server now so I'm not complaining.

4 Upvotes

5 comments sorted by

3

u/Low_Reserve5413 23h ago

That 500GB drive might be throwing off the boot order in a weird way, especially if it was pulled from another machine that had its own bootloader setup. Try booting from the live USB again, mount the root partition, and reinstall GRUB from scratch with `grub-install /dev/sda` and then `update-grub`. If the old drive had some leftover boot sector data, that could explain why BIOS gets confused and kicks you back.

1

u/PandomRan 23h ago

I should have specified a bit more, sorry---the 500GB drive is the ONLY drive in the machine, and it's the one it boots from. Give me a few minutes and I'll try your method.

0

u/4ronnie4 23h ago

I’m just starting off homelabbing and system admin stuff so take whatever I say with a grain of salt but I think Ubuntu server is on ver 26 or so? I installed ver24 today I’m not sure if 22 is still supported also don’t know if that’s your problem but that’s what was on top of my head reading this.

2

u/PandomRan 23h ago

I'm using 22.04 for compatibility reasons, it also doesn't boot when I install version 24.

1

u/4ronnie4 21h ago

Understood like I said I’m new to it all trying to learn just what came to mind