CentOS7 GRUB2 boot kernel 변경하기

System Story/CentOS 7 2016.02.11 16:48

Centos7 및 RHEL7 버전에서는 기본 Bootloader가 GRUB 에서 GRUB2 로 변경되었다.

 

기존 GRUB 에서는 /etc/grub.conf의 수정을 통해 Boot Kernel Image와 Boot Parameter 를 기술 하였지만,

 

GRUB2 에서는 아래와 같은 과정을 통해 Boot kernel을 변경 및 설정하게 된다.

 

 

1. 현재 Boot Kernel 설정내역 확인하기

 

[root@centos7 ~]#
[root@centos7 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-327.4.5.el7.x86_64.debug) 7 (Core)
[root@centos7 ~]#
[root@centos7 ~]#

 

2. GRUB에 정의된 Kernel List 확인하기

 

[root@centos7 ~]#
[root@centos7 ~]# cat /etc/grub2.cfg | grep "^menuentry" | cut -d "-" -f1-2
menuentry 'CentOS Linux (3.10.0-327.4.5.el7.x86_64.debug) 7 (Core)'
menuentry 'CentOS Linux (3.10.0-327.4.5.el7.x86_64) 7 (Core)'
menuentry 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64'
menuentry 'CentOS Linux, with Linux 0-rescue
[root@centos7 ~]#
[root@centos7 ~]#

 

3. 원하는 Kernel Image로 Booting 설정 하기

 

[root@centos7 ~]#
[root@centos7 ~]# grub2-set-default "CentOS Linux (3.10.0-327.4.5.el7.x86_64) 7 (Core)"
[root@centos7 ~]#
[root@centos7 ~]#
[root@centos7 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-327.4.5.el7.x86_64) 7 (Core)
[root@centos7 ~]#

 

 

4. 변경/수정된 Boot Config 최종 적용하기

 

[root@centos7 ~]#
[root@centos7 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-327.4.5.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.4.5.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.4.5.el7.x86_64.debug
Found initrd image: /boot/initramfs-3.10.0-327.4.5.el7.x86_64.debug.img
Found linux image: /boot/vmlinuz-0-rescue-8d0f2a705c544d2c959f5f8e2bf1d7aa
Found initrd image: /boot/initramfs-0-rescue-8d0f2a705c544d2c959f5f8e2bf1d7aa.img
done
[root@centos7 ~]#
[root@centos7 ~]#

 

 

※ 참고 : GNU GRUB Project Site (https://www.gnu.org/software/grub/)

 

 

2016:02:11 16:02:05 

 

 

 

 

 

Trackbacks 0 : Comments 0

Write a comment