how to recover boot partition that has been destroyed Print

  • 0

  1. Mount a centos 7 Iso.
  2. Go to troubleshoting options.
  3. after selecting option 1, and continue, chroot /mnt/sysimg
  4. mkfs.xfs -f /dev/sda1 (assuming that is the boot partition.)
  5. check /etc/fstab and change file system type to xfs, and ensure /dev/sda1 is mount at /boot. options 0 0
  6. mount -a
  7. mount the centos install ISO , in this case sdb1 to /mnt
  8. cd to /mnt/Packages
  9. from there install these 3 packages.
    1.  rpm -ivh --force kernel-3*.rpm  (the most recent kernel ther)
    2. rpm -ivh --force grub2-2*.rpm (the newest package there)
    3. rpm -ivh --force centos-logos-*.rpm (the newes package)
  10. use cfdisk /dev/sda to to confirm that is the booting device.
  11. install grub2 on boot disk (grub2-install /dev/sda)
  12. create grub2 configuration file
    1. grub2-mkconfig -o /boot/grub2/grub.cfg
  13. exit from chroot
  14. reboot
  15. after reboot. yum clean all
  16. yum -y update
  17. yum reinstall kernel-3* (the specific kernel you want.)
  18. grub2-mkconfig -o /boot/grub2/grub.cfg
  19. reboot

Was this answer helpful?

« Back