듀얼부팅을 해야하는데 설치할 때마다 grub이 깨진다.
grub이 깨져서 grub rescue로 들어가게 되면,
ls를 통해서 어디에 flie system이 설치 되어 있는지 찾아야 한다.
찾아봣더니 (hd0,mscod3) 여기에 설치가 되어있으면 다음 명령어들을 통해서 일단 우분투로 들어가준다.
1) set root=(ms0,3)
2) set prefix=(ms0,3)/boot/grub
3) insmod normal
4) normal
주의헤야 할 점은 2)번을 하는 이유는 해당 폴더 안에 insmod normal 을 실행시킬 수 있는 명령어가 존재하기 때문인데 여기에 있지 않는 경우도 있다는 것 같다. 만약 3번을 했는데 찾을 수 없다는 둥 정상적으로 동작을 안하면(정상적인 동작에서는 아무 말도 없다) 구글리을 통해서 /boot/grub이 아닌 다른 곳을 써줘야 한다.
이렇게 해서 일단 우분투로 들어오면 아래 사이트에 들어가서 방법을 찾아서 해결해야 하는데 일일이 grub을 고치는 방법도 있고, repair tool을 통해서 고치는 방법도 있다. 나는 툴을 통해서 고쳤다.
update -> 아래 툴을 쓰더라도 한번에 되지 않고 다시 rescue로 들어가기도 하는데 끈기를 갖고 여러번 반복하다보면 된다.
https://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
The Windows installer doesn't care about other OS in the system. So
it writes own code over the master boot record. Fortunately the solution
is easy too.
You need to repair the MBR. Do the following
Boot using a live usb/cd of ubuntu.
Use boot-repair to fix the problem.
After booting with live usb/cd, run following command in terminal:
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
Use Recomended Repair.

More info - https://help.ubuntu.com/community/Boot-Repair