In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to detect bad disk paths and blocks in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The steps are as follows:
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, such as
/ dev/sdc
Such a document represents. First, execute the fdisk command with superuser privileges to display information about all your disks or flash memory and their partitions:
$sudo fdisk-l
List Linux file system partitions
Then check for bad tracks / blocks on your Linux hard drive with the following command:
$sudo badblocks-v / dev/sda10 > badsectors.txt
Scan the hard drive for bad tracks on Linux
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 e2fsck (for the ext2/ext3/ext4 file system) or fsck commands, and badsectors.txt files and device files are also needed 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 (ATA/SATA and SCSI/SAS hard drives and solid state drives) with S.M.A.R.T (self-monitoring analysis and reporting technology Self-Monitoring, Analysis and Reporting Technology) system. 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
Check the health of Linux hard drives
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.
Thank you for reading! This is the end of the article on "how to detect bad disk paths and blocks in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.