Deleted /boot dir - problems around that

General support questions
Post Reply
mikhotep
Posts: 3
Joined: 2014/09/10 04:32:39

Deleted /boot dir - problems around that

Post by mikhotep » 2014/09/10 04:40:52

Hello,

On a sandbox Centos 7 VM system i deleted the /boot directory. I was/am hoping to restore it and boot this system again. I am new to Linux and working on my advanced troubleshooting. I have an exact duplicate of this VM for file comparison, etc.

* rm -rf /boot (this kept the /boot directory but cleaned its contents).

* init 6 (not surprisingly the system would not boot).

* Booted using linux rescue disk and ran /sbin/grub2-install /dev/sda command. This restored the /boot/grub2 directory.

* Rebooted system and stuck at grub> prompt.

No idea what to do next. Any help would be greatly appreciated. Seems to be limited information for release 7 as all forums i've searched point to running grub-install not grub2-install.

Thank you.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Deleted /boot dir - problems around that

Post by TrevorH » 2014/09/10 08:27:39

At a minimum yum reinstall kernel
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

mikhotep
Posts: 3
Joined: 2014/09/10 04:32:39

Re: Deleted /boot dir - problems around that

Post by mikhotep » 2014/09/10 10:18:03

I haven't figured out if it is possible to mount a dvd iso under vmware when booted into Centos rescue mode. Without that can't see how i can get the packages to reinstall the kernel.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Deleted /boot dir - problems around that

Post by TrevorH » 2014/09/10 14:38:04

You can.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

mikhotep
Posts: 3
Joined: 2014/09/10 04:32:39

Re: Deleted /boot dir - problems around that

Post by mikhotep » 2014/09/11 01:33:28

Thanks for pointing me in the right direction. I couldn't find the path to the cd/dvd drive until I figured out it was /dev/sr0. Fixed the issue by using the following:

1. Boot off dvd into rescue mode.
2. chroot /mnt/sysimage
3. mount /dev/sr0 /mnt
4. yum reinstall /mnt/Packages/kernel-3.10.0-123.el7.x86_64.rpm
5. /sbin/grub2-install /dev/sda
6. /sbin/grub2-mkconfig /boot/grub2/grub.cfg
7. Reboot into VM run-level 3.

Done. Onto next problem, which i haven't caused yet.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Deleted /boot dir - problems around that

Post by TrevorH » 2014/09/11 07:55:28

Then yum update to get the latest kernel 3.10.0-123.6.3 currently. If it's already installed according to rpm then use yum reinstall.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply