A bad sector is a sector on a computer’s disk drive that cannot be used
due to permanent damage (or an OS inability to successfully access it),
such as physical damage to the disk surface.
There are two ways to detect bad sectors in Linux: you can use the Disk
Utility GUI, or if you are a command line geek like me, you can use the
badblocks command to check your hard disk for bad sectors:
sudo badblocks -v /dev/sda2
Badblock will give you the number of bad sectors in our hard disk.
mamen@laptop:~$ sudo badblocks -v /dev/sda2
Checking blocks 0 to 56477867
Checking for bad blocks (read-only test): 2543654 done, 4:41 elapsed
4326543 done, 9:26 elapsed
done
Pass completed, 2 bad blocks found.
You have two options when you see bad blocks. You can either look for a
new hard disk, or mark these bad blocks as unusable hard disk sectors.
This involves two steps:
First we have to write the location of the bad sectors into a flat file.
sudo badblocks /dev/sda > /home/mamen/bad-blocks
After that, we need to feed the flat file into the FSCK command to mark these bad sectors as ‘unusable’ sectors.
sudo fsck -l bad-blocks /dev/sda
or one reader suggested it should read:
sudo mkfs -c bad-blocks /dev/sda
Home » linux » Bad Blocks or sectors on a harddisk via linux
Saturday, February 8, 2014
Bad Blocks or sectors on a harddisk via linux
lainnya dari linux
Ditulis Oleh :
Bagus Keren
//
12:49 PM
Kategori:
linux
Subscribe to:
Post Comments
(
Atom
)
0 komentar :
Post a Comment