歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux操作系統學習筆記(41)

Linux操作系統學習筆記(41)

日期:2017/2/25 10:34:36   编辑:Linux教程

刪除已經加載的內核模塊

與加載模塊相同,卸載它們既可以在較高層次上使用 modprobe 來完成,也可以在較低層次上使用 rmmod 來完成。較高層次工具會按反向依賴次序卸載所有內容。rmmod 只是刪除一個單獨的內核模塊,但是當模塊正在被使用時將會失敗(通常是因為依賴)。 例如:


清單 13. 嘗試卸載依賴正在被使用的模塊

% modprobe snd-emux-synth

% rmmod soundcore

soundcore: Device or resource busy

% modprobe -rv snd-emux-synth

# delete snd-emux-synth

# delete snd-seq-midi-emul

# delete snd-seq-virmidi

# delete snd-rawmidi

# delete snd-seq-midi-event

# delete snd-seq

# delete snd-timer

# delete snd-seq-device

# delete snd-util-mem

# delete snd

# delete soundcore

不過,如果內核模塊可以被刪除,rmmod 將從內存中卸載它,例如:


清單 14. 卸載沒有依賴的模塊

% rmmod -v reiserfs

Checking reiserfs for persistent data

Copyright © Linux教程網 All Rights Reserved