Checking the hard disk for bad blocks in Centos 7

Bad sector (bad sector, bad block, bad block, in amateur literature – bad sector) – a bad (unreadable) or unreliable sector of a hard disk or flash drive; a cluster containing bad sectors, or a cluster marked as such in the file system structures (by the operating system, disk utility, or a virus, for its own use)

To check the disk for bad blocks in the operating system, the badblocks utility is preinstalled

We look at the disk layout:

[[email protected]]# fdisk -l

Disk /dev/sda: 240.1 GB, 240057409536 bytes, 468862128 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: 0x00075d8d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1173503      585728   83  Linux
/dev/sda2         1173504     9969663     4398080   8e  Linux LVM
/dev/sda3         9969664   468860927   229445632   fd  Linux raid autodetect

Disk /dev/sdb: 240.1 GB, 240057409536 bytes, 468862128 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: 0x000a3965

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     8798207     4398080   8e  Linux LVM
/dev/sdb2         8798208   467689471   229445632   fd  Linux raid autodetect

Disk /dev/md127: 234.8 GB, 234818109440 bytes, 458629120 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 /dev/mapper/centos-swap: 9000 MB, 9000976384 bytes, 17580032 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

Checking the disks:

[[email protected]]# badblocks -v /dev/sda3 -s
Checking blocks 0 to 229445631
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found. (0/0/0 errors)

[[email protected]]# badblocks -v /dev/sda2 -s
Checking blocks 0 to 4398079
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found. (0/0/0 errors)

[[email protected]]# badblocks -v /dev/sda1 -s
Checking blocks 0 to 585727
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found. (0/0/0 errors)

The -s parameter is needed to display the progress of the check

As you can see from the log, no bad blocks were found on the disk

Sidebar