"GRUB"의 두 판 사이의 차이

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기
잔글 (→‎Grub2)
39번째 줄: 39번째 줄:
  
 
vi  /boot/grub/grub.cfg
 
vi  /boot/grub/grub.cfg
  configfile /EFI/boot/grub.cfg
+
  configfile /EFI/boot/grub.cfg                             #--- 설정파일 지정
 
  # path to the partition holding ISO images (using UUID)
 
  # path to the partition holding ISO images (using UUID)
 
  probe -u $root --set=rootuuid
 
  probe -u $root --set=rootuuid
 
  set imgdevpath="/dev/disk/by-uuid/$rootuuid"
 
  set imgdevpath="/dev/disk/by-uuid/$rootuuid"
 +
 +
vi  /EFI/boot/grub.cfg
 +
# Menu Entry Created by YUMI - (Your USB Multiboot Integrator)
 +
insmod png
 +
insmod part_msdos
 +
insmod fat
 +
insmod ntfs
 +
insmod ext2
 +
set root='hd0,msdos1'
 +
set timeout=30
 +
 +
if loadfont /boot/grub/fonts/unicode.pf2 ; then
 +
set gfxmode=640x480
 +
insmod efi_gop
 +
insmod efi_uga
 +
    insmod vbe
 +
    insmod vga
 +
insmod gfxterm
 +
terminal_output gfxterm
 +
fi
 +
 +
if background_image /boot/grub/yumi.png ; then
 +
  set color_normal=white/black
 +
  set color_highlight=yellow/dark-gray
 +
      set menu_color_highlight=yellow/black
 +
      set menu_color_normal=white/blue
 +
else
 +
  set menu_color_normal=white/blue
 +
  set menu_color_highlight=yellow/black
 +
fi
 +
 +
set default=1
 +
 +
menuentry "[Reboot]" {reboot}
 +
 +
menuentry ">Linux Distributions"{configfile /multiboot/menu/linux.cfg}
  
 
==설정 가이드==
 
==설정 가이드==

2018년 4월 5일 (목) 14:05 판

GNU 프로젝트의 부트로더인 GNU GRUB(GRand Unified Bootloader)를 정리 한다.


autorun.inf

파일 구조

[section]
key=value

autorun.inf 샘플

[AutoRun]
icon=setup.exe,0                               #--- USB의 아이콘(~.ico)
label=My Drive Label                           #--- USB의 레이블
open=[exepath\]exefile [param1 [param2] ...]   #--- 자동 실행되는 프로그램. 보안상 USB에서는 동작 않음

UseAutoPlay=1
shellexecute=[filepath\]filename[param1, [param2]...] 

shell=verb                                     #--- USB의 shortcut menu를 자동으로 실행하도록 설정
shell\verb=MenuText                            #--- USB의 shortcut menu 이름
shell\verb\command=Filename.exe                #--- USB의 shortcut menu를 선택한 경우 실행할 파일

action=@[filepath\]filename,-resourceID
CustomEvent=MyContentOnArrival

참고 문헌

Grub2 for windows

/boot/grub/ 폴더 구조

  • grub.cfg : Grub 설정 파일
  • core.img
  • lnxboot.img

vi /boot/grub/grub.cfg

configfile /EFI/boot/grub.cfg                              #--- 설정파일 지정
# path to the partition holding ISO images (using UUID)
probe -u $root --set=rootuuid
set imgdevpath="/dev/disk/by-uuid/$rootuuid"

vi /EFI/boot/grub.cfg

# Menu Entry Created by YUMI - (Your USB Multiboot Integrator)
insmod png
insmod part_msdos
insmod fat
insmod ntfs
insmod ext2
set root='hd0,msdos1'
set timeout=30

if loadfont /boot/grub/fonts/unicode.pf2 ; then
	set gfxmode=640x480
	insmod efi_gop
	insmod efi_uga
   insmod vbe
   insmod vga
	insmod gfxterm
	terminal_output gfxterm
fi

if background_image /boot/grub/yumi.png ; then
  set color_normal=white/black
  set color_highlight=yellow/dark-gray
     set menu_color_highlight=yellow/black
     set menu_color_normal=white/blue
else
  set menu_color_normal=white/blue
  set menu_color_highlight=yellow/black
fi

set default=1 
menuentry "[Reboot]" {reboot}

menuentry ">Linux Distributions"{configfile /multiboot/menu/linux.cfg}

설정 가이드

Windows용 설정 가이드

Ubuntu용 설정 가이드

CentOS용 설정 가이드

  • grub 설치
yum -y install grub
  • 설치 폴더 및 파일
/boot/grub/                    #--- 설치 폴더
vi /boot/grub/grub.conf        #--- 설정 파일
vi /boot/grub/divice.map       #--- 장치
/boot/~.img                    #--- Booting images
/boot/grub/~.lst               #--- Help files
/sbin/grub, grub-install, grub-md5-crypt, grub-terminfo, grubby

  • GRUB 2용 폴더
/etc/default/grub/
/etc/grub.d/
  • vi /boot/grub/grub.conf
   #--- 첫번째 엔트리(0, 여기서는 첫번째 title)에서 부트
   default=0
   #--- 5초 후 자동 부팅
   timeout=5
   #--- 디폴트 엔트리에 문제가 있어 부팅이 되지 않을 경우
   #--- 두번째 엔티리(1)에서 부트
   fallback 1
   #--- 부트 화면의 배경이미지, 여기서는 xpm 형태의 그림이미지 사용
   splashimage=(hd0,0)/grub/splash.xpm.gz
   #--- 부팅 메뉴 보이지 않기
   hiddenmenu
   #--- 첫번째 엔트리
   title CentOS (2.6.18-164.el5)
       #--- 첫번째 하드 디스크(hd0)의 첫번째 파티션(0)을 루트 디렉토리로 한다.
       root (hd0,0)
       #--- /vmlinuz-2.6.18-164.el5 : 커널 이미지, /boot 파티션을 따로 잡았을 경우
       #--- /root/vmlinuz-2.6.18-164.el5 : 커널 이미지, /boot 파티션을 따로 잡지 않았을 경우
       #--- root=/dev/VolGroup00/LogVol00 : root 파티션 명
       #--- rhgb quiet : 커널에 전달하는 파라메터
       kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
       #--- 초기화에 필요한 이미지
       initrd /initrd-2.6.18-164.el5.img
   #--- 두번째 엔트리
   title CentOS (2.6.18-128.el5)
       root (hd0,0)
       kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
       initrd /initrd-2.6.18-128.el5.img
   #--- 세번째 엔트리
   title DOS
       #--- Windows가 설치된 디바이스, 파티션
       rootnoverify (hd0,0)
       #--- Windows 부팅 호출
       chainloader +1

사용자 가이드

명명 규칙

  • (hd0,4)
  • fd : 플로피 디스크, fd0, 첫번째 플로피 디스크 (Linux에서는 /dev/fd0)
  • hd : 하드 디스크, hd0. 첫번째 하드 디스크 (Linux에서는 /dev/hda)
  • 4 : 5번째 파티션 (Linux에서는 /dev/hda4)

지원 파일 시스템

  • ext2, ext3, ReiserFS, JFS, FAT, minix, FFS 파일시스템을 지원
  • GRUB 2에서는 LVM도 지원

관리자 가이드

Windows MBR 복구

  • Grub 2가 하드 디스크의 MBR에 설치 되었을 경우 복구 하는 방법은 다음과 같다.
  • Windows XP에서 복구 방법
  • Windows XP CD의 복구 모드로 부팅한 후, 도스창에서 다음 명령을 실행 한다.
fixboot
fixmbr
  • Windows Vista 이상에서 복구 방법
  • Windows Vista CD의 복구 모드로 부팅한 후, 도스창에서 다음 명령을 실행 한다.
bootrec /fixboot
bootrec /fixmbr

참고 문헌