显示磁盘和闪存的信息,以及分区信息
[root@bogon shell]# fdisk -lDisk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk 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 307199Checking 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。