How to reinstall the /boot folder?
Hello,
After updating packages on RHEL 6.2 and attempting to reboot, I discovered that the /boot folder has disappeared. How do I reinstall the /boot folder. along with the associated files and subdiresctories, from the RHEL Installation disk?
Responses
Richard,
Question 1: Has it disappeared or does not it mount automatically anymore?
try this:
fdisk -l
find the partition name (f.e /dev/sda1)
mount /dev/sda1 /boot
see what error message you get, if none edit /etc/fstab
In the past it happened to me that LABEL did not work anymore after some patching.
Kind regards,
ir. Jan Gerrit Kootstra
You can do this from Rescue Mode. If you need to manually rebuild the chroot, here's a quick cheatsheet I keep handy:
mkdir -p /mnt/sysimage/ fdisk -l # observe /boot partition, assumed /dev/sda1 here lvm pvscan lvm vgscan lvm lvscan # observe root partition, assumed /dev/mapper/vg-lv here mount /dev/mapper/vg-lv /mnt/sysimage/ mount /dev/sda1 /mnt/sysimage/boot/ mount /proc /mnt/sysimage/proc/ -o bind -t proc mount /dev /mnt/sysimage/dev/ -o bind mount /sys /mnt/sysimage/sys/ -o bind -t sysfs chroot /mnt/sysimage/
Mount the CD and reinstall the filesystem, kernel, grub and redhat-logos packages from the /Packages directory with something like rpm -ivh --force /mnt/cd/Packages/<package-filename>.rpm
Copy the GRUB config file back with cp /etc/grub.conf /boot/grub/grub.conf and link it to menu.lst with cd /boot/grub; ln -s ./grub.conf menu.lst
Perform a GRUB installation with grub then find /grub/stage1 and root (hdX,Y) and setup (hdX)
I managed to recover a virtual machine this way, simulating your error with rm -rf /boot/*
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
