suse11修改如下:
#kdump
sed -i "s/crashkernel=[[:graph:]]*/crashkernel=256M-:512M/g" /boot/grub/menu.lst
sed -i "s/KDUMP_SAVEDIR=[[:graph:]]*/KDUMP_SAVEDIR=\"file:\/\/\/opt\/crash\"/g" /etc/sysconfig/kdump
sed -i "s/KDUMP_DUMPFORMAT=[[:graph:]]*/KDUMP_DUMPFORMAT=\"compressed\"/g" /etc/sysconfig/kdump
chkconfig boot.kdump on
mkdumprd -f
修改后需要重启生效。
注意在suse 11 sp3 kdump-0.8.4-0.29.5 修改配置后不生效,是kdump的bug。
解决方法是在修改配置文件后,运行下面命令
mkdumprd -f
bug参考:https://support.hpe.com/hpsc/doc/public/display?docId=mmr_kc-0110976
suse12 修改如下:
#kdump
sed -i "s/crashkernel=[[:graph:]]*high/crashkernel=512M,high/g" /etc/default/grub
sed -i "s/crashkernel=[[:graph:]]*low/crashkernel=256M,low/g" /etc/default/grub
sed -i "s/crashkernel=[[:graph:]]*high/crashkernel=512M,high/g" /boot/grub2/grub.cfg
sed -i "s/crashkernel=[[:graph:]]*low/crashkernel=256M,low/g" /boot/grub2/grub.cfg
echo "" >> /etc/default/grub
sed -i "s/KDUMP_SAVEDIR=[[:graph:]]*/KDUMP_SAVEDIR=\"file:\/\/\/opt\/crash\"/g" /etc/sysconfig/kdump
sed -i "s/KDUMP_DUMPFORMAT=[[:graph:]]*/KDUMP_DUMPFORMAT=\"compressed\"/g" /etc/sysconfig/kdump
systemctl enable kdump
systemctl start kdump
修改后需要重启生效。
补充知识点: 查询kdump的状态命令如下:
rckdump status
yast2 进入kdump命令如下:
yast2 kdump
将系统搞挂验证kdump命令如下:
echo c > /proc/sysrq-trigger