How to check badblocks on HDD and SSD?

Giteqa

None of us wants to lose the data of a hard drive or solid-state drive due to an unexpected failure. After all, it is very dangerous for business and because of the usual inattention, you can lose a tidy sum of money.

What is the reason for this and why does this happen, as well as what is dangerous that the disk is not checked by its owner? In this article we will answer these questions, and I will also give you some tips on how to check your hard drive without resorting to various kinds of programs.

Hard Disk Problems

Problems are of various kinds and appear for various reasons, but most often they are due to the fact that the disk is outdated or has received physical damage. To understand exactly what happened to him and not to be afraid for the data on him, it is worth checking, and this can be done in various ways. Previously, we have already considered what are the differences between HDD and SSD, but now I will describe the biggest difference that can affect the problems of these disks.

  • HDD - works on magnetic disks and is highly susceptible to magnetic influence and God forbid to drop it – this can lead to a complete breakdown of the disk.
  • SSD - Consists of microchips of memory and is not so much affected by magnetic effects or it is not so scary to drop it.

However, although they differ even in the principle of operation, they both have the same kind of problems, which means that if they are not checked in a timely manner, this will lead to sad consequences.

Windows

An example will be shown on Windows 10. That's like Windows Os 2016;2019

Checking the hard drive with the command line

There are many programs that allow you to check your hard drive, but we will use the command line for this. It is thanks to the command line that we will check the broken sectors and the performance of the HDD or SSD.

You can check the hard disk using the command line and the CHKDSK command. To begin with, open the command line, you can find it using the search and write in the cmd window that appears

In order for you to run the check, you need to run the command line on behalf of the administrator.

After confirmation, a command prompt will open in front of you where you can enter the necessary chkdsk command. In the example below you can see what it looks like.

To run a check of a specific disk, enter chkdsk C: in this way, disk C will be checked

After you confirm the command, the hard disk check will begin.

So that you can initially start correcting disk errors, write the command as follows chkdsk /f - where f is responsible for correcting errors

After checking the hard drive, you will be given information about the progress of the check, how long it took and how many errors were found or fixed. To get complete instructions on how to work with this command, just type chkdsk /? And it will give you all the parameters to work as in the example below.

Each letter is responsible for a different parameter during verification, and to make it more convenient, we will highlight several key ones that must be used during verification.

  • Chkdsk C: - Checks a specific disk, which is indicated by a letter with a colon.
  • Chkdsk /F - Corrects errors found during the check
  • Chkdsk /R - Searches for damaged sectors and restores them.
  • Chkdsk/X - Pre-disables the disk if it needs to be checked. All data will be unavailable during the verification.

These were the main commands that should be used when checking the disk. Also, sometimes you may get an error that the disk cannot be checked and will be asked if it is worth checking it at the next restart?

Enter Y in the command line and the next time you restart your disk will be checked (Most often this applies to the system disk).

Thanks to this command, you can check the disk performance without installing separate programs on Windows OS and Windows Server OS.

Linux

Now let's look at which commands and distributions you can use to check the disk operation.

Checking the hard disk on Linux

In order to check the hard drive, there is also no need to install any additional utilities. Everything can be done with a couple of commands on the command line.

You should familiarize yourself with the following types of commands: sudo fdisk -l and badblocks.

  • Sudo fdisk -l - this command allows you to find out all the disks that are connected to the system and their names.
  • Badblocks - this command checks the hard disk for broken sectors.

Initially, you need to enter the Sudo fdisk –l command (If that's a small letter L) and thus find out the name of your disk.

After that, you need to enter the command Badblocks -sv /dev/vda

BadBlocks

  • -s - Thanks to this parameter, you can track the execution of the command.
  • -v - This allows you to check the hard disk for broken sectors.

As you can see in the screenshot, after entering this command with these parameters, you will be shown as a percentage of the number of sectors checked and how much time has passed. Also in parentheses you can see the number of errors found, the number of corrected and those that can no longer be affected.
As soon as the check is completed, you will be shown the following:

BadBlockReady

As you can see, I had no problems found, and the check was completed successfully.

What should I do if the disk is damaged?

In the event that the disk is damaged and it is impossible to fix the broken sectors, there is only one way out – buying a new disk. It is important to understand that using a hard drive that has broken sectors or other problems should not be used. The chance of losing the data stored on the disk is too high and this can lead to losses for your business.

So that you do not have to buy a new hard drive, as soon as the old one fails, you can use the services mivocloud.com and don't worry about these problems. You won't even need to replace the hard drive because our specialists will take care of everything.

Work smart and be happy with Mivocloud