Question :Nous exécutons CentOS/RHEL 6 à double démarrage et utilisons 2 noyaux pour 2 applications différentes. Comment pouvons-nous afficher un nom de noyau personnalisé pour chaque application comme indiqué ci-dessous :
CentOS 6.x Choose this boot option to run APP01. CentOS 6.y Choose this boot option to run APP02.
Cela peut être facilement fait en utilisant le "titre ” dans GRUB. Modifiez le fichier /boot/grub/grub.conf pour avoir un titre personnalisé comme indiqué ci-dessous :
title Place your custom tile here root (hd0,0) kernel /vmlinuz-2.6.32-220.7.1.el6.x86_64 ro root=/dev/mapper/vg_vm27-lv_root rd_LVM_LV=vg_vm27/lv_root rd_LVM_LV=vg_vm27/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet initrd /initramfs-2.6.32-220.7.1.el6.x86_64.img
Par exemple, dans notre cas, nous pouvons avoir le fichier /boot/grub/grub.conf comme indiqué ci-dessous :
# cat /boot/grub/grub.conf default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Choose this boot option to run APP01. root (hd0,0) kernel /vmlinuz-2.6.32-220.7.1.el6.x86_64 ro root=/dev/mapper/vg_vm27-lv_root rd_LVM_LV=vg_vm27/lv_root rd_LVM_LV=vg_vm27/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet initrd /initramfs-2.6.32-220.7.1.el6.x86_64.img title Choose this boot option to run APP02. root (hd0,0) kernel /vmlinuz-2.6.32-220.4.2.el6.x86_64 ro root=/dev/mapper/vg_vm27-lv_root rd_LVM_LV=vg_vm27/lv_root rd_LVM_LV=vg_vm27/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet initrd /initramfs-2.6.32-220.4.2.el6.x86_64.img
Comment mettre en pause le processus de démarrage dans le menu GRUB pour sélectionner un noyau
Vous voudrez peut-être aussi avoir le temps de sélectionner le noyau dans le menu GRUB. Dans certaines conditions, les utilisateurs préfèrent sélectionner manuellement le noyau. Pour ce faire, commentez le "timeout ” dans /boot/grub/grub.conf fichier pour mettre en pause le processus de démarrage dans le menu GRUB.
Par exemple :
# vim /boot/grub/grub.conf file. # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/mapper/vg_vm27-lv_root # initrd /initrd-[generic-]version.img #boot=/dev/vda default=0 #timeout=5 ....