Have a 3 disk RAID 1 array of my os drives, ubuntu 20.04, software RAID. I had to shut the server down temporarily to install a new PCI card, went to boot it back up and the OS said no boot device found.
So I pulled the drives, plugged into another PC and ran examine on mdadm. It said the RAID was still active, only thing I can figure is I had a drive failure a week ago and replaced the drive, I think this drive replaced was the only drive that had the boot setup on it. I did it live, so never noticed until now.
So I ran mdadm --stop /dev/md125
, then ran mdadm --assemble --readonly /dev/md125 /dev/sdc4 --run
, it said active and all good. I did this for all 3 partitions on this drive, they all mounted fine, files are there.
I have root and boot partition, but it won't boot. I can only imagine I never made this drive bootable or did grub config maybe? How could I do that now, in a secondary PC so I can boot this drive?
I understand that by doing this it probably won't reconnect to the other 3 drives and resync, that's fine, I just want to get it to boot so I don't have to rebuild the whole system. I have backups, but it's the time it'll take. That being said, this is the second time this has happened to me, so what do I do to prevent this in the future and copy so it boots?
I should also mention, the server is a bit old so its BIOS boot not UEFI.
UPDATE
Found this here. I ran the following commands to get the /boot
partition to boot:
sgdisk -t 1:ef02 /dev/sdc
grub-install --boot-directory=/mnt/boot --force --target=i386-pc /dev/sdc -v
No errors, so in another PC I rebooted and selected this drive to boot from via a USB converter cable. Drive boots! So I took it back to my server, won't boot. The server is an HP DL385 G5, booted fine before this. It sees the drive in its boot sequence, the controller card prints out the drive in boot sequence. I also ran diagnostics through its BIOS and drive diagnostics says it found a bootable drive.
So after the commands above it boots on other pcs, not the G5. I'm thinking of clearing NVRAM next.