I need to check the crashkernel setting on all of my hosts.
The issue(s):
[root@rhvsrv01 ~]# egrep '^[[:space:]]*kernel /vmlinuz.*crashkernel=' /boot/grub/grub.conf | sed -r '1!d;s/.*crashkernel=([[:graph:]]+).*/\1/'
auto
[root@rhvsrv01 ~]# egrep '^[[:space:]]*kernel /vmlinuz.*crashkernel=' /boot/grub/grub.conf | sed -r '2!d;s/.*crashkernel=([[:graph:]]+).*/\1/'
16M@128M
[root@rhvsrv01 ~]# grep vmlinuz /boot/grub/grub.conf | grep -v \#
kernel /vmlinuz-2.6.32-358.2.1.el6.x86_64 ro root=/dev/mapper/VolGroup00-LogVol01 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup00/LogVol01 rd_LVM_LV=VolGroup00/LogVol00 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet elevator=deadline processor.max_cstate=1
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/VolGroup00-LogVol01 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=16M@128M rd_LVM_LV=VolGroup00/LogVol01 rd_LVM_LV=VolGroup00/LogVol00 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
If you need to append something to the line starting with " kernel"
sed -i -e '/^.kernel/ s/$/ transparent_hugepage=never/' /boot/grub/grub.conf
The issue(s):
- crashkernel=<blah> can exist anywhere in the string
- there may be several iterations of a boot entry which contains crashkernel
[root@rhvsrv01 ~]# egrep '^[[:space:]]*kernel /vmlinuz.*crashkernel=' /boot/grub/grub.conf | sed -r '1!d;s/.*crashkernel=([[:graph:]]+).*/\1/'
auto
[root@rhvsrv01 ~]# egrep '^[[:space:]]*kernel /vmlinuz.*crashkernel=' /boot/grub/grub.conf | sed -r '2!d;s/.*crashkernel=([[:graph:]]+).*/\1/'
16M@128M
[root@rhvsrv01 ~]# grep vmlinuz /boot/grub/grub.conf | grep -v \#
kernel /vmlinuz-2.6.32-358.2.1.el6.x86_64 ro root=/dev/mapper/VolGroup00-LogVol01 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup00/LogVol01 rd_LVM_LV=VolGroup00/LogVol00 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet elevator=deadline processor.max_cstate=1
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/VolGroup00-LogVol01 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=16M@128M rd_LVM_LV=VolGroup00/LogVol01 rd_LVM_LV=VolGroup00/LogVol00 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
If you need to append something to the line starting with " kernel"
sed -i -e '/^.kernel/ s/$/ transparent_hugepage=never/' /boot/grub/grub.conf
Comments
Post a Comment