From 28e2b20cf3211c33f02d5fede19c9c3b22a6e759 Mon Sep 17 00:00:00 2001 From: Vic___ Date: Mon, 11 Aug 2014 14:12:18 +0800 Subject: [PATCH] Translated --- ... for bad sectors or bad blocks in linux.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sources/tech/20140808 Check Hard drive for bad sectors or bad blocks in linux.md b/sources/tech/20140808 Check Hard drive for bad sectors or bad blocks in linux.md index 40cad6302f..d4dcbb7d5a 100644 --- a/sources/tech/20140808 Check Hard drive for bad sectors or bad blocks in linux.md +++ b/sources/tech/20140808 Check Hard drive for bad sectors or bad blocks in linux.md @@ -1,34 +1,32 @@ - Vic020 - -Check Hard drive for bad sectors or bad blocks in linux +检查linux中的损坏的扇区和区块 ================================================================================ -**badblocks** is the command or utility in linux like operating system which can **scan** or test our **hard disk** and **external drive** for **bad sectors**. Bad sectors or **bad blocks** is the space of the disk which can't be used due to the **permanent damage** or OS is unable to access it. +**badblocks**是linux及其类似的操作系统中,扫描检查硬盘和外部设备损坏扇区的命令工具。损坏的扇区或者损坏的区块是硬盘中因为永久损坏或者是操作系统不能读取的空间。 -Badblocks command will detect all **bad blocks(bad sectors)** on our hard disk and save them in a text file so that we can use it with **e2fsck** to configure Operating System(OS) to not store our data on these damaged sectors. +Badblocks命令可以探测硬盘中所有损坏的扇区或者区块并将结果保存在一个文本文档中,这样,我们就可以使用**e2fsck**命令来配置操作系统不在这些损坏的扇区中存储。 -### Step:1 Use fdisk command to identify your hard drive info ### +### 步骤:1 使用fdisk识别硬盘信息 ### # sudo fdisk -l -### Step:2 Scan your hard drive for Bad Sectors or Bad Blocks ### +### 步骤:2 扫描硬盘的损坏扇区或区块 ### # sudo badblocks -v /dev/sdb > /tmp/bad-blocks.txt -Just replace “/dev/sdb” with your own hard disk / partition. When we execute above command a text file “bad-blocks” will be created under /tmp , which will contains all bad blocks. +只需将“/dev/sdb”替换为自己机器的/分区。执行完成上述命令后,一个名为“bad-blocks”文本文档将会在/tmp下创建,它将包含所有的损坏区块。 -Example : +例如: ![](http://www.linuxtechi.com/wp-content/uploads/2014/08/badblocks.png) -### Step:3 Inform OS not to use bad blocks for storing data ### +### 步骤:3 告诉操作系统不要使用损坏区块存储 ### -Once the scanning is completed , if the bad sectors are reported , then use file “bad-blocks.txt” with e2fsck command and force OS not to use these bad blocks for storing data. +扫描完成后,如果损坏区块被发现了,然后通过e2fsck命令使用“bad-blocks.txt”,强迫操作系统不使用这些损坏的区块存储数据。 # sudo e2fsck -l /tmp/bad-blocks.txt /dev/sdb -Note : Before running e2fsck command , you just make sure the drive is not mounted. +注意:在运行e2fsck命令前,请保证设备没有被挂载。 -For any futher help on badblocks & e2fsck command , read their man pages +关于badblocks和e2fsck命令的更多帮助,请参考下列man页面 # man badblocks # man e2fsck @@ -38,7 +36,7 @@ For any futher help on badblocks & e2fsck command , read their man pages via: http://www.linuxtechi.com/check-hard-drive-for-bad-sector-linux/ 作者:[Pradeep Kumar][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Vic___](http://www.vicyu.net) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出