Sometimes we use a USB flash drive to install centos, and accidentally install grub to the USB flash drive. as a result, the boot needs to be inserted into the USB flash drive to start the server, or grub is damaged. in this case, we need to re-install grub to the hard disk. The following describes several repair or installation methods: install grub method 1 specify/boot partition 1. grub & gt; root (hd0, 0) if you are not sure which partition/boot is in, use grub & gt; find/boot/grub
Sometimes we use a USB flash drive to install centos, and accidentally install grub to the USB flash drive. as a result, the boot needs to be inserted into the USB flash drive to start the server, or grub is damaged. in this case, we need to re-install grub to the hard disk. The following describes several repair or installation methods:
Install grub method 1
Specify/boot partition
1. grub> root (hd0, 0)
If you are not sure which partition/boot is in, use the grub> find/boot/grub/stage1 command to find out
1) install grub to the MBR on the first hard disk.
Grub> setup (hd0)
2) install grub to the boot sector in the first partition of the first hard disk
Grub> setup (hd0, 0)
Install grub method 2
# Grub-install -- root-directory =/boot/dev/hda