How to fix GRUB initramdisk

From HyperSecurity Wiki
Revision as of 06:19, 19 January 2017 by 70.79.46.50 (talk)
Jump to: navigation, search

Using System Rescue CD/DVD

When converting a physical live machine to vmware using vmware converter, there can be issues with booting due to how vmware recreates the initrd and grub.cfg. To fix this, do the following:

System Rescue CD Download

Boot the live CD and press option "E" to boot the / (root) parition

Once booted to a full OS, login to the OS as root and run the following in order:

update-initramfs -t -k all -u
update-grub 

This will update the initramfs as well as the grub.cfg file to match the new initrd. Reboot to confirm grub and booting is fixed.

Debian/Ubuntu broken init

Source

First boot with Debian Live CD/DVD. Once booted, become root:

sudo su -

Once root, mount the root partion to mnt. sdaX for non software RAID. mdX for software RAID.

mount /dev/sdaX /mnt

Next mount the boot partion to /mnt/boot if you multi partions

mount /dev/sdaX /mnt/boot

Copy over the /boot dir contents to /mnt/boot for a working kernel and initrd:

copy /boot/* /mnt/boot

Then bind mount the following partitions:

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

Chroot the /mnt directory:

chroot /mnt /bin/bash

Update the Grub:

update-initramfs -t -k all -u
update-grub 

Exit Chroot and reboot:

exit && reboot && eject


Redhat Systems

https://wiki.centos.org/TipsAndTricks/CreateNewInitrd