Series of commands executed for OS recovery in rescue mode for RHEL 7.6
Scenario: After installing VMWare tools, the kernel got corrupted and not was not booting through old kernel images. In rescue mode, I was unable to see the root partition mounted inside /mnt/sysimage. Later I found out all the VGs were deactivated. Hence, ran vgchange in rescue mode to enable all the VGs. Please go through the commands, in case of any confusion or if you need clarity regarding command, please leave a comment.. I'll surely get back to you.
Pre-requisites: Please mount the ISO image of the required OS and boot it from CD/DVD ROM and not from disk.
#blkid
#lvs
#pvs
#vgs
#vgchange -ay
#mount
#mount <root-partion> /mnt/sysimage
#lvs
#vgs
#lvm lvdisplay
#chroot /mnt/sysimage
#lvm lvdisplay
#lvm display | more
#mkdir /mnt/sysimage/var
#ls /mmnt/sysimage/
#mount /dev/rootvg/var /mnt/sysimage/var
Same for usr
usr
#Even I found the /mnt/sysimage/etc/fstab is blank, hence I populated the entries so that the OS comes up in normal boot. Open the fstab file in vi editor run r!blkid in command mode, it will import all the block devices, just compare with a relevant working server and keep the required entries.
#lvm lvdipslay | grep "LV Path"
#mount /dev/rootvg/tmp /mnt/sysimage/tmp
#mount
#cat /etc/fstab
exit
#cat /mnt/sysimage/etc/fstab
#ifconfig
#cat message | tail -200 | more
#df -h
#cat /etc/selinux/config
#cat /etc/fstab
No comments:
Post a Comment