查看硬盘信息的很多命令,都需要root权限,如果普通用户无法看到信息,请切换至root:
1、查看硬盘使用时间等信息
硬盘使用时间很重要,硬盘理论寿命是3万小时以上
$ sudo smartctl -A /dev/sda
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 108 099 006 Pre-fail Always - 19969376
3 Spin_Up_Time 0x0023 097 097 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 101
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
7 Seek_Error_Rate 0x002f 081 060 030 Pre-fail Always - 4421191835
9 Power_On_Hours 0x0032 092 092 000 Old_age Always - 7111
10 Spin_Retry_Count 0x0033 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 98
180 Unused_Rsvd_Blk_Cnt_Tot 0x002a 100 100 000 Old_age Always - 667245796
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0033 100 100 097 Pre-fail Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 099 000 Old_age Always - 2
189 High_Fly_Writes 0x003a 097 097 000 Old_age Always - 3
190 Airflow_Temperature_Cel 0x0022 066 059 045 Old_age Always - 34 (Min/Max 25/37)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 18
193 Load_Cycle_Count 0x0032 095 095 000 Old_age Always - 11308
194 Temperature_Celsius 0x0022 034 041 000 Old_age Always - 34 (0 16 0 0 0)
196 Reallocated_Event_Count 0x0032 100 100 036 Old_age Always - 0
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
2、查看硬盘是否有坏道
写道
badblocks -v /dev/sda
正在检查从 0 到 156290903的块
Checking for bad blocks (read-only test): 完成
Pass completed, 0 bad blocks found.
3、查看硬盘分区
写道
fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x81728172
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 4870 38912000 83 Linux
/dev/sda3 4870 5132 2097152 82 Linux swap / Solaris
/dev/sda4 5132 19458 115075072 83 Linux
4、查看已挂在分区使用情况
写道
df -h
文件系统 容量 已用 可用 已用%% 挂载点
/dev/sda2 37G 4.8G 30G 14% /
tmpfs 466M 552K 466M 1% /dev/shm
/dev/sda1 194M 28M 156M 16% /boot
/dev/sda4 109G 13G 91G 13% /home