Linux 7에서 현재 커널 버전의 현재 인덱스가 무엇인지 확인하는 방법
예를 들어
커널 - 3.10.0-327.18.2.el7.x86_64가 index=0, index=1 또는 index=2 등에 있는지 알고 싶습니다.
인덱스 번호가 무엇인지 확인할 수 있나요? 리눅스 7에서
uname -r
3.10.0-327.18.2.el7.x86_64
grubby --info=ALL
index=0
kernel=/boot/vmlinuz-3.10.0-327.18.2.el7.x86_64
args="ro rd.lvm.lv=rootvg/swap rd.lvm.lv=rootvg/slash vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us vga=0x314 net.ifnames=0 ipv6.disable=1 rd.shell LANG=en_US.UTF-8"
root=/dev/mapper/rootvg-slash
initrd=/boot/initramfs-3.10.0-327.18.2.el7.x86_64.img
title=Red Hat Enterprise Linux Server (3.10.0-327.18.2.el7.x86_64) 7.2 (Maipo)
index=1
kernel=/boot/vmlinuz-3.10.0-327.10.1.el7.x86_64
args="ro rd.lvm.lv=rootvg/swap rd.lvm.lv=rootvg/slash vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us vga=0x314 net.ifnames=0 ipv6.disable=1 rd.shell LANG=en_US.UTF-8"
root=/dev/mapper/rootvg-slash
initrd=/boot/initramfs-3.10.0-327.10.1.el7.x86_64.img
title=Red Hat Enterprise Linux Server (3.10.0-327.10.1.el7.x86_64) 7.2 (Maipo)
index=2
kernel=/boot/vmlinuz-3.10.0-327.4.5.el7.x86_64
args="ro rd.lvm.lv=rootvg/swap rd.lvm.lv=rootvg/slash vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us vga=0x314 net.ifnames=0 ipv6.disable=1 rd.shell LANG=en_US.UTF-8"
root=/dev/mapper/rootvg-slash
initrd=/boot/initramfs-3.10.0-327.4.5.el7.x86_64.img
title=Red Hat Enterprise Linux Server (3.10.0-327.4.5.el7.x86_64) 7.2 (Maipo)
index=3
kernel=/boot/vmlinuz-0-rescue-b2c5e6a1c5ea4cb5be82100bd7dc3469
args="ro rd.lvm.lv=rootvg/swap rd.lvm.lv=rootvg/slash vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us vga=0x314 net.ifnames=0 ipv6.disable=1 rd.shell"
root=/dev/mapper/rootvg-slash
initrd=/boot/initramfs-0-rescue-b2c5e6a1c5ea4cb5be82100bd7dc3469.img
title=Red Hat Enterprise Linux Server, with Linux 0-rescue- b2c5e6a1c5ea4cb5be82100bd7dc3469
index=4
non linux entry
답변1
$ sudo grubby --info=ALL | grep -B1 '^kernel=' | grep -B1 `cat /proc/cmdline | awk -v RS=" " '/^BOOT_IMAGE=/ {print substr($0,12)}'`$ | head -n1
index=0
$
인용하다: