Rocky Linux 8
    • PDF

    Rocky Linux 8

    • PDF

    Article Summary

    VPC 환경에서 이용 가능합니다.

    네이버 클라우드 플랫폼 Rocky Linux 8 서버의 커널 업데이트 방법을 설명합니다.

    이 가이드는 네이버 클라우드 플랫폼에서 신규 생성한 서버를 기준으로 작성했기 때문에 사용자 서버 환경과 차이가 있을 수 있습니다. 사용자 서버 환경은 보안 하드닝 작업이나 여러 설정 작업 등 다양한 이유로 커널 업데이트 작업 및 서버 재시작에 영향을 받을 수 있습니다. 따라서 다음 사항을 확인한 후 커널 업데이트를 수행해 주십시오.

    • 실제 서버의 커널을 업데이트하기 전에 서버 이미지를 사용하여 복제 서버를 생성합니다. 생성한 복제 서버에서 커널 업데이트를 수행하고 정상적으로 재시작이 되는지 확인합니다. 재시작 후 운영 상태로 전환이 되면 서비스에 문제가 없는지 확인합니다. 충분히 검증한 후에 문제가 없을 경우에만 서버 커널 업데이트를 수행해 주십시오.
    • GPU 서버의 경우, 커널 버전에 맞는 GPU 드라이버가 설치되어 있어야만 정상적으로 동작합니다. 업데이트한 커널이 GPU 드라이버와 호환되지 않을 경우 GPU 서버가 정상 동작하지 않을 수 있습니다. 따라서 GPU 드라이버 호환성을 확인한 후 커널 업데이트를 수행해 주십시오. 관련 정보는 GPU 드라이버 가이드를 확인해 주십시오.
    • NCP Repo는 VPC Private Subnet 등 외부 접속이 원활하지 않은 사용자 환경을 지원하기 위해 네이버 클라우드 플랫폼에서 제공하는 리포지토리입니다. NCP Repo는 최신 패키지를 제공하지 않을 수 있습니다.
    참고

    네이버 클라우드 플랫폼에서 모든 커널 버전의 업데이트를 테스트한 것은 아닙니다. 2024년 1월 1일 기준으로 Rocky Linux 8에 커널 업데이트 적용 테스트한 버전은 4.18.0-513.5.1.el8_9.x86_64 입니다.

    주의
    • 사용자 서버 커널 업데이트는 전적으로 사용자의 책임 하에 수행되어야 하며, 커널 업데이트로 인해 발생하는 문제에 대해 네이버 클라우드 플랫폼에서 책임지지 않습니다.
    • 커널 업데이트 및 재시작 중에는 서버의 정상적인 사용이 불가능할 수 있으며 이에 따른 복구는 지원하지 않습니다. 또한 커널 업데이트 실패 시 서버 복구를 지원하지 않습니다.
    • 커널을 업데이트 전 서버 이미지를 통해 생성한 백업본은 백업이 필요 없을 때까지 보관해 주십시오.
    • 이 가이드와 관련된 문제에 대해서는 별도 지원이 제공되지 않습니다.

    커널 업데이트

    Rocky Linux 8.6, Rocky Linux 8.8 서버의 커널을 업데이트하는 방법은 다음과 같습니다.

    1. 커널 업데이트를 적용할 서버에 원격 접속해 주십시오.

    2. 서버의 커널 버전을 확인해 주십시오.

      • Rocky Linux 8.6
      [root@rockylinux86 ~]# uname -r
      4.18.0-372.32.1.el8_6.x86_64
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# uname -r
      4.18.0-477.13.1.el8_8.x86_64
      
    3. 서버에 연결된 리포지토리 정보를 확인해 주십시오.

      [root@rockylinux88 ~]# grep ^baseurl /etc/yum.repos.d/Rocky*
      /etc/yum.repos.d/Rocky-AppStream.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/$basearch/os/
      /etc/yum.repos.d/Rocky-BaseOS.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/$basearch/os/
      
    4. 리포지토리에서 제공하는 커널 버전을 확인해 주십시오.

      [root@rockylinux88 ~]# rm -rf /var/cache/dnf/*
      
      [root@rockylinux88 ~]# yum --releasever=8.9 list kernel-4.18.0-513.5.1.el8_9
      Available Packages
      kernel.x86_64                                                                  4.18.0-513.5.1.el8_9                                                                   baseos
      
      참고

      yum 명령어 옵션으로 --releasever=8.9을 사용하지 않을 경우, 최신 8.9 커널이 조회되지 않을 수 있습니다. 이 경우에는 Rocky Linux 8 서버의 yum 명령어 설정 변경을 참고하여 yum 명령어 설정을 변경해 주십시오.

    5. 최신 버전의 커널을 설치해 주십시오.
      신규 설치 패키지, 업데이트 패키지, 삭제 패키지 목록을 상세하게 확인한 후 이상이 없을 경우 y를 입력하여 설치를 완료해 주십시오.

      • Rocky Linux 8.6
      [root@rockylinux86 ~]# yum --releasever=8.9 install kernel-4.18.0-513.5.1.el8_9
      Dependencies resolved.
      ============================================================================================================================================================================
       Package                                    Architecture                       Version                                             Repository                          Size
      ============================================================================================================================================================================
      Installing:
       kernel                                     x86_64                             4.18.0-513.5.1.el8_9                                baseos                              10 M
       kernel-core                                x86_64                             4.18.0-513.5.1.el8_9                                baseos                              43 M
       kernel-modules                             x86_64                             4.18.0-513.5.1.el8_9                                baseos                              35 M
      
      Transaction Summary
      ============================================================================================================================================================================
      Install  3 Packages
      
      Total download size: 88 M
      Installed size: 96 M
      Is this ok [y/N]: y
      
      ... 생략 ...
      
      Installed:
        kernel-4.18.0-513.5.1.el8_9.x86_64                  kernel-core-4.18.0-513.5.1.el8_9.x86_64                  kernel-modules-4.18.0-513.5.1.el8_9.x86_64                
      
      Complete!
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# yum --releasever=8.9 install kernel-4.18.0-513.5.1.el8_9
      Dependencies resolved.
      ============================================================================================================================================================================
       Package                                    Architecture                       Version                                             Repository                          Size
      ============================================================================================================================================================================
      Installing:
       kernel                                     x86_64                             4.18.0-513.5.1.el8_9                                baseos                              10 M
       kernel-core                                x86_64                             4.18.0-513.5.1.el8_9                                baseos                              43 M
       kernel-modules                             x86_64                             4.18.0-513.5.1.el8_9                                baseos                              35 M
      
      Transaction Summary
      ============================================================================================================================================================================
      Install  3 Packages
      
      Total download size: 88 M
      Installed size: 96 M
      Is this ok [y/N]: y
      
      ... 생략 ...
      
      Installed:
        kernel-4.18.0-513.5.1.el8_9.x86_64                  kernel-core-4.18.0-513.5.1.el8_9.x86_64                  kernel-modules-4.18.0-513.5.1.el8_9.x86_64                
      
      Complete!    
      
    6. 설치가 완료된 후에 부팅 가능한 커널 버전 및 기본 부팅 커널 버전을 확인해 주십시오.

      • Rocky Linux 8.6
      [root@rockylinux86 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
      Rocky Linux (4.18.0-372.32.1.el8_6.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (4.18.0-372.9.1.el8.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (0-rescue-50f85e7b58fc48c8a91ae8a9a60ee028) 8.6 (Green Obsidian)
      
      [root@rockylinux86 ~]# grub2-editenv list
      saved_entry=50f85e7b58fc48c8a91ae8a9a60ee028-4.18.0-513.5.1.el8_9.x86_64
      boot_success=0
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
      Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian)
      
      [root@rockylinux88 ~]# grub2-editenv list
      saved_entry=a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-513.5.1.el8_9.x86_64
      boot_success=0    
      
    7. grub.cfg 파일에 최신 커널 버전이 반영이 안되어서 추가로 수정 작업을 진행합니다.

      • Rocky Linux 8.6
      [root@rockylinux86 ~]# ls -ld /etc/grub2*
      lrwxrwxrwx. 1 root root 22 May 10  2022 /etc/grub2.cfg -> ../boot/grub2/grub.cfg
      
      [root@rockylinux86 ~]# grub2-mkconfig -o /etc/grub2.cfg
      Generating grub configuration file ...
      Found linux image: /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64
      Found initrd image: /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64.img
      Found linux image: /boot/vmlinuz-4.18.0-372.32.1.el8_6.x86_64
      Found initrd image: /boot/initramfs-4.18.0-372.32.1.el8_6.x86_64.img
      Found linux image: /boot/vmlinuz-4.18.0-372.9.1.el8.x86_64
      Found initrd image: /boot/initramfs-4.18.0-372.9.1.el8.x86_64.img
      Found linux image: /boot/vmlinuz-0-rescue-50f85e7b58fc48c8a91ae8a9a60ee028
      Found initrd image: /boot/initramfs-0-rescue-50f85e7b58fc48c8a91ae8a9a60ee028.img
      done
      
      [root@rockylinux86 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
      Rocky Linux (4.18.0-513.5.1.el8_9.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (4.18.0-372.32.1.el8_6.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (4.18.0-372.9.1.el8.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (0-rescue-50f85e7b58fc48c8a91ae8a9a60ee028) 8.6 (Green Obsidian)
      
      [root@rockylinux86 ~]# grub2-editenv list
      saved_entry=50f85e7b58fc48c8a91ae8a9a60ee028-4.18.0-513.5.1.el8_9.x86_64
      boot_success=0
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# ls -ld /etc/grub2*
      lrwxrwxrwx. 1 root root 22 Apr 29  2023 /etc/grub2.cfg -> ../boot/grub2/grub.cfg
      
      [root@rockylinux88 ~]# grub2-mkconfig -o /etc/grub2.cfg
      Generating grub configuration file ...
      Found linux image: /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64
      Found initrd image: /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64.img
      Found linux image: /boot/vmlinuz-4.18.0-477.13.1.el8_8.x86_64
      Found initrd image: /boot/initramfs-4.18.0-477.13.1.el8_8.x86_64.img
      Found linux image: /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64
      Found initrd image: /boot/initramfs-4.18.0-477.10.1.el8_8.x86_64.img
      Found linux image: /boot/vmlinuz-0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6
      Found initrd image: /boot/initramfs-0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6.img
      done
      
      [root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
      Rocky Linux (4.18.0-513.5.1.el8_9.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian)
      
      [root@rockylinux88 ~]# grub2-editenv list
      saved_entry=a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-513.5.1.el8_9.x86_64
      boot_success=0    
      
    8. 최신 커널 버전을 활성화하기 위해서 서버를 재부팅해 주십시오.

      [root@rockylinux88 ~]# reboot
      
      참고

      서버 재부팅에 실패한 경우 커널 업데이트가 정상적으로 수행되지 않은 것입니다. 이 경우에는 커널 업데이트 원복을 참고하여 이전의 커널 버전으로 되돌려 주십시오.

    9. 서버에 다시 로그인하여 새로운 커널이 활성화 상태인지 확인해 주십시오.

      • Rocky Linux 8.6
      [root@rockylinux86 ~]# uname -r
      4.18.0-513.5.1.el8_9.x86_64
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# uname -r
      4.18.0-513.5.1.el8_9.x86_64
      
      참고

      업데이트한 커널이 정상 적용되었는지 확인하려면 커널 업데이트 확인을 참고하여 커널 설치 상황을 확인해 주십시오.

    Rocky Linux 8 서버의 yum 명령어 설정 변경

    Rocky Linux 8.6/8.8에서 yum list kernel 명령어 수행 시, 최신 8.9 커널이 조회되지 않는 경우에 대한 해결 방법은 다음과 같습니다.

    참고

    네이버 클라우드 플랫폼의 타 서비스와의 호환성을 위해서 Rocky Linux 8.6/8.8 서버의 YUM 설정은 8.6/8.8만 바라보도록 고정되어 있습니다. 이 설정을 제거하거나 yum 명령 옵션을 추가하면 8.6/8.8 이외의 버전을 바라보도록 할 수 있습니다.

    1. yum 설정을 확인해 주십시오.
      다음과 같이 8.6/8.8으로 고정되어 있습니다.
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# cat /etc/yum/vars/releasever
      8.6
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# cat /etc/yum/vars/releasever
      8.8
      
    2. 현재 8.6/8.8 REPO의 RPM 파일이 아닌 상위 버전의 REPO RPM 파일을 바라보도록 설정해 주십시오.
      다음의 세 가지 방법 중에서 선택하여 설정할 수 있습니다. 이 가이드에서는 (2)번 방법을 사용합니다.
      (1) releasever 파일을 삭제
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# rm /etc/yum/vars/releasever
      rm: remove regular file '/etc/yum/vars/releasever'? y
      
      [root@rockylinux86 ~]# yum clean all
      17 files removed
      
      [root@rockylinux86 ~]# yum list kernel
      Installed Packages
      kernel.x86_64                                                                 4.18.0-372.9.1.el8                                                                     @System
      kernel.x86_64                                                                 4.18.0-372.32.1.el8_6                                                                  @System
      Available Packages
      kernel.x86_64                                                                 4.18.0-513.5.1.el8_9                                                                   baseos
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# rm /etc/yum/vars/releasever
      rm: remove regular file '/etc/yum/vars/releasever'? y
      
      [root@rockylinux88 ~]# yum clean all
      17 files removed
      
      [root@rockylinux88 ~]# yum list kernel
      Installed Packages
      kernel.x86_64                                                                 4.18.0-477.10.1.el8_8                                                                  @System
      kernel.x86_64                                                                 4.18.0-477.13.1.el8_8                                                                  @System
      Available Packages
      kernel.x86_64                                                                 4.18.0-513.5.1.el8_9                                                                   baseos
      
      (2) yum 명령어에 --releasever=8.9 옵션 추가
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# yum --releasever=8.9 list kernel
      Installed Packages
      kernel.x86_64                                                                 4.18.0-372.9.1.el8                                                                     @System
      kernel.x86_64                                                                 4.18.0-372.32.1.el8_6                                                                  @System
      Available Packages
      kernel.x86_64                                                                 4.18.0-513.5.1.el8_9                                                                   baseos
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# yum --release=8.9 list kernel
      Installed Packages
      kernel.x86_64                                                                 4.18.0-477.10.1.el8_8                                                                  @System
      kernel.x86_64                                                                 4.18.0-477.13.1.el8_8                                                                  @System
      Available Packages
      kernel.x86_64                                                                 4.18.0-513.5.1.el8_9                                                                   baseos
      
      (3) yum 명령어에 --releasever=8 옵션 추가
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# yum --releasever=8 list kernel
      Installed Packages
      kernel.x86_64                                                                 4.18.0-372.9.1.el8                                                                     @System
      kernel.x86_64                                                                 4.18.0-372.32.1.el8_6                                                                  @System
      Available Packages
      kernel.x86_64                                                                 4.18.0-513.5.1.el8_9                                                                   baseos
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# yum --releasever=8 list kernel
      Installed Packages
      kernel.x86_64                                                                 4.18.0-477.10.1.el8_8                                                                  @System
      kernel.x86_64                                                                 4.18.0-477.13.1.el8_8                                                                  @System
      Available Packages
      kernel.x86_64                                                                 4.18.0-513.5.1.el8_9                                                                   baseos
      

    KVM Rocky Linux 8.8 에서 yum 명령어 수행시 Extras에서 계속 대기

    KVM 기반의 Rocky Linux 8 서버에서 yum 명령어가 원활하게 수행되지 않는 경우, 해결 방법은 다음과 같습니다.

    1. 서버에 원격 접속해 주십시오.
    2. yum list kernel 명령어에서 아래와 같이 extras에서 계속 확인 중인지 확인해 주십시오.
      NAT가 없는 Private Subnet, 공인 IP가 없는 Public Subnet, ACG 차단 등 외부로 나갈 수 없는 환경에서 발생합니다.
      [root@kvm-rockylinux88 ~]# yum --releasever=8.9 list kernel-4.18.0-513.5.1.el8_9
      Rocky Linux 8.9 - AppStream                                                                                                                                     80 MB/s | 9.5 MB     00:00   
      Rocky Linux 8.9 - BaseOS                                                                                                                                        61 MB/s | 2.9 MB     00:00   
      Rocky Linux 8.9 - Extras                                              [               ===                                                                 ] ---  B/s |   0  B     --:-- ET
      
    3. Repo 파일 정보를 확인해 주십시오.
      [root@kvm-rockylinux88 ~]# grep -e ^baseurl -e ^mirrorlist /etc/yum.repos.d/Rocky*
      /etc/yum.repos.d/Rocky-AppStream.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/$basearch/os/
      /etc/yum.repos.d/Rocky-BaseOS.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/$basearch/os/
      /etc/yum.repos.d/Rocky-Debuginfo.repo:mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever-debug
      /etc/yum.repos.d/Rocky-Debuginfo.repo:mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever-debug
      /etc/yum.repos.d/Rocky-Debuginfo.repo:mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-$releasever-debug
      /etc/yum.repos.d/Rocky-Debuginfo.repo:mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=PowerTools-$releasever-debug
      /etc/yum.repos.d/Rocky-Debuginfo.repo:mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-$releasever-debug
      /etc/yum.repos.d/Rocky-Devel.repo:mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=Devel-$releasever
      /etc/yum.repos.d/Rocky-Extras.repo:mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever
      ... 이하 생략 ...    
      
    4. 아래의 명령어로 Repo 파일의 리포지토리 서버를 repo.ncloud.com으로 변경해 주십시오.
      [root@kvm-rockylinux88 ~]# sed -i "s/^mirrorlist=/#mirrorlist/" /etc/yum.repos.d/*.repo
      
      [root@kvm-rockylinux88 ~]# sed -i "s|#baseurl=http://dl.rockylinux.org/\$contentdir|baseurl=http://repo.ncloud.com/rocky|" /etc/yum.repos.d/*.repo
      
    5. 변경된 내용을 확인해 주십시오.
      [root@kvm-rockylinux88 ~]# grep -e ^baseurl /etc/yum.repos.d/*.repo
      /etc/yum.repos.d/Rocky-AppStream.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/$basearch/os/
      /etc/yum.repos.d/Rocky-BaseOS.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/$basearch/os/
      /etc/yum.repos.d/Rocky-Debuginfo.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/$basearch/debug/tree/
      /etc/yum.repos.d/Rocky-Debuginfo.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/$basearch/debug/tree/
      /etc/yum.repos.d/Rocky-Debuginfo.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/HighAvailability/$basearch/debug/tree/
      /etc/yum.repos.d/Rocky-Debuginfo.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/PowerTools/$basearch/debug/tree/
      /etc/yum.repos.d/Rocky-Debuginfo.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/ResilientStorage/$basearch/debug/tree/
      /etc/yum.repos.d/Rocky-Devel.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/Devel/$basearch/os/
      /etc/yum.repos.d/Rocky-Extras.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/extras/$basearch/os/
      ... 이하 생략 ...
      
    6. yum 캐시를 삭제한 후에 다시 한번 yum 명령어를 수행해 주십시오.
      [root@kvm-rockylinux88 ~]# rm -rf /var/cache/dnf/*
      
      [root@kvm-rockylinux88 ~]# yum --releasever=8.9 list kernel-4.18.0-513.5.1.el8_9
      Rocky Linux 8.9 - AppStream                                                                                                                                                     63 MB/s | 9.5 MB     00:00   
      Rocky Linux 8.9 - BaseOS                                                                                                                                                        47 MB/s | 2.9 MB     00:00   
      Rocky Linux 8.9 - Extras                                                                                                                                                       1.1 MB/s |  14 kB     00:00   
      Available Packages
      kernel.x86_64                                                                                    4.18.0-513.5.1.el8_9                                                                                    baseos
      

    KVM Rocky Linux 8.8 에서 커널 확인 및 변경 방법

    KVM 기반 Rocky Linux 8 서버에서 BLS(Boot Loader Specification)이 enable되어 있습니다. 아래와 같이 커널 확인 및 커널 설정 변경을 할 수 있습니다.

    1. 서버에 원격 접속해 주십시오.
    2. grub 설정에 BLS 설정이 enable되어 있는 것을 확인합니다.
      [root@kvm-rockylinux88 ~]# grep BLSCFG /etc/default/grub
      GRUB_ENABLE_BLSCFG=true    
      
    3. 커널 설치 후에 설치된 커널을 확인합니다.
      [root@kvm-rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2  
      
      [root@kvm-rockylinux88 ~]# ls -l /boot/loader/entries
      total 16
      -rw-r--r--. 1 root root 405 Jun 14  2023 2faf2183dcf14a70b2b32e1b9fe6e4e9-0-rescue.conf
      -rw-r--r--. 1 root root 368 Jun 14  2023 2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-477.10.1.el8_8.x86_64.conf
      -rw-r--r--. 1 root root 368 Sep  8 17:00 2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-477.15.1.el8_8.x86_64.conf
      -rw-r--r--  1 root root 363 Dec 14 21:51 2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-513.5.1.el8_9.x86_64.conf
      
      또는
      
      [root@kvm-rockylinux88 ~]# grubby --info=ALL | grep ^kernel
      kernel="/boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64"
      kernel="/boot/vmlinuz-4.18.0-477.15.1.el8_8.x86_64"
      kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64"
      kernel="/boot/vmlinuz-0-rescue-2faf2183dcf14a70b2b32e1b9fe6e4e9"
      
    4. 다음 부팅 시 올라오는 커널을 확인합니다.
      [root@kvm-rockylinux88 ~]# grubby --default-kernel
      /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64    
      
    5. 기본 부팅 커널 버전이 설치한 커널 버전과 다른 경우, 기본 부팅 커널을 변경합니다.
      [root@kvm-rockylinux88 ~]# grubby --set-default="/boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64"
      The default is /boot/loader/entries/2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-513.5.1.el8_9.x86_64.conf with index 0 and kernel /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64
      
      [root@kvm-rockylinux88 ~]# grubby --default-kernel
      /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64
      

    커널 업데이트 확인

    업데이트 커널이 정상적으로 적용되었는지 확인하는 방법은 다음과 같습니다.

    1. 서버에 원격 접속해 주십시오.
    2. 커널 패키지가 설치되어 있는지 확인해 주십시오.
      [root@rockylinux88 ~]# rpm -qa | grep kernel-4.18.0-513.5.1.el8_9
      kernel-4.18.0-513.5.1.el8_9.x86_64
      
    3. /boot 디렉터리에 initramfs 파일과 vmlinuz 파일이 생성되어 있는지 확인해 주십시오.
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# ls -l /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64.img
      -rw------- 1 root root 29279987 Dec  4 11:41 /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64.img
      
      [root@rockylinux86 ~]# ls -l /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64kdump.img
      -rw------- 1 root root 24992256 Dec  4 14:00 /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64kdump.img
      
      [root@rockylinux86 ~]# ls -l /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64
      -rwxr-xr-x 1 root root 10913432 Nov 17 12:42 /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# ls -l /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64.img
      -rw------- 1 root root 29326362 Dec  4 11:43 /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64.img
      
      [root@rockylinux88 ~]# ls -l /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64kdump.img
      -rw------- 1 root root 24941568 Dec  4 14:00 /boot/initramfs-4.18.0-513.5.1.el8_9.x86_64kdump.img
      
      [root@rockylinux88 ~]# ls -l /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64
      -rwxr-xr-x 1 root root 10913432 Nov 17 12:42 /boot/vmlinuz-4.18.0-513.5.1.el8_9.x86_64    
      
    4. grub.cfg 파일에 최신 커널 설정이 등록되어 있는지 확인해 주십시오.
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
      Rocky Linux (4.18.0-513.5.1.el8_9.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (4.18.0-372.32.1.el8_6.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (4.18.0-372.9.1.el8.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (0-rescue-50f85e7b58fc48c8a91ae8a9a60ee028) 8.6 (Green Obsidian)
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
      Rocky Linux (4.18.0-513.5.1.el8_9.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian) 
      
    5. grub 설정을 확인해 주십시오.
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# grep GRUB_DEFAULT /etc/default/grub
      GRUB_DEFAULT=saved
      
      [root@rockylinux86 ~]# cat /boot/grub2/grubenv
      # GRUB Environment Block
      saved_entry=50f85e7b58fc48c8a91ae8a9a60ee028-4.18.0-513.5.1.el8_9.x86_64
      boot_success=0
      ... 생략 ...
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# grep GRUB_DEFAULT /etc/default/grub
      GRUB_DEFAULT=saved
      
      [root@rockylinux88 ~]# cat /boot/grub2/grubenv
      # GRUB Environment Block
      saved_entry=a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-513.5.1.el8_9.x86_64
      boot_success=0
      ... 생략 ...    
      

    커널 업데이트 원복

    커널 업데이트 후 서버 재시작이 정상적으로 수행되지 않을 경우, 업데이트 이전의 커널로 되돌려야 합니다. 설치된 커널 중 여러 버전으로 원복할 수 있습니다. 이 가이드에서는 커널 업데이트하기 직전에 사용한 커널 버전으로 원복하는 방법을 다루고 있습니다.

    커널 버전을 원복하는 방법은 다음과 같습니다.

    참고

    서버 재시작 문제를 해결하기 위해 Single mode에 진입하여 서버 복구를 시도할 수도 있습니다. Single mode 부팅 방법은 서버 복구 가이드를 참고해 주십시오.

    1. 네이버 클라우드 플랫폼 콘솔의 Region 메뉴와 Platform 메뉴에서 이용 중인 환경을 클릭해 주십시오.
    2. Services > Compute > Server 메뉴를 차례대로 클릭해 주십시오.
    3. Server 메뉴를 클릭해 주십시오.
    4. 서버 목록에서 복구할 서버를 선택한 후 [서버 접속 콘솔] 버튼을 선택해 주십시오.
    5. grub 부팅 화면에서 부팅 커널을 이전 버전으로 선택하여 재부팅해 주십시오.
      • RockyLinux 8.6 grub 부팅 화면
        image.png
      • RockyLinux 8.8 grub 부팅 화면
        image.png
    6. 부팅 완료 후에 서버의 커널 버전을 확인해 주십시오.
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# uname -r
      4.18.0-372.32.1.el8_6.x86_64
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# uname -r
      4.18.0-477.13.1.el8_8.x86_64
      
    7. 현재 활성화된 커널 버전을 확인해 주십시오.
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# grub2-editenv list
      saved_entry=50f85e7b58fc48c8a91ae8a9a60ee028-4.18.0-513.5.1.el8_9.x86_64
      boot_success=0
      
      [root@rockylinux86 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
      Rocky Linux (4.18.0-513.5.1.el8_9.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (4.18.0-372.32.1.el8_6.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (4.18.0-372.9.1.el8.x86_64) 8.6 (Green Obsidian)
      Rocky Linux (0-rescue-50f85e7b58fc48c8a91ae8a9a60ee028) 8.6 (Green Obsidian)
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# grub2-editenv list
      saved_entry=a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-513.5.1.el8_9.x86_64
      boot_success=0
      
      [root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
      Rocky Linux (4.18.0-513.5.1.el8_9.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian)
      Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian)    
      
    8. 부팅 시 기본값 커널 버전을 이전 버전의 커널 버전으로 재설정해 주십시오.
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# grub2-set-default "Rocky Linux (4.18.0-372.32.1.el8_6.x86_64) 8.6 (Green Obsidian)"
      
      [root@rockylinux86 ~]# grub2-editenv list
      saved_entry=Rocky Linux (4.18.0-372.32.1.el8_6.x86_64) 8.6 (Green Obsidian)
      boot_success=0
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# grub2-set-default "Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian)"
      
      [root@rockylinux88 ~]# grub2-editenv list
      saved_entry=Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian)
      boot_success=0    
      
    9. (선택사항) 변경된 커널 버전으로 정상 부팅되는지 확인하기 위해서 서버를 재부팅해 주십시오.
      [root@rockylinux88 ~]# reboot
      
    10. (선택사항) 서버에 다시 로그인하여 부팅 여부 및 커널 버전을 확인해 주십시오.
      • Rocky Linux 8.6
      [root@rockylinux86 ~]# uname -r
      4.18.0-372.32.1.el8_6.x86_64
      
      • Rocky Linux 8.8
      [root@rockylinux88 ~]# uname -r
      4.18.0-477.13.1.el8_8.x86_64
      

    이 문서가 도움이 되었습니까?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.