linux磁盘检测和修复

显示磁盘和闪存的信息,以及分区信息

[root@bogon shell]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00043062

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      616447      307200   83  Linux
/dev/sda2          616448     4810751     2097152   82  Linux swap / Solaris
/dev/sda3         4810752    41943039    18566144   83  Linux


#坏道/坏块检查
[root@bogon shell]# badblocks /dev/sda1
[root@bogon shell]# badblocks -v /dev/sda1      #-v显示检查过程
Checking blocks 0 to 307199
Checking for bad blocks (read-only test): done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)
[root@bogon shell]# 


#使用smartmontools工具扫描坏道
yum install smartmontools -y    #安装工具
[root@bogon shell]# smartctl -H /dev/sda1       #检查/dev/sda1健康状况
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-514.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

[root@bogon shell]# 



e2fsck用于检查和修复ext3和ext2文件系统的硬盘分区,不过这个命令还有专有形式:fsck.ext3, fsck.ext2分别用于检测ext3和ext2。

posted on 2017-10-25 18:06  标配的小号  阅读(392)  评论(0编辑  收藏  举报

导航