Recover system with missing initramfs


Issue observed in Lenevo systemx Avago megaraid sas-mfi bios - server raid M520, while running update-initramfs (corrupted)

/boot is using /dev/sda2

The root partition is using LVM-root in this server(Ubuntu 16.04):-

mount /dev/mapper/lvm-root /mnt (which was using PV sda3)

sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys

chroot /mnt

mount /dev/sda2 /mnt/boot  #sda2 has /boot files

///////////////////////// This was optional in this case  ////////////////////////////

check and install grub on the boot partition

This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.

grub-install /dev/sda2
grub-install --recheck /dev/sda2
update-grub

/////////////////////////////////////////////////////////////////////////////////////
update-initramfs -u -k all


/////////////////////

reboot




No comments:

Post a Comment