LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fixing Bad Sectors with Command Line (https://www.linuxquestions.org/questions/linux-newbie-8/fixing-bad-sectors-with-command-line-4175437281/)

DannPM 11-15-2012 09:57 AM

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!

spazticclown 11-15-2012 12:08 PM

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.

chrism01 11-15-2012 06:52 PM

If you suspect HW errors (and given disk that old I would), you should use http://linux.die.net/man/8/smartctl

DannPM 11-24-2012 01:53 AM

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!


All times are GMT -5. The time now is 04:35 PM.