Tutorials

How to check if your hard drive is failing on linux

Table of contents:

Anonim

For Linux users, the options are in many cases somewhat more limited. Therefore there are ways to check the status of our hard drive manually. There is a possibility with the fsck command. It is a very useful way to determine if our hard drive is about to die. We explain the entire process step by step.

Check disk status using commands (For Linux)

Checking the disk status with the fsck command is the first option. It is a good way to check it, although you have to be careful. It is recommended to unmount the partition before using the fsck command, for security reasons. It is not recommended at any time to start the fsck command on a mounted partition. Once clarified we can start:

  • To execute fsck on the next reboot you have to execute the shutdown command and then add -f (shutdown -r -F now) You can create the forcefsck file directly (Touch / forcefsck)

At the moment the system restarts the hard disk will be scanned and the file will be deleted. If you need to back up your information, you can do it with the tar command. This command creates a compressed file.

If you want to make a complete backup of the system, you must execute the following:

tar cvpzf /backup-full.tar.gz –exclude = / proc –exclude = / lost + found –exclude = / backup-full.tar.gz –exclude = / mnt –exclude = / sys –exclude = dev / pts /

In this way we can make a backup of the entire system, although directories that are not important will be excluded. When restoring a backup, just use the -x command.

tar -zxvpf /fullbackup.tar.gz

In this way we can already perform the full backup and we have carried out an analysis of our hard drive to check its good condition and operation.

Tutorials

Editor's choice

Back to top button