Check disk status linux

Check your hard disk for problems

Hard disks have a built-in health-check tool called SMART (Self-Monitoring, Analysis, and Reporting Technology), which continually checks the disk for potential problems. SMART also warns you if the disk is about to fail, helping you avoid loss of important data.

Although SMART runs automatically, you can also check your disk’s health by running the Disks application:

Check your disk’s health using the Disks application

  1. Open Disks from the Activities overview.
  2. Select the disk you want to check from the list of storage devices on the left. Information and status of the disk will be shown.
  3. Click the menu button and select SMART Data & Self-Tests… . The Overall Assessment should say “Disk is OK”.
  4. See more information under SMART Attributes , or click the Start Self-test button to run a self-test.

What if the disk isn’t healthy?

Even if the Overall Assessment indicates that the disk isn’t healthy, there may be no cause for alarm. However, it’s better to be prepared with a backup to prevent data loss.

If the status says “Pre-fail”, the disk is still reasonably healthy but signs of wear have been detected which mean it might fail in the near future. If your hard disk (or computer) is a few years old, you are likely to see this message on at least some of the health checks. You should backup your important files regularly and check the disk status periodically to see if it gets worse.

If it gets worse, you may wish to take the computer/hard disk to a professional for further diagnosis or repair.

More Information

You can choose the displayed language by adding a language suffix to the web address so it ends with e.g. .html.en or .html.de.
If the web address has no language suffix, the preferred language specified in your web browser’s settings is used. For your convenience:
[ Change to English Language | Change to Browser’s Preferred Language ]

Читайте также:  Syncing time in linux

The material in this document is available under a free license, see Legal for details.
For information on contributing see the Ubuntu Documentation Team wiki page. To report errors in this documentation, file a bug.

Источник

How to check disk errors in Linux

Common disk errors include physical failures, bad sectors or blocks, and inconsistent filesystems, which can lead to various problems. Diagnosing these issues in Linux can be done using built-in command line tools.

The disk must not be mounted when performing these tests. If it’s necessary to check the root filesystem and it cannot be unmounted due to logged-in users, you can boot into a live Linux system, such as the Ubuntu installer disk. This method is also helpful for recovering partition tables.

Steps to scan for disk error and bad sector in Linux:

$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 55.4M 1 loop /snap/core18/1997 loop1 7:1 0 219M 1 loop /snap/gnome-3-34-1804/66 loop2 7:2 0 64.8M 1 loop /snap/gtk-common-themes/1514 loop3 7:3 0 32.3M 1 loop /snap/snapd/11588 loop4 7:4 0 51M 1 loop /snap/snap-store/518 loop5 7:5 0 65.1M 1 loop /snap/gtk-common-themes/1515 sda 8:0 0 20G 0 disk ├─sda1 8:1 0 1M 0 part ├─sda2 8:2 0 513M 0 part /boot/efi └─sda3 8:3 0 19.5G 0 part / sdb 8:16 0 20G 0 disk /mnt/data sr0 11:0 1 1024M 0 rom
$ sudo umount /dev/sdb [sudo] password for user:

Assess the disk’s S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology) health status using smartctl.

$ sudo smartctl -H /dev/sdb smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.11.0-16-generic] (local build) Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Health Status: OK
$ sudo fsck /dev/sdb fsck from util-linux 2.36.1 e2fsck 1.45.7 (28-Jan-2021) /dev/sdb: clean, 11/1310720 files, 126322/5242880 block
$ sudo badblocks -v /dev/sdb Checking blocks 0 to 20971519 Checking for bad blocks (read-only test): done Pass completed, 0 bad blocks found. (0/0/0 errors)

Источник

How to check disk health status in Linux

S.M.A.R.T., or Self-Monitoring, Analysis, and Reporting Technology, is a system designed to monitor hard drive health. It is integrated into both traditional magnetic and SSD drives and can help predict drive failure, allowing you to take action before a problem occurs.

The smartctl tool, part of the smartmontools package, allows you to check the status of your S.M.A.R.T.-enabled hard disk drive (HDD) in Linux. This package is available in most Linux distributions, including Ubuntu.

To assess disk health in Ubuntu and other Linux distributions, install the smartmontools package and use the smartctl utility from the terminal. Note that S.M.A.R.T. does not cover disk errors like bad sectors or corrupted filesystems, so you may need additional methods for these issues.

Читайте также:  Linux mint для дома

Steps to check hard drive health status in Linux:

$ sudo apt update && sudo apt install --assume-yes smartmontools #Ubuntu and Debian
$ lsblk | grep disk sda 8:0 0 20G 0 disk sdb 8:16 0 5G 0 disk
$ sudo smartctl -t short /dev/sda smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-47-generic] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Short self-test routine immediately in off-line mode". Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful. Testing has begun. Please wait 2 minutes for test to complete. Test will complete after Wed Jul 17 15:58:30 2019 Use smartctl -X to abort test.
$ sudo smartctl -H /dev/sda smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-47-generic] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Health Status: OK

Author: Mohd Shakir Zakaria
Mohd Shakir Zakaria, a proficient cloud architect, is deeply rooted in development, entrepreneurship, and open-source advocacy. As the founder of Simplified Guide, he combines these passions to help others navigate the intricate world of computing. His expertise simplifies complex tech concepts, making them accessible to everyone. Discuss the article:

Comment anonymously. Login not required.

Источник

Check Disk Health in Linux/Ubuntu [How To / Guide]

Linux Check Disk

Concerned that you have a failing hard drive? Make a backup. Then, use these Linux tools to check your disk/drive.

Not concerned that you have a failing drive? Back up anyway. It could be failing, and you don’t know it. Or it could get stolen. Or a meteorite could hit it.

Back. Up. Your. Files.

What is SMART?

S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology) is the system most hard disks use to report their health to the installed system.

This information can be queried to find out whether a drive is reporting any issues.

Using smartmontools/smartctl

The smartmontools contains the smartctl package, which can query the SMART status of a physical hard drive.

You can install it on Ubuntu and Debian based systems by running:

sudo apt install smartmontools

Once installed, you provide it with the path to the device name for your hard disk, and it queries the SMART status of the drive and outputs the results:

Читайте также:  Python windows path to linux path

Above, the -a option is passed, telling smartctl to print all available SMART information for that disk.

/dev/sda is the path to the hard disk you want to check the health of. If you don’t know what this is, you can find a list of disks that can be queried by running:

Most commands in this article are run using sudo as they require root/administrative privileges.

Checking Using badblocks

The badblocks tools come pre-installed on many distributions, including Ubuntu. It will check for bad blocks on your disk.

A block (or sector) is an area of the physical storage device where data is stored. badblocks will scan your disk block by block; if a block is damaged, it is marked as bad -, and the system actively avoids storing data on that part of the hard disk. When it’s done, you’ll get a full report on how many bad blocks were found.

Above, the -v option is used, which tells badblocks to be verbose and output as much information as possible while it is running. Finally,/dev/sda is the path to the device to be checked.

Running badblocks may take quite a while, depending on the size of the disk. However, once completed, you will receive a report on how many bad blocks or sector was found – which can be a good indicator of whether your disk has been damaged.

You can view the full user manual for backblocks by running:

Viewing SMART Status in a GUI Using gsmartcontrol

If you want to view the information provided by smartctl, but want to view it in a graphical window, you can use gsmartcontrol. Install it by running:

sudo apt install gsmartcontrol

You will be presented with a window containing a list of devices you can select:

GsmartControl - Linux Check Disk

…each can be clicked on to reveal SMART data, which can be inspected and exported.

Conclusion

Don’t bet on any of these tools. Drives fail ungracefully. Mechanical drives can jam up after being bumped at just the right angle. Power surges can happen. Cars can fly off of roads, bounce off of trees and crash through your house and destroy your computers. Please make a backup, and keep it somewhere safe.

Источник

Оцените статью
Adblock
detector