In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article Xiaobian for you to introduce in detail "how to use Smartmontools to detect hard disk bad path in Linux", the content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to use Smartmontools to detect hard disk bad track in Linux" can help you solve your doubts.
Use the Bad Block tool to check for Bad channels on Linux
The Bad Block tool allows the user to scan the device for bad tracks or blocks. The device can be a disk or an external disk represented by a file such as / dev/sdc. First, execute the fdisk command with superuser privileges to display information about all your disks or flash memory and their partitions:
Sudo fdisk-l
Then check for bad tracks / blocks on your Linux hard drive with the following command:
In the above command, badblocks scans the device / dev/sda10 (remember to specify your actual device), and the-v option lets it display the details of the operation. In addition, output redirection is used to redirect the result of the operation to the file badsectors.txt.
If you find any bad tracks on your disk, uninstall the disk and tell the system not to write data to the return sector as shown below.
You need to execute the e2fsck (for the ext2/ext3/ext4 file system) or fsck command, and the badsectors.txt file and device file are also used in the command.
The-l option tells the command to add a list of bad blocks to the sector numbers listed in the specified file badsectors.txt.
-use the Smartmontools tool to scan for bad paths on Linux for for ext2/ext3/ext4 file systems-$sudo e2fsck-l badsectors.txt / dev/sda10 or-for other file systems-$sudo fsck-l badsectors.txt / dev/sda10
This method is more reliable and efficient for modern disks with S.M.A.R.T systems (ATA/SATA and SCSI/SAS hard drives as well as solid state drives). The S.M.A.R.T system can help detect, report, and possibly record their health, so you can identify any possible hardware failures.
You can install smartmontools using the following command:
-on Debian/Ubuntu-based systems-$sudo apt-get install smartmontools- on RHEL/CentOS-based systems-$sudo yum install smartmontools
After the installation is complete, use smartctl to control the disk integrated S.M.A.R.T system. You can check its manual or help like this:
$man smartctl$ smartctl-h
Then execute the smartctrl command and specify your device as a parameter in the command, which includes the parameter-H or-health to display the results of the SMART overall health self-assessment test.
$sudo smartctl-H / dev/sda10
The above results indicate that your hard drive is healthy and hardware failures are unlikely to occur in the near future. To get an overview of disk information, use the-an or-all options to display all SMART information about the disk, and-x or-xall to display all SMART information about the disk as well as non-SMART information.
After reading this, the article "how to use Smartmontools to detect bad hard drives in Linux" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.