Hitachi Dynamic Link Manager ユーザーズガイド(Linux®用)
kdump機能を使用する設定手順を,次の順序で説明します。
カーネルダンプの出力先となるディスクを追加します。
システムディスク(/varディレクトリ)のファイルシステムに異常が発生した場合でもカーネルダンプを採取できるようにするため,カーネルダンプ出力用のディスクは,システムディスクから独立した別のディスクに設定することを推奨します。
次の条件に該当する場合,ディスクの追加は不要です。
以下は,カーネルダンプ出力用のディスクを作成する実行例です。
# /sbin/dlmcfgmgr -r KAPL10339-I This operation will change the configuration of HDLM devices. Do you want to continue? [y/n]: y KAPL10341-I The HDLM device configurations have been changed. KAPL10302-I /sbin/dlmcfgmgr completed normally.
# /sbin/dlmcfgmgr -v HDevName Management Device Host Channel Target Lun /dev/sddlmaa configured /dev/sda 0 0 0 0 /dev/sdc 1 0 0 0 /dev/sddlmab configured /dev/sdb 0 0 0 1 /dev/sdd 1 0 0 1 /dev/sddlmac configured /dev/sde 0 0 0 2 KAPL10302-I /sbin/dlmcfgmgr completed normally.下線部に新しいディスクが追加されています。
# /sbin/dlmcfgmgr -o /dev/sddlmac KAPL10339-I This operation will change the configuration of HDLM devices. Do you want to continue? [y/n]: y KAPL10341-I The HDLM device configurations have been changed. KAPL10302-I /sbin/dlmcfgmgr completed normally.
# /sbin/dlmcfgmgr -v HDevName Management Device Host Channel Target Lun /dev/sddlmaa configured /dev/sda 0 0 0 0 /dev/sdc 1 0 0 0 /dev/sddlmab configured /dev/sdb 0 0 0 1 /dev/sdd 1 0 0 1 /dev/sddlmac unconfigured /dev/sde 0 0 0 2 KAPL10302-I /sbin/dlmcfgmgr completed normally.Management列に「unconfigured」が表示されていることを確認してください。
次の操作を実行して,カーネルダンプの出力先を設定します。
# fdisk /dev/sde The number of cylinders for this disk is set to 10240. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sde: 10.7 GB, 10737418240 bytes 64 heads, 32 sectors/track, 10240 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-10240, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-10240, default 10240): Using default value 10240 Command (m for help): p Disk /dev/sde: 10.7 GB, 10737418240 bytes 64 heads, 32 sectors/track, 10240 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sde1 1 10240 10485744 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
# mkfs -t ext3 -L kdump_disk /dev/sde1 mke2fs 1.39 (29-May-2006) Filesystem label=kdump_disk OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 1310720 inodes, 2621436 blocks 131071 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2684354560 80 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 24 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
# mkfs -t ext4 /dev/sde1 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 65536 inodes, 262094 blocks 13104 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=268435456 8 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 30 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
UUID="bf5d6d8d-d18b-45f8-8187-86837d895488" TYPE="ext4"
LABEL=kdump_disk /var/crash ext3 defaults 1 2
UUID=bf5d6d8d-d18b-45f8-8187-86837d895488 /var/crash ext4 defaults 1 2
path hdlm ext3 LABEL=kdump_disk
path hdlm ext4 UUID=bf5d6d8d-d18b-45f8-8187-86837d895488
disk_timeout 1
ブートローダの設定ファイルに,kdump機能のオプションを追加します。ただし,Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,Oracle Linux 7またはOracle Linux 8の場合は,編集は不要です。
grub.confファイルの編集例を次に示します。下線部の個所を編集してください。
: : default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu #title HDLM-Red Hat Enterprise Linux 6 (2.6.32-754.el6.x86_64) # root (hd0,0) # kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=UUID=0d5f28ce-f4ac-44f4-bf10-2d1ac785fbac rd_NO_LUKS rd_NO_MD rd_NO_LVM rd_NO_DM rhgb quiet # initrd /initramfs-hdlm-2.6.32-754.el6.x86_64.img title HDLM-kdump-Red Hat Enterprise Linux 6 (2.6.32-754.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=UUID=0d5f28ce-f4ac-44f4-bf10-2d1ac785fbac rd_NO_LUKS rd_NO_MD rd_NO_LVM rd_NO_DM rhgb quiet crashkernel=128M initrd /initramfs-hdlm-2.6.32-754.el6.x86_64.img : :
カーネルダンプの採取時に,セカンドカーネルで使用されるkdump機能用の初期RAMディスクイメージファイルを作成します。
# shutdown -r now
# mkdir /var/crash/hdlm
# touch /etc/kdump.conf # systemctl restart kdump.service #
# touch /etc/kdump.conf # /sbin/service kdump restart Stopping kdump: [ OK ] Detected change(s) the following file(s): /etc/kdump.conf Rebuilding /boot/initrd-2.6.32-754.el6.x86_64kdump.img Starting kdump: [ OK ]
# ls -l /boot/initrd-`uname -r`kdump.img -rw-------. 1 root root 6499431 mmm dd hh:mm /boot/initrd-2.6.32-754.el6.x86_64kdump.img表示されたファイルの更新時刻を確認してください。
# shutdown -r now
カーネルパニックを発生させて,カーネルダンプが正しく採取されることを確認します。
# echo c > /proc/sysrq-triggerカーネルパニックが発生すると,カーネルダンプが採取されます。そのあと,ホストが再起動します。
# ls -lR /var/crash/ /var/crash/: total 0 drwxr-xr-x 2 root root 4096 mmm dd hh:mm 127.0.0.1-yyyy-mm-dd-hh:mm:ss /var/crash/hdlm/127.0.0.1-yyyy-mm-dd-hh:mm:ss: total 58732 -r-------- 1 root root 60074832 mmm dd hh:mm vmcore -rw-r--r--. 1 root root 63270 mmm dd hh:mm vmcore-dmesg.txt #
# ls -lR /var/crash/ /var/crash/: total 24 drwxr-xr-x 3 root root 4096 mmm dd hh:mm hdlm drwx------ 2 root root 16384 mmm dd hh:mm lost+found /var/crash/hdlm: total 4 drwxr-xr-x 2 root root 4096 mmm dd hh:mm 127.0.0.1-yyyy-mm-dd-hh:mm:ss /var/crash/hdlm/127.0.0.1-yyyy-mm-dd-hh:mm:ss: total 1971852 -r-------- 1 root root 2017199848 mmm dd hh:mm vmcore /var/crash/lost+found: total 0
以上で,kdump機能を使用するために必要な設定は終了です。
All Rights Reserved. Copyright© 2014, 2023, Hitachi, Ltd.