In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to use the badblocks command 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 badblock command is used to find corrupted blocks on the disk. The hard disk is a depleted device, which may cause physical failures such as bad tracks after being used for a period of time. After the computer hard disk appears bad channel, if not timely replacement or technical processing, the bad road will be more and more, and will cause frequent crashes and data loss. The best way to deal with it is to replace the disk, but in temporary cases, the sectors of the bad parts should be shielded in time and do not touch them. Badblocks is a good tool for checking the location of bad channels.
Badblocks looks for damaged blocks in the disk
Syntax badblock (options) (parameters) option-b: specify the chunk size of the disk in bytes;-o: write the results of the check to the specified output file;-s: show progress during the check;-v: display detailed information during execution;-w: perform a write test during the check. Parameter disk device: specify the disk device to check
Number of disk chunks: specifies the total number of blocks of the disk device
Start block: specify the block from which to start the check.
The instance badblocks checks each block 16 times with a block of 4096, and outputs the results to the "hda-badblocks-list" file.
Badblocks- b 4096-c 16 / dev/hda1-o hda-badblocks-listhda-badblocks-list is a text file with the following contents:
Cat hda-badblocks-list 51249 51250 51251 51253 51254. 61245. You can do a few more operations on suspicious blocks. Next, badblocks takes 4096 bytes as a "block", checks each "block" once, and outputs the result to the "hda-badblocks-list.1" file, starting at 51000 block and ending at 63000 block.
Badblocks- b 4096-c 1 / dev/hda1-o hda-badblocks-list.1 63000 51000 it takes a short time, and the hard drive produces a "quack" sound in a very short time under specified conditions. Due to the different inspection conditions, the output results are not exactly the same. Repeat the same operation several times, and the results are different because the conditions are somewhat different. After several operations, until the final hda-badblock-list.final file is generated.
Other 1. Information about fsck using badblocks
Badblocks will only mark bad information in the log file, but if you want to skip these bad blocks when detecting the disk, you can use the-l parameter of fsck:
Fsck.ext3-l / tmp/hda-badblock-list.final / dev/hda12, detect bad channels before creating a file system
Badblocks can be run with the-c deletion of e2fsck and mke2fs (as well as for ext3 file systems) to detect bad information before creating a file system:
The mkfs.ext3-c / dev/hda1 code means to use-c to check for bad hard drives before creating a file system.
This operation has clearly told us that we can use the mkfs.ext3-c option to check the hard drive in read-only. This command checks the hard drive when formatting it and marks the wrong hard drive "block". It takes a lot of patience to format the hard drive in this way, because after the command is run, the hard drive will be checked one by one in a read way.
Thank you for reading! This is the end of this article on "how to use badblocks commands 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.