System/Linux

linux - reinstall GRUB2

linuxism 2019. 5. 12. 23:47

to boot your system with a live-cd like systemrescuecd.

mkdir /mnt/temp

mount /dev/xvda2 /mnt/temp/

   mount: unknown filesystem type 'LVM2_member' 
   yum install lvm2
   modprobe dm-mod 
   vgscan
   vgchange -ay VolGroup00
   fdisk -l
   mount /dev/VolGroup00/LogVol00 /mnt/temp/ 

mount /dev/xvda1 /mnt/temp/boot

mount --bind /proc /mnt/temp/proc

mount --bind /sys /mnt/temp/sys

mount --bind /dev /mnt/temp/dev

chroot /mnt/temp /bin/bash

grub2-mkconfig -o /boot/grub2/grub.cfg

grub2-install /dev/sda