如果您不能使用 reboot -d 或 halt -d 命令,则可以使用内核调试器 kmdb 来强制实施故障转储。必须已在引导时或使用 mdb -k 命令装入了内核调试器,以下过程才能正常进行。
必须处于文本模式中,才能进入内核调试器 (kmdb)。因此,首先要退出任何窗口系统。
如果将本地连接的键盘用作系统控制台,请在该键盘上按 F1-A 组合键。如果将系统配置为使用远程(串行)控制台,请使用适合于该控制台的机制发送中断字符。
此时将显示 kmdb 提示符。
使用 systemdump 宏引发崩溃转储。
[0]> $<systemdump |
此时将显示应急消息,保存崩溃转储,随后系统将重新引导。
通过在控制台登录提示符下登录来确认系统已重新引导。
本示例说明如何使用 halt -d 和 boot 命令强制实施基于 x86 的系统 neptune 的崩溃转储和重新引导。使用此方法强制实施系统崩溃转储。运行带有 -d 选项的 halt 命令后,需要手动重新引导系统。
# halt -d Aug 11 12:51:27 neptune halt: halted by <user> panic[cpu45]/thread=d3971a00: forced crash dump initiated at user request d363ae58 genunix:kadmin+bd (5, 0, 0, d3fefac0) d363af88 genunix:uadmin+88 (5, 0, 0, 0, 0, d363afb4) syncing file systems... done dumping to /dev/dsk/c0t0d0s1, offset 107806720, content: kernel 100% done: 40223 pages dumped, compression ratio 4.11, dump succeeded Press any key to reboot. Resetting... . . . SunOS Secondary Boot version 3.00 Autobooting from bootpath: /pci@0,0/pci1028,10a@3/sd@0,0:a Running Configuration Assistant... If the system hardware has changed, or to boot from a different device, interrupt the autoboot process by pressing ESC. Initializing system Please wait... <<< Current Boot Parameters >>> Boot path: /pci@0,0/pci1028,10a@3/sd@0,0:a Boot args: Type b [file-name] [boot-flags] <ENTER> to boot with options or i <ENTER> to enter boot interpreter or <ENTER> to boot with defaults <<< timeout in 5 seconds >>> Select (b)oot or (i)nterpreter: Loading kmdb... SunOS Release 5.10 Version s10_62 32-bit Copyright 1983-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. configuring IPv4 interfaces: iprb0. add net default: gateway 172.20.26.248 Hostname: neptune The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t0d0s7: is logging. NIS domain name is example.com starting rpc services: rpcbind keyserv ypbind done. Setting netmask of iprb0 to 255.255.255.0 Setting default IPv4 interface for multicast: add net 224.0/4: gateway venus syslog service starting. System dump time: Wed Aug 11 12:51:29 2004 Aug 11 13:13:26 venus savecore: saving system crash dump in /var/crash/venus/*.1 Constructing namelist /var/crash/venus/unix.1 Constructing corefile /var/crash/venus/vmcore.1 100% done: 42157 of 42157 pages saved volume management starting. The system is ready. . . . |