公告版位

uplink燈號:1G-switch跟10G-switch對接,1G-switch上的10G port燈號。

dreamtails 發表在 痞客邦 留言(0) 人氣()

core switch ping ip不通,但region switch ping ip會通,這可能是core switch沒設定"管理IP",而不表示core switch沒有在運作,因為switch只要通了電,它就已經在運作了,因此我們要用console線去接core switch看設定有沒有跑掉。若core switch不通,region switch也不通,那可能core switch真的掛掉了,所以還是要用console線去看看它的情況。

dreamtails 發表在 痞客邦 留言(0) 人氣()

smartctl看有關HDD資訊

看smart的log:
$ less /var/log/messages

看HDD是否支援S.M.A.R.T:
$ smartctl -i /dev/sda

若HDD有支援S.M.A.R.T,則啟動S.M.A.R.T功能:
$ smartctl -s on -d ata /dev/sda

看HDD支援哪些self-test routine,通常有short, conveyance與long三種self-test:
$ smartctl -c /dev/sda

使用long self-test routine取得較正確的結果(P.S. 一次只能執行一個測試):
$ smartctl -t long /dev/sda

smartctl不會顯示測試進度,但會回報這個測試要執行多久。等時間差不多後就確認測試進度:
$ smartctl -l selftest /dev/sda

看測試結果:
$ smartctl -a /dev/sda

看測試結果中,健康狀況的部份:
$ smartctl -H /dev/sda

看測試結果中,error log的部份:
$ smartctl -l error /dev/sda



請注意以下這一段:
===============================================
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
............
............
SMART Error Log Version: 1
No Errors Logged
===============================================

***若ID# 5、7、10、11、196~200這幾個項目的RAW_VALUE不為0,且持續增加,應立即備分並更換硬碟。

以上來源出自:http://sites.google.com/site/lab586/linuxnote/hddchecktip

dreamtails 發表在 痞客邦 留言(0) 人氣()

badblocks 指令檢測損壞磁區 (P.S. 讀寫次數龐大,常用會損害硬碟壽命)

語法:
badblocks [ -svwnf ] [ -b block-size ] [ -c blocks_at_once ] [ -e max_bad_blocks ] [ -d read_delay_factor ]
[-i input_file ] [ -o output_file ] [ -p num_passes ] [ -t test_pattern ] device [ last-block ] [ first-block ]

常用選項:
(default): non-destructive read-only mode 無損唯讀模式,較快。
-n: non-destructive read-write mode 無損讀寫模式,速度最慢。掛載中硬碟需加 -f 強制執行 (會有硬碟/檔案系統毀損的風險)
-w: destructive write test 毀滅性寫入測試。會將檔案全部抹銷!掛載中硬碟需加 -f 強制執行
-f: 強制執行,與 -n 或 -w 配合使用
-v: 執行中回報進度
-s: 將檢測出的壞磁區顯示在螢幕上
-i input_file: 略過不檢測 input_file 裡的已知 badblocks,這些已知 badblocks 同樣不會顯示在檢測結果中。
-o output_file: 將檢測出的 badblocks 寫在 output_file 上。

通常為求速度與資料安全,會使用預設的無損唯讀模式進行掃描。例如:
$ badblocks -v /dev/sda -o badblocks.txt

以上command為對 /dev/sda 進行無損唯讀模式掃描,-v 選項令 badblocks 在執行中回報進度,並以 -o 選項將檢測出的損壞磁區寫在 badblocks.txt 檔案裡。

dreamtails 發表在 痞客邦 留言(0) 人氣()

查詢Linux的版本與硬體資訊指令如下:

一.查詢Linux版本資訊
[root@mis~]# lsb_release -a
LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5 (Final)
Release: 5
Codename: Final

二.查詢主機硬體資訊
[root@mis~]# dmidecode --type
Type number or keyword expected
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot

dmidecode下載與詳細說明網址:http://www.nongnu.org/dmidecode/

以上來源出自:http://jojochen.blog.ithome.com.tw/summary.php?op=UserProfile&userId=2530

dreamtails 發表在 痞客邦 留言(0) 人氣()

如何查詢Linux主機CPU, RAM與HDD硬體規格指令:


有兩種方式:

方式一:在/proc之下執行
$ cat cpuinfo
$ cat meminfo


方式二:執行指令
$ dmidecode -t processor
$ dmidecode -t memory

以上來源出自:http://jojochen.blog.ithome.com.tw/post/2529/63418


方式三:
$ grep -A 3 "model name" /proc/cpuinfo |egrep -v '(stepping|cache|--)'|awk -F: '{print $2}'
$ dmesg | grep "Memory:"
$ fdisk -l 2> /dev/null|grep '^Disk'
$ cat /proc/scsi/scsi

dreamtails 發表在 痞客邦 留言(0) 人氣()

Linux command for HDD:

[dd] 將硬碟直接備份到另外一顆硬碟
$ dd if=/dev/hda of=/dev/sda conv=noerror,sync bs=4k

[kill][killall] 查看DD的執行進度
$ kill -SIGUSR1 9218
# 9218 is PID
$ killall -SIGUSR dd編輯

dreamtails 發表在 痞客邦 留言(0) 人氣()

sed 指令:

$ cat string.txt|sed -n 20p
顯示第20列文字編輯

dreamtails 發表在 痞客邦 留言(0) 人氣()

awk 指令:

$ awk -F ":" '{print $1}' string.txt
文字切割,只要有":"的都切開

$ awk '{print $1}' string.txt
文字切割,只要有空白字元的都切開編輯

dreamtails 發表在 痞客邦 留言(0) 人氣()

grep 指令:

$ grep -A 3 "model name" /proc/cpuinfo
抓出model name的這一列,並顯示它下面的其他三列

dreamtails 發表在 痞客邦 留言(0) 人氣()

硬體資訊取得指令(內容較多):dmidecode

[root@mis~]# dmidecode --type
[root@mis~]# dmidecode --type bios
[root@mis~]# dmidecode -t bios
[root@mis~]# dmidecode -t 0
[root@mis~]# dmidecode -t 1

Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot

Type Information:
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Device

以上來源出自:http://www.ha97.com/4120.html

dreamtails 發表在 痞客邦 留言(0) 人氣()

在CentOS開機進GRUB的畫面後,選擇完要進入的kernel,之後就按"i",就會進入Interactive mode。以往開機時,service會自動啟動並show上"ok"的字樣,而在Interactive mode下,每個service在準備要啟動時,系統會先問你是否要啟動,若要啟動請按"y",若不啟動請按"n"。

dreamtails 發表在 痞客邦 留言(0) 人氣()

ethtool

如同: ethtool eth0 或 ethtool eth1

 

Link detected欄位顯示為yes,則表示有接上網路線

如同: Link detected: no

dreamtails 發表在 痞客邦 留言(0) 人氣()

在輸出檔案後加上2>&1

如同: tar zxvf testfile.tar.gz >> output.log 2>&1

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. # ping 10.1.1.6

      (先ping想要得知MAC的IP address)

 

2. # arp

      (再查看IP address的MAC address屬於哪一個)

dreamtails 發表在 痞客邦 留言(0) 人氣()