2015年12月16日 星期三

硬碟檢測

硬碟檢測指令
最基本的測試方法是利用 badblocks (8) 來檢測硬碟是否存在壞軌.
預設的非破壞性唯讀測試 (non-destructive read-only test),
以避免寫入測試時異常,造成磁碟重置離線。
badblocks -vs /dev/sda

若是可承受資料損失,可以使用 「-n」 的非破壞性寫入式測試。
這基本上會嘗試寫入資料,再三確認硬碟運作正常。
badblocks -nvs /dev/sda

備份整個硬碟資料
dd if=/dev/sda of=sda.img

如果確認整顆硬碟資料都不需要保留,
可以直接下達一下 dd 指令,重寫整顆硬碟。

dd if=/dev/zero of=/dev/sda

或者在格式化時下達 -c -c 參數,讓 mkfs.ext3 順便檢查壞軌。
mkfs.ext3 -c -c /dev/sda1

讓 e2fsck 用 badblocks 去作壞軌檢查,指令如下
e2fsck -k -c  -c /dev/sda1

如此 e2fsck 會將壞軌寫入檔案系統列表中,
可以用下述指令查詢目前壞軌列表
dumpe2fs -b /dev/sda1

# 參考 : http://sfs.chc.edu.tw/~chi/blog/index.php?load=read&id=298

2015年11月29日 星期日

查詢硬體資訊 (inxi)

# 轉載自 http://xubuntu.org/news/inxi/
Information typeCommand, usage, and more information
System informationinxi -b and inxi -F
The b option output basic system information, while the Foption will output full system information.
Hard drive detailsinxi -D
Outputs information on your hard drives, like make, model and size
Hard drive partitionsinxi -p
Outputs information about all mounted partitions, mount points and space usage
Networkinginxi -n and inxi -ni
Outputs information about the details of the network interfaces and configuration. When the i option is used withn, Inxi will output IP address details (for both WAN and LAN).
Hardwareinxi -AG and inxi -h
The A and G options output information about the audio and graphics hardware respectively. You usually want to use them together. The h option outputs you the full list of options you can use to get even more information about your hardware.

2015年11月13日 星期五

查硬體資訊

可用 lshw 這程式來檢查的話,可用下面的指令來安裝,因為是指令式的程式,所以,裝好也不會出現在選單上。
apt-get install lshw

lshw 可以產出多種報表的格式,lshw 可以產出文字檔,HTML 和 XML 等三種格式,HTML 格式比較方便人來看,而 XML 格式則是可以方便程式來對產出的報表做後續的處理,下面就是分別產出三種格式的指令。

sudo lshw > hwmessage.txt

sudo lshw -html > hwmessage.html

sudo lshw -xml > hwmessage.xml
--
參考「阿舍的隨手記記」資料 : http://www.arthurtoday.com/2012/11/lshw-tutorial.html

2015年8月11日 星期二