LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 09: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, 12: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, 06:52 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,166

Rep: Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680
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, 01: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-25-2012 11:27 PM
re-allocated sectors count shows 2 bad sectors, in Ubuntu 10.04 disk utility james2b Linux - Hardware 4 10-12-2010 11:16 PM
Smartmontools, fixing Unreadable Disk Sectors justinian0 Linux - Hardware 1 08-08-2009 05:22 AM
LXer: What is so bad about the command line? LXer Syndicated Linux News 0 01-24-2009 09:30 PM
fixing bad blocks/sectors warheros Linux - Software 3 07-19-2003 10:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:55 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
Open Source Consulting | Domain Registration