Search

'GRUB 재설정'에 해당되는 글 1건

  1. 2009.06.03 [Linux] Windows 설치 후 GRUB부트로더 재설정
일반적으로 윈도우와 리눅스를 멀티부팅 가능하게 설치할경우에는

1. 윈도우
2. 리눅스
의 순서로 설치하여 리눅스의 GRUB부트로더가 MBR에 설치되도록 한다. 특히나 M$윈도의 경우에는 매우 이기적(?)인 놈이라 OS설치를 하면 기본적으로 MBR을 자기가 먹는다.

오늘 윈도7을 설치했는데, 이부분을 깜빡 잊고 있다가 윈도7 설치 후 재부팅하니 아불싸..

그래서 아래와 같은 방법으로 해결했다.

[Linux] GRUB부트로더 재설정

1. COBUNTU USB로 라이브 부팅 (CD를 이용한 라이브부팅)
2. 프로그램-보조프로그램-터미널
3. root 로변신
$ sudo -i 또는 su -
# id
uid=0(root) gid=0(root) 그룹들=0(root)
4. GRUB 복구
grub 실행

# grub
       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]

grub> find /boot/grub/stage1
        # 리눅스가 설치된 파티션을 찾음
 (hd0,1)
grub> root (hd0,1)                       # hd0,1를 root 파티션으로 지정

grub> setup (hd0)                       # GRUB을 MBR에 설치
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  17 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,1)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.

grub> quit
위와 같이 설정 후 재부팅을 하면 반가운(?) GRUB메뉴를 볼 수 있다. 일단 재부팅한다

재부팅 후 OS가 바뀌었으니 GRUB 메뉴 표시를 수정해준다. 아니면 재부팅전에 / 파티션을 마운트해서 수정해도 무방할 듯 하다

# vi /boot/grub/menu.list
.
.
보통 other OS는 파일의 아랫쪽에 추가된다

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Microsoft Windows 7 (Build. 7137)  <-- 이름수정
rootnoverify    (hd0,0)
savedefault
chainloader    +1


* 만약 GRUB을 MBR이 아닌 리눅스의 루트 파티션에 설치하려면, setup (hd0,1)와 같이 리눅스가 설치된 파티션으로 써주면 된다.