
And then after you try to boot up normally guess what it doesn't boot anymore!
I was looking at a bootscreen of my server using IPMI and it was always getting stuck at the drive part but no error was showing up.
Now what could be the problem. My guess was the there was a problem with the bootloader or the RAID.
Let's not dwell on this too much and jump straight into the core of the problem:
So these were the steps:
- Go back to rescue mode.
Use:
fdisk -l
To identify the drives.
- Mount the drives so you can chroot in there: (These results are from my system, you will need to adjust it based on what you see using FDISK)
# Mount the root RAID partition
mount /dev/md3 /mnt
# Mount the boot RAID partition
mount /dev/md2 /mnt/boot
# Mount the EFI partition
mount /dev/nvme0n1p1 /mnt/boot/efi
# Bind mount the system directories
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
- CHROOT into the system:
chroot /mnt
- Re-create the RAID Configuration File Now, inside the chroot, we will back up the broken file and generate a fresh, clean one.
# Back up the old, broken config file
mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.bak
# Scan the active RAID arrays and create a new, clean config file
mdadm --detail --scan > /etc/mdadm/mdadm.conf
After running the second command, you can check the new file with cat /etc/mdadm/mdadm.conf. It should now have clean, non-duplicate entries for your arrays.
- Rebuild the initramfs (Most Important Step) This is the command that fixes the problem. It rebuilds the early boot environment using the corrected RAID configuration.
update-initramfs -u -k all
-u: Updates an existing initramfs.
-k all: Performs the update for all kernels installed on your system.
- Update GRUB (Recommended) While you're here, run update-grub again to make sure its device map is also in sync.
update-grub
- And the last step... Exit and Reboot You're done.
Before you reboot remember to switch boot to normal in OVH panel.
exit
reboot
You can watch the IPMI and see what happens in boot mode. If it boots normally then you have managed to fix the issue.
If you have issues with your hosting and want to setup webservers, proxies, databases or simply install applications use the contact link.
I hope this was helpful to you.
Good luck ☕
Technical writer and developer at DigitalCodeLabs with expertise in web development and server management.
Get the latest posts delivered straight to your inbox.