Linux查看硬盘使用时间等信息

查看硬盘信息的很多命令,都需要root权限,如果普通用户无法看到信息,请切换至root:

1、查看硬盘使用时间等信息

硬盘使用时间很重要,硬盘理论寿命是3万小时以上

写道
smartctl -A /dev/sda
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
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
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 141 141 021 Pre-fail Always - 3908
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 22
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 082 082 000 Old_age Always - 13677
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 20
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 16
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 5
194 Temperature_Celsius 0x0022 097 069 000 Old_age Always - 46
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 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

 

 

你可能感兴趣的:(linux)