Professional Documents
Culture Documents
Boot the system using installation DVD or ISO and enter into the rescue mode. Follow
the steps below for a detailed instruction on how to boot into rescue mode.
Now we skip the chroot step here as we do not want to enter the root environment.
1 # cd /mnt/install/repo/Packages
2 # rpm -ivh --root=/mnt/sysimage kernel-3.10.0-514.el7.x86_64
If there is a newer kernel already present in the system you will be prompted that newer
version of the package is already installed.
1 # chroot /mnt/sysimage
2 # grub2-mkconfig -o /boot/grub2/grub.cfg
3. Verify – Check for the file in /boot to have the new kernel. Also verify the kernel
menuentry in the file /boot/grub2/grub.cfg.
1 ls -lrt /boot/vmlinuz-*
2 -rwxr-xr-x. 1 root root 5392080 Nov 22 2016 /boot/vmlinuz-3.10.0-514.el7.x86_64
3 -rwxr-xr-x. 1 root root 5392080 Oct 1 12:44 /boot/vmlinuz-0-rescue-4bd23218ddab41e587bdd39ae2cfc09a
1 # cat /boot/grub2/grub.cfg
2 .....
3 menuentry 'CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os
4 --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.el7.x86_64-advanced-7efe94a2-10ec-40e4-8d89-a52faf13535e' {
5 load_video
6 set gfxpayload=keep
7 insmod gzio
8 insmod part_msdos
9 insmod xfs
10 set root='hd0,msdos1'
11 if [ x$feature_platform_search_hint = xy ]; then
12 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-
13 baremetal=ahci0,msdos1 --hint='hd0,msdos1' f88bd588-6f4d-4050-bd3f-443cf2049ee7
14 else
15 search --no-floppy --fs-uuid --set=root f88bd588-6f4d-4050-bd3f-443cf2049ee7
16 fi
linux16 /vmlinuz-3.10.0-514.el7.x86_64 root=/dev/mapper/cl-root ro crashkernel=auto rd.lvm.lv=cl/root
rd.lvm.lv=cl/swap rhgb quiet LANG=en_US.UTF-8
17
initrd16 /initramfs-3.10.0-514.el7.x86_64.img
18
}
.....
4. Filesystems relabeling
Create the file /.autorelabel to relabel the filesystems, during the next reboot, in case
you are using SELinux:
1 # touch /.autorelabel
You can now exit the chroot environment and reboot the system.
When you abruptly power off a RHEL 6 or CentOS 6 virtual machine without shutting down the virtual
machine from operating system after you install, upgrade, or uninstall VMware Tools in a Linux environment
(RHEL or CentOS 6), the guest operating system might fail during the next reboot due to a corrupted
RAMDISK image file caused by incomplete write operation of the RAMDISK image to disk. An error similar
to the following is reported in the console when you boot the guest operating system next time:
Solution
This is not a VMware issue. For more information, consult your guest operating system vendor.
To resolve this issue, a Linux guest operating system with a corrupted RAMDISK image file is rescued to
complete boot state by creating a new initramfs image in Linux rescue mode.
To create a new initramfs image and rescue the RHEL/CentOS 6 guest operating system from the
corrupted RAMDISK image file, perform these steps:
1. Boot the virtual machine with the ISO image from which CentOS or RHEL guest is installed. The ISO
installation process is described in Installing guest operating systems from ISO images (1002). To boot an
existing VM from ISO, use steps 8 and 9 from that procedure.
Note: The preceding link was correct as of January 30, 2015. If you find the link is broken, provide a
feedback and a VMware employee will update the link.
4. Select No as the networking option, and then select Continue as the resume option to mount the
actual root file system in read/write mode.
5. Mount the root file system that needs rescue to the location /mnt/sysimage and start a shell.
6. To change the root file system to actual root file system, run the command:
# chroot /mnt/sysimage
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server(2.6.32-431.23.3.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.23.3.el6.x86_64 ro root=/dev/mapper/VolGroup-
lv_root rd_NO_LUKS
LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-
sun16 crashkernel=128M
rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-431.23.3.el6.x86_64.img
title Red Hat Enterprise Linux (2.6.32-358.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root
rd_NO_LUKS
LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-
sun16 crashkernel=128M
rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-358.el6.x86_64.img
8. After identifying the initramfs image, backup the original initramfs image before creating the new
initramfs image by running the command:
# cp /boot/initramfs-2.6.32-431.23.3.el6.x86_64.img /boot/initramfs-2.6.32-
431.23.3.el6.x86_64.img.ori
9. To create a new initramfs image, run the dracut command:
# reboot
In many cases, the GRUB boot loader can mistakenly be deleted, corrupted, or replaced by other
operating systems.
The following steps detail the process on how GRUB is reinstalled on the master boot record:
o Type linux rescue at the installation boot prompt to enter the rescue environment.