Score:1

Ubuntu RAID 1 mdadm, failed boot, files are there but won't boot

pm flag

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.

enter image description here

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?

enter image description here

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.

Nikita Kipriyanov avatar
za flag
Could it be your system is installed as UEFI, but you're trying to boot it as MBR, or vice versa?
jfreak53 avatar
pm flag
It's possible just not sure how to check this or fix it if so. I changed nothing on the partition side, however that was before it is now, not sure about grub though. I did do a `chroot` and re-install grub, so maybe it did it as UEFI? The G5 only supports BIOS boot, not UEFI, it booted before so it was fine before.
Nikita Kipriyanov avatar
za flag
ProLiant G5 is very old and is unsupported, which makes the question off topic. Normally one would suggest to scrap this ancient rust and use modern hardware which boots. Fine then, does this server boot from **anything**? Can you, say, put other hard drives there and install Linux so if will boot?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.