LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-15-2012, 10:57 AM   #1
DannPM
LQ Newbie
 
Registered: Nov 2012
Location: Overland Park, KS
Distribution: Linux Mint Cinnamon
Posts: 2

Rep: Reputation: Disabled
Fixing Bad Sectors with Command Line


Fixing my in-laws' computer. Long story short, bad sectors on the partition, bringing it back to life with Linux Mint (Was previously very slow Windows). 2004 Dell 4700 Desktop.

Linux Mint will not install direct due to the bad sectors (that's the error it gives me when stalling out).

Boot into Puppy Linux (only thing I can boot on there for now)

Expand partition 'sda2' to include almost the entire HD, format to ext2, mark as bootable, and mount, all using Gparted.

In the terminal, run 'fsck /dev/sda2 ľa' To my understanding, this should correct/remove the bad sectors on the this partition of the HD by itself without question.

Restart, boot with Mint off the CD, hopefully works. Anyone see any problems with this? I'm a complete noob to Unix line command and HD management.

I just started a self-study course online because I really want to learn Unix now!
 
Old 11-15-2012, 01:08 PM   #2
spazticclown
Member
 
Registered: Sep 2010
Distribution: Fedora, Android, CentOS
Posts: 91
Blog Entries: 2

Rep: Reputation: 21
Looking at the man page for fsck -a repairs file system errors automatically, not failed physical sectors on a hard disk.

A quick google search for remap or repairing bad sectors in Linux brings up some options however in my experience when a hard drive has multiple bad sectors it is just going to get worse. It may be wise to replace the hard drive with a new unit or a good older unit if available.

e2fsck with the -c switch scans the drive using badblocks "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" (e2fsck man page).

If there is no important data on the drive you might go ahead and try the e2fsck -c option. Otherwise back up everything as I doubt your drive is long for the world. If it works please post back, this would be interesting to know.

Hope this has helped you.
 
Old 11-15-2012, 07:52 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
If you suspect HW errors (and given disk that old I would), you should use http://linux.die.net/man/8/smartctl
 
Old 11-24-2012, 02:53 AM   #4
DannPM
LQ Newbie
 
Registered: Nov 2012
Location: Overland Park, KS
Distribution: Linux Mint Cinnamon
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for the help guys. I ended up spending some major time in learning about Linux command line code. Not sure what was wrong with the drive still though. I ended up replacing the ancient thing for under $22 and increased the HD space by 50% ha! I installed VectorLinux due to only having 500MB of RAM. Works wonderfully and now my non-technical in-laws are using VectorLinux as their everyday system!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixing Bad Sectors Clarence-Adams Linux - Newbie 13 01-26-2012 12:27 AM
re-allocated sectors count shows 2 bad sectors, in Ubuntu 10.04 disk utility james2b Linux - Hardware 4 10-13-2010 12:16 AM
Smartmontools, fixing Unreadable Disk Sectors justinian0 Linux - Hardware 1 08-08-2009 06:22 AM
LXer: What is so bad about the command line? LXer Syndicated Linux News 0 01-24-2009 10:30 PM
fixing bad blocks/sectors warheros Linux - Software 3 07-19-2003 11:01 PM


All times are GMT -5. The time now is 08:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration