想對網卡或網路做操作,卻被 device busy 擋下來,是 AIX 上很常見的挫折。典型畫面像這樣:
rmdev -l ent1 Method error (/etc/methods/ucfgdevice): 0514-062 Cannot perform the requested function because the specified device is busy.
用一段小腳本一次處理所有 TCP/IP 介面(lo0 除外):
interfaces=`lsdev -Cc if -F name | grep -v lo0` for interface in $interfaces do ifconfig $interface down ifconfig $interface detach done
SNA:
lssrc -g sna # 是否運行 stopsrc -g sna # 中斷 stopsrc -f -s sna # 強制中斷 /usr/bin/sna -stop sna -t forced /usr/bin/sna -stop sna -t cancel
IPX:
ps -ef | grep npsd ps -ef | grep sapd /usr/lpp/netware/bin/stopnps
NetBIOS:
ps -ef | grep netbios mcs0 unload
絕大多數 device busy 到這一步就能排除。若仍卡著,代表還有其他程式持有該設備,得再用 lsof 之類的手段逐一縮小範圍。