728x90
반응형
리눅스에서 커널버전을 업그레이드 하는 방법에 대해 알아보겠습니다.
현재 설치된 서버는 Centos 6.9 버전입니다.
리눅스 커널버전 확인
- 현재 설치된 커널 버전을 확인하는 방법은 아래와 같이 여러 방법이 있습니다.
uname -r
cat /proc/version
cat /proc/sys/kernel/osrelease
dmesg | grep "Linux version"
커널 버전 다운로드
아래 사이트에서 원하는 커널 버전을 다운로드 받습니다.
저는 3.14 버전으로 업그레이드를 하기 위해 3.14 커널 버전을 다운로드 받습니다.
cd /var
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v3.x/linux-3.14.1.tar.gz --no-check-certificate
tar xvzf linux-3.14.1.tar.gz
https://mirrors.edge.kernel.org/pub/linux/kernel/
Index of /pub/linux/kernel/
mirrors.edge.kernel.org
커널 버전 업그레이드(kernel 2.6 -> 3.1)
- 이제 본격적으로 커널을 업그레이드 하겠습니다.
커널 업데이트 사전 셋팅
- 패키지 설치
yum install ncurses-devel
yum groupinstall "Development Tools"
- /usr/src 폴더로 이동후 링크를 걸어줍니다.
cd /usr/src
ln -s /var/linux-3.14.1 linux
- 커널 버전을 업데이트 진행
make mrproper
make clean
cp /boot/config-2.6.32-754.35.1.el6.x86_64 ./.config
커널 환경 설정 셋팅
- 커널 설정 파일 적용
- make menuconfig 실행 하면 아래 화면이 나옵니다.
- 화살표 버튼 (->) 을 눌러 서 Load 버튼을 클릭 합니다.
- OK 버튼을 클릭합니다.
- Gerneral setup 을 선택 합니다.
- Enable deprecated sysfs features to support old userspace tools 를 체크 합니다.
- 체크 이후 Save 버튼을 누릅니다.
- OK 버튼을 누르고 나옵니다.
- 위과정을 통해 커널 설정에 대한 기본 셋팅을 마쳤습니다.
커널 빌드
- 설정 셋팅이 완료 되었다면 이제 신규 버전으로 빌드를 진행 합니다.
- 빌드시 꽤 많이 시간이 소요 됩니다.
- 조금이라도 빠르게 빌드를 원한 다면 make -j 옵션을 사용 하세요
- make -j 4 modules_install
make all
make moules_install
make install
- make install 시 에러가 발생 한다면 무시하셔도 됩니다.
ERROR: modinfo: could not find module snd_page_alloc
- uname -a 로 변경 된 커널 버전을 확인 합니다.
- 만약 변경이 되지 않을 경우 /boot/grub/grub.conf 파일에서 default 버전을 변경 합니다.
- default=0 으로 변경후 reboot 을 후에 다시 커널 버전을 확인 합니다.
- 2.6 에서 3.14 로 커널 버전이 업그레이드 된것을 확인 할수 있습니다.
[root@centos6 linux]# uname -r
3.14.1
[root@centos6 linux]# cat /proc/version
Linux version 3.14.1 (root@centos6) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #2 SMP Thu Dec 21 19:44:34 KST 2023
[root@centos6 linux]# cat /proc/sys/kernel/osrelease
3.14.1
[root@centos6 linux]# dmesg | grep "Linux version"
Linux version 3.14.1 (root@centos6) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #2 SMP Thu Dec 21 19:44:34 KST 2023
[root@centos6 linux]#
3.14.1
[root@centos6 linux]# cat /proc/version
Linux version 3.14.1 (root@centos6) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #2 SMP Thu Dec 21 19:44:34 KST 2023
[root@centos6 linux]# cat /proc/sys/kernel/osrelease
3.14.1
[root@centos6 linux]# dmesg | grep "Linux version"
Linux version 3.14.1 (root@centos6) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #2 SMP Thu Dec 21 19:44:34 KST 2023
[root@centos6 linux]#
728x90
반응형