You can run badblocks -sv /dev/sda
to test the device, from the shell after the installer exits.
You can possibly check a box saying "scan disk for errors" before making the filesystem, and that may help it work around the problem.
If it doesn't, and if you really have 195 bad blocks, you are probably better off just buying a new disk. Even if you did get it to install, more might fail in future and then where would you be?
Drives of decent size start at only about $40 in the US, and not that much more outside. I've been a poor student too but it's not that much.
mke2fs
, the command that is used to initialize the disk has a -cc
option that checks the disk for errors and lays out the filesystem so that it won't use those blocks. If you check the "scan disk" option in the graphical or text mode installer, it ought to end up using that option, and then if there is any way to get this disk working, it will work. If that doesn't work (you should paste the exact errors) then the disk is probably unrecoverably bad.
A bad sector on a drive is a sign of permanent damage to the drive. Unless you have reason to believe that your drive marked these sectors as bad incorrectly, you cannot "fix" them.
It means that a part of your drive is damaged to the extent that it can no longer reliably be read from and/or written to.
Your system can continue to use the drive by marking that sector as unusable, but you might consider a drive replacement anyway, as a bad sector can be a sign that more sectors, or the whole drive, might fail soon.
While there may be ways to force the drive to un-mark a sector as bad, allowing you to use it again, this is likely not a good idea. The sector may stay good, but it will just as likely become bad again. Some data may be lost or corrupted depending on how it fails.
Now, as for the error message you've pasted in your question (as of my writing this), that error has nothing to do with bad sectors. It means that you don't have access to the drive. Being sudo
can give you access, so:
sudo fsck /dev/sdb
However, this is still probably not what you want, because /dev/sdb refers to the entire drive, whereas fsck
is designed to work on filesystems, which are usually (but not always, and you may have an exception here) placed in partitions. If the above didn't work, you may instead have wanted to do this to the 1st partition on that drive:
sudo fsck /dev/sdb1
You can get a list of partitions per drive with:
sudo fdisk -l
Best Answer
There are two ways to detect bad sectors in Linux: you can use the disk utility (gui), or you can use the badblocks command to check your hard disk for bad sectors:
That should answer the question but for anyone else interested in how to mark them it can be done with 2 simple commands...
You add the bad blocks to a file...
and then tell
fsck
to mark these as unusable with ...