centos 硬盘测试,centos查看硬盘命令
大家好,centos 硬盘测试相信很多的网友都不是很明白,包括centos查看硬盘命令也是一样,不过没有关系,接下来就来为大家分享关于centos 硬盘测试和centos查看硬盘命令的一些知识点,大家可以关注收藏,免得下次来找不到哦,下面我们开始吧!
centos怎么使用命令查看硬盘sn
题主你好,
步骤: 1.使用lsblk命令查看你当前的磁盘情况;
拿我电脑来说,我当前就一块硬盘sda,被分成了两个区, sda1和sda2:
2.利用"lsblk-o SERIAL硬盘名全路径"命令查看具体某块硬盘的sn;
拿上图来说,我就一块硬盘,名为sda,所以命令为: lsblk-o SERIAL/dev/sda
测试结果图如下:
说明:如果题主电脑上的硬盘名称显示可能和我的不同,看上面第一幅图,如果TYPE列显示为disk则相应NAME列下的值就是硬盘名称.
希望可以帮到题主,欢迎追问.
在Linux中使用Smartctl监控磁盘性能的方法
Smartctl(S.M.A.R.T自监控,分析和报告技术)是类Unix系统下实施SMART任务命令行套件或工具,它用于打印SMART自检和错误日志,启用并禁用SMRAT自动检测,以及初始化设备自检。
Smartctl对于Linux物理服务器十分有用,在这些服务器上,可以对智能磁盘进行错误检查,并将与硬件RAID相关的磁盘信息摘录下来。
在本帖中,我们将讨论smartctl命令的一些实用样例。如果你的Linux上海没有安装smartctl,请按以下步骤来安装。
安装 Smartctl
对于 Ubuntu
复制代码代码如下:$ sudo apt-get install smartmontools
对于 CentOS& RHEL
复制代码代码如下:# yum install smartmontools
启动Smartctl服务
对于 Ubuntu
复制代码代码如下:$ sudo/etc/init.d/smartmontools start
对于 CentOS& RHEL
复制代码代码如下:# service smartd start; chkconfig smartd on
样例
样例:1检查磁盘的 Smart功能是否启用
复制代码代码如下:root@linuxtechi:~# smartctl-i/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION===
Model Family: Seagate Momentus 5400.6
Device Model: ST9320325AS
Serial Number: 5VD2V59T
LU WWN Device Id: 5 000c50 020a37ec4
Firmware Version: 0002BSM1
User Capacity: 320,072,933,376 bytes [320 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 5400 rpm
Device is: In smartctl database [for details use:-P show]
ATA Version is: ATA8-ACS T13/1699-D revision 4
SATA Version is: SATA 2.6, 1.5 Gb/s
Local Time is: Sun Nov 16 12:32:09 2014 IST
SMART support is: Available- device has SMART capability.
SMART support is: Enabled
这里‘/dev/sdb’是你的硬盘。上面输出中的最后两行显示了SMART功能已启用。
样例:2启用磁盘的 Smart功能
复制代码代码如下:root@linuxtechi:~# smartctl-s on/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF ENABLE/DISABLE COMMANDS SECTION===
SMART Enabled.
样例:3禁用磁盘的 Smart功能
复制代码代码如下:root@linuxtechi:~# smartctl-s off/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF ENABLE/DISABLE COMMANDS SECTION===
SMART Disabled. Use option-s with argument'on' to enable it.
样例:4显示磁盘的详细 Smart信息
复制代码代码如下:root@linuxtechi:~# smartctl-a/dev/sdb// For IDE drive
root@linuxtechi:~# smartctl-a-d ata/dev/sdb// For SATA drive
样例:5显示磁盘总体健康状况
复制代码代码如下:root@linuxtechi:~# smartctl-H/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION===
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
190 Airflow_Temperature_Cel 0x0022 067 045 045 Old_age Always In_the_past 33(Min/Max 25/33)
样例:6使用long和short选项测试硬盘
Long测试
复制代码代码如下:root@linuxtechi:~# smartctl--test=long/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION===
Sending command:"Execute SMART Extended self-test routine immediately in off-line mode".
Drive command"Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 102 minutes for test to complete.
Test will complete after Sun Nov 16 14:29:43 2014
Use smartctl-X to abort test.
或者,我们可以重定向测试输出到日志文件,就像下面这样
复制代码代码如下:root@linuxtechi:~# smartctl--test=long/dev/sdb>/var/log/long.text
Short测试
复制代码代码如下:root@linuxtechi:~# smartctl--test=short/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION===
Sending command:"Execute SMART Short self-test routine immediately in off-line mode".
Drive command"Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Sun Nov 16 12:51:45 2014
Use smartctl-X to abort test.
或
复制代码代码如下:root@linuxtechi:~# smartctl--test=short/dev/sdb>/var/log/short.text
注意:short测试将花费最多2分钟,而在long测试中没有时间限制,因为它会读取并验证磁盘的每个段。
样例:7查看驱动器的自检结果
复制代码代码如下:root@linuxtechi:~# smartctl-l selftest/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 90% 492 210841222
# 2 Extended offline Completed: read failure 90% 492 210841222
样例:8计算测试时间估值
复制代码代码如下:root@linuxtechi:~# smartctl-c/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION===
General SMART Values:
Offline data collection status:(0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status:( 121) The previous self-test completed having
the read element of the test failed.
Total time to complete Offline
data collection:( 0) seconds.
Offline data collection
capabilities:(0x73) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities:(0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability:(0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time:( 1) minutes.
Extended self-test routine
recommended polling time:( 102) minutes.
Conveyance self-test routine
recommended polling time:( 2) minutes.
SCT capabilities:(0x103b) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
样例:9显示磁盘错误日志
复制代码代码如下:root@linuxtechi:~# smartctl-l error/dev/sdb
Sample Output
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
Copyright(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION===
SMART Error Log Version: 1
ATA Error Count: 5
CR= Command Register [HEX]
FR= Features Register [HEX]
SC= Sector Count Register [HEX]
SN= Sector Number Register [HEX]
CL= Cylinder Low Register [HEX]
CH= Cylinder High Register [HEX]
DH= Device/Head Register [HEX]
DC= Device Command Register [HEX]
ER= Error register [HEX]
ST= Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It"wraps" after 49.710 days.
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
----------------------------------------------------
25 da 08 e7 e5 a5 4c 00 00:30:44.515 READ DMA EXT
25 da 08 df e5 a5 4c 00 00:30:44.514 READ DMA EXT
25 da 80 5f e5 a5 4c 00 00:30:44.502 READ DMA EXT
25 da f0 5f e6 a5 4c 00 00:30:44.496 READ DMA EXT
25 da 10 4f e6 a5 4c 00 00:30:44.383 READ DMA EXT
CentOS下对硬盘读写速度测试的详解
一个偶然装DB数据库的机会,发现安装很慢,于是系统工程师建议我测下硬盘读写速度,发现读写速度才200左右,
机器是dellR710内存12G操作系统是centos 6 64位
后来重装了centos 5.7 64位,
其它未做任何更改。
测试速度如下(3次):
R710 CENTOS 5.7 64位(12G内存)
[root@localhost data]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.30085 seconds, 825 MB/s
[root@localhost data]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.39172 seconds, 772 MB/s
[root@localhost data]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.26415 seconds, 849 MB/s
其它机器测试(回头再符上机器配置)
于是又在另外的710,相同配置上的centos5.4 32位:(12G内存)
[root@db1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 3.04131 seconds, 353 MB/s
[root@db1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 2.23476 seconds, 480 MB/s
[root@db1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.45485 seconds, 738 MB/s
[root@db1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.30145 seconds, 825 MB/s
[root@db1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.3871 seconds, 774 MB/s
cache R610 centos 6.0 64位:(16G内存)
[root@cache~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,7.08763秒,151 MB/秒
[root@cache~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,8.12101秒,132 MB/秒
[root@cache~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,6.66439秒,161 MB/秒
[root@cache~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,7.80735秒,138 MB/秒
[root@cache~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,7.87918秒,136 MB/秒
WEB1 R610 CENTOS 6 64(8G内存)
[root@web1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,6.15494秒,174 MB/秒
[root@web1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,5.95299秒,180 MB/秒
[root@web1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,5.7888秒,185 MB/秒
LVS R610 CENTOS 5.4 32位配置与WEB1一模一样(8G内存)
[root@lb1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 3.34055 seconds, 321 MB/s
[root@lb1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 5.97799 seconds, 180 MB/s
[root@lb1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.60396 seconds, 669 MB/s
[root@lb1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.59689 seconds, 672 MB/s
[root@lb1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 2.81365 seconds, 382 MB/s
6.0的64位,速度明显比5.7的64位差很多,
由于710的64位己经删除了,所以没有数据,但当时测的,基本没超过250的,
这难倒是6.0 64的BUG?还是什么,待日后确认,看来还得把系统都换成5的了。
另外,两台配置一样的(除内存)R310测试:
配置决对要比710和610低很多:
CENTOS 5.4 32位 12G内存
[root@beta1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.14459 seconds, 938 MB/s
[root@beta1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.15009 seconds, 934 MB/s
[root@beta1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.14913 seconds, 934 MB/s
[root@beta1~]# dd if=/dev/zero of=/data/test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes(1.1 GB) copied, 1.14882 seconds, 935 MB/s
CENTOS 6 64位,4G内存
[root@admin~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,5.16662秒,208 MB/秒
[root@admin~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,10.1894秒,105 MB/秒
[root@admin~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,10.1708秒,106 MB/秒
[root@admin~]# dd if=/dev/zero of=/data/test bs=1M count=1024
记录了1024+0的读入
记录了1024+0的写出
1073741824字节(1.1 GB)已复制,10.3586秒,104 MB/秒