Windows再インストールしたら、Linux起動できなくなったので、GRUBをセットアップしなおした。
Windows入れてからLinux入れるとうまいことやってくれるのに、Linux入ってるとこにWindows入れるとデュアルブートにしてくれないとかいう感じのあれ。
Windows何度か入れなおしてるけど、GRUB(の一部?)をMBRに入れればいいらしい、というのは憶えてるけどやり方わからなくて、結局毎回調べてたので、メモをここに残しとこうと思う何か。
- ubuntuのCDがあったので、それで起動。
- つながってるHDDを確認。
ls /dev/hd*
ってやったら、/dev/hda、/dev/hdcと、/dev/hda1〜6までがあった。win側で2つ使ってるので、linuxのbootがhda3のはず。
- 一応マウントして中身を確認。
mkdir boot
sudo mount /dev/hda3 boot/
grubってフォルダがあって、それっぽいのが入ってた。
sudo grub
して、grubなシェルに入って、
root (hd0,2)
setup (hd0)
quit
入力中にtabキーでいろいろ確認できる。
参考:
- http://www.geocities.co.jp/SiliconValley-Bay/3897/grub/grub-4.html
- http://www.itmedia.co.jp/enterprise/articles/0706/20/news011_3.html
- http://www.h5.dion.ne.jp/~simochu/grub/grub.html *2
*1:たぶんこれだけでもいいはず。
*2: If image_device is specified, then find the GRUB images (see Images) in the device image_device, otherwise use the current root device, which can be set by the command root.grub > root (hd0,0)
ってやってるけど、
grub > setup (hd0) (hd0,0)
だそうだから、image_deviceはrootで設定したのと同じなんだから"setup (hd0)"だけでよさそう。