LinuxQuestions.org
Help answer threads with 0 replies.
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 10-17-2011, 02:28 PM   #1
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Rep: Reputation: 16
Is this external hard drive defective for sure?


I have a SATA 3.5" 1TB hard drive that I wanted to format - the drive was given to me recently and I was told it was in working condition. When I put it in an external USB enclosure, and connect it to my Linux laptop and power it on, 'ls /dev/sdb' now shows up - so the drive is getting 'recognized'.

However, when I do 'sudo fdisk -l /dev/sdb', nothing happens. (I'd like to format the drive as ext4.) Sometimes it just hangs indefinitely, other times the command completes with no output.

The USB enclosure isn't the most reliable but I tried it with another drive and 'sudo fdisk -l /dev/sdb' works on that drive. So my question is whether this drive is defective and needs to be thrown away, or whether I'm maybe doing something wrong in terms of formatting it. I find it strange that the drive shows up in /dev/sdb (I figured if a drive were broken, wouldn't it not show up there to begin with?)

My other question is whether there is a command to run to test whether a drive is really defective, or whether I'm just doing something wrong. Is there some sort of hard drive checking or testing command I could run? (Something like fsck but not for filesystems but rather the disk itself.)
 
Old 10-17-2011, 03:02 PM   #2
mgmax
Member
 
Registered: Jul 2005
Distribution: Debian
Posts: 82

Rep: Reputation: 16
Tip: if you look in /dev/disk/by-id/, you will find all your drives labeled in a useful way so that you do not accidentally overwrite the rwong disk.

This drive does not really seem accessible anymore. I do not think it is still okay. I have not yet had a drive that hangs on fdisk -l. You could try it on another PC, or even better with a different adapter, if it still doesn't work: Throw it away.

If it would still be accessible (like an old harddisk from the shelf still looking okay), you could have tried the following:

Lookup the SMART self-test data with smartctl
Do a write-test with badblocks. (Backup all data on the disk - it will be deleted)

I think these tools have already been documented many times.

Have fun

Max
 
Old 10-17-2011, 03:04 PM   #3
replica9000
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Debian, FreeBSD, Android
Posts: 1,053
Blog Entries: 2

Rep: Reputation: 227Reputation: 227Reputation: 227
Well if you're unsure if it's the USB enclosure, you could try putting it inside the computer. If the problem still persist, then your drive may be defective. Also, you could try using different software to format, such as parted.
 
Old 10-17-2011, 03:23 PM   #4
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
Thanks for the advice to use badblocks, it was the only thing that is returning any sort of output. smartctl returned an error. badblocks is outputting the following which I can't decipher, can someone help me understand what it's telling me? It started with 120.00% done which already confuses me. And it randomly outputs numbers in the middle of the progress like 840, 1200, etc.

Quote:
# sudo badblocks -wvs /dev/sdb
Checking for bad blocks in read-write mode
From block 0 to 976762582
Testing with pattern 0xaa: 0 0.00% done, 0:07 elapsed
120.00% done, 0:13 elapsed
240.00% done, 0:20 elapsed
360.00% done, 0:26 elapsed
480.00% done, 0:33 elapsed
600.00% done, 0:39 elapsed
720.00% done, 1:05 elapsed
840
960.00% done, 1:12 elapsed
108000% done, 1:38 elapsed
1200
132000% done, 1:45 elapsed
144000% done, 2:11 elapsed
1560
168000% done, 2:17 elapsed
180000% done, 2:43 elapsed
1920
204000% done, 2:50 elapsed
216000% done, 3:16 elapsed
2280
240000% done, 3:22 elapsed
252000% done, 3:48 elapsed
2640
276000% done, 3:55 elapsed
288000% done, 4:21 elapsed
 
Old 10-17-2011, 03:25 PM   #5
mgmax
Member
 
Registered: Jul 2005
Distribution: Debian
Posts: 82

Rep: Reputation: 16
Those numbers are bad blocks - this means the disk is defective.
 
1 members found this post helpful.
Old 10-17-2011, 03:29 PM   #6
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
Ok, thanks, I'll throw this disk away then. Out of curiosity, how many bad blocks would you expect to find in an average (not brand new or perfect disk). In general, how many bad blocks do you need to see before it's time to throw away the drive?

Also, are the bad blocks the reason that progress numbers like 180000% are being reported? Shouldn't they all be less than 100%?
 
Old 10-17-2011, 03:33 PM   #7
mgmax
Member
 
Registered: Jul 2005
Distribution: Debian
Posts: 82

Rep: Reputation: 16
I have no idea about the progress, but I throw avay every drive with one bad block. Sadly disk quality has not really improved in the last years.
 
Old 10-17-2011, 06:15 PM   #8
replica9000
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Debian, FreeBSD, Android
Posts: 1,053
Blog Entries: 2

Rep: Reputation: 227Reputation: 227Reputation: 227
I wonder what would happen if you tried this:

Thread: https://www.linuxquestions.org/quest...ommand-362506/

Quote:
Rejuvenate a hard drive
To cure input/output errors experienced when using dd. Over time the data on a drive, especially a drive that hasn't been used for a year or two, grows into larger magnetic flux points than were originally recorded. It becomes more difficult for the drive heads to decipher these magnetic flux points. This results in I/O errors. Sometimes sector 1 goes bad, resulting in a useless drive. Try:
Code:
dd if=/dev/sda of=/dev/sda
to rejuvenate the drive. Rewrites all the data on the drive in nice tight magnetic patterns that can then be read properly. The procedure is safe and economical.
Just make sure to replace /dev/sda with your actual drive!!
 
1 members found this post helpful.
  


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
Booting Linux on an external USB hard drive (not a memory stick, a hard drive) comcastuser Linux - Hardware 4 01-13-2010 06:59 PM
Defective External USB Hard Disk - Data Recovery michael.schmid Linux - Hardware 14 04-14-2009 11:35 PM
ubuntu installed on external hard drive, can't startup without external hard drive. Vanostaajen Linux - Software 23 01-20-2009 09:59 AM
Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22 dcorb62 Linux - General 7 09-04-2007 11:28 PM
external enclosure for an internal hard drive vs external USB hard drive powah Linux - Hardware 1 03-10-2006 09:03 AM

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

All times are GMT -5. The time now is 11:26 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