修復Linux無法開機問題: "dup2: bad file descriptor"

轉載自:
http://www.goitexpert.com/entry.cfm?entry=Fixing-dup2-bad-file-descriptor-error-on-Linux

問題:
/dev/null 意外消失了

解決方法:
重新開機後輸入root密碼
首先mount proc
$ mount -o ro /proc
c
再以可讀寫重新mount 根目錄
$ mount -o remount,rw /

復原/dev/null檔案
$ rm -f /dev/null
$ mknod -m 666 /dev/null c 1 3

再以唯獨模式重新mount 根目錄
$ mount -o remount,ro /

重新開機
$ reboot

留言

這個網誌中的熱門文章

RTC & CMOS 技術詳解

[自由網路] 如何取得 Google Drive (真實)外連位址 (Direct Link)