| General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-26-2013, 10:19 AM
|
#1
|
|
Senior Member
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,767
Rep:
|
can I quarantine bad sectors on HD?
My hard drive has some bad sectors, and they obviously are affecting system performance: I haven't found any of my valued personal files to be corrupted or lost, but the distro installation can't shut down properly and reinstallation doesn't solve the problem. (Can't believe it took me at least a week to realize the bad sectors were the likely reason.) Is there any way to isolate the bad sectors and make sure the drive never uses them? (No, I can't run out and buy a new hard drive.)
Last edited by newbiesforever; 02-26-2013 at 10:24 AM.
|
|
|
|
02-26-2013, 10:28 AM
|
#2
|
|
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,007
Rep: 
|
Hi
You could use fsck.ext2/3/4 with -c twice. I think you'll need to use a live CD so it can be run while unmounted. And it will take a long time if the disk is big.
Quote:
-c This option causes e2fsck to use badblocks(8) program to do a read-only scan of the device in order to find any bad blocks. If any bad blocks are
found, they are added to the bad block inode to prevent them from being allocated to a file or directory. If this option is specified twice, then
the bad block scan will be done using a non-destructive read-write test.
|
|
|
|
|
02-26-2013, 10:48 AM
|
#3
|
|
Senior Member
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,767
Original Poster
Rep:
|
Quote:
Originally Posted by Guttorm
Hi
You could use fsck.ext2/3/4 with -c twice. I think you'll need to use a live CD so it can be run while unmounted. And it will take a long time if the disk is big.
|
Thank you. Some of the operating system appears to be written on the bad sectors already; if so, will adding the sectors to the bad-block inode make the system useless and necessitate reinstalling?
|
|
|
|
02-26-2013, 11:01 AM
|
#4
|
|
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,007
Rep: 
|
Not sure about this, but if a critical OS file uses a bad block, it will most likely crash anyway because the file is corrupt, or it can simply not be read.
The mkfs.ext4 command also has this option, so if you ever have to reinstall, that option should at least prevent the bad blocks from being used in the future.
|
|
|
|
02-26-2013, 11:10 AM
|
#5
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,168
|
You may be able to mark bad sectors to not being used, but this will not solve your problem. When your OS is already affected by bad sectors that means that the disk is already out of spare sectors to replace bad blocks. This means your disk is dying and even if you can mark the current number of bad sectors as unusable they will become more and more over time, possibly rendering your OS unusable.
I know that you don't want to hear that, but there is no reliable way to bring this disk to a state that you can safely use it again. The disk has to be replaced, but in the meantime you can try to not use the the parts of the disk where the most bad sectors appear with just leaving them unpartitioned. Use the disk as rarely as possible (mount /tmp to RAM, use another disk or Flash drive for /home, ...). Don't trust it at all with important data.
|
|
|
|
02-26-2013, 11:21 AM
|
#6
|
|
Senior Member
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,767
Original Poster
Rep:
|
No, I don't mind hearing it. Thank you. I'm not sure offhand how big the hole is (I think around 145 bad sectors, but out of what total, I don't remember), but should I start checking every one of my data files to see if anything's been lost? Only the operating system is obviously affected. Also, is it pointless to back the hard drive up (because I could be backing up many corrupted files)?
Last edited by newbiesforever; 02-26-2013 at 11:23 AM.
|
|
|
|
02-26-2013, 11:38 AM
|
#7
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,168
|
Quote:
Originally Posted by newbiesforever
but should I start checking every one of my data files to see if anything's been lost?
|
If you have the possibility to do that then yes, you should do that.
Quote:
|
Also, is it pointless to back the hard drive up (because I could be backing up many corrupted files)?
|
More or less pointless, yes, unless you have a reliable way to determine if the data is corrupted. This is why you make a backup before a disk fails, to prevent data loss in case of failure, the same way as you fasten the seatbelt in your car for the case that you may have an accident, not after you hit the wall.
|
|
|
|
02-27-2013, 03:29 PM
|
#8
|
|
Senior Member
Registered: Feb 2006
Location: Austria
Distribution: Ubuntu 12.10
Posts: 1,137
Rep:
|
--edit-- given your last post it seems like this won't help you, but it might be relevant for someone else --edit--
How do you know there are bad sectors?
if there's a nagging "I/O error bad-sector blah blah" on your command line it could be that your kernel is being retarded and is trying to read from a device that isn't there. Happened to me more than once. Make sure the error message relates to an actual physical drive.
Last edited by oskar; 02-27-2013 at 03:32 PM.
|
|
|
|
02-27-2013, 07:49 PM
|
#9
|
|
Guru
Registered: Mar 2008
Posts: 8,533
|
I'd get the OEM's drive diags. They tend to offer a feature that tests drives fully with write reads in some cases. The result would be what some collection of all the computer parts would know. For example. You could have a bad drive controller and a great drive and make it seem like there are issues with the drive.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:41 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|