LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-16-2007, 04:30 AM   #1
volleyboy
LQ Newbie
 
Registered: Sep 2007
Posts: 6

Rep: Reputation: 0
usb hard disk lost for ever?


Hi at all.
I have a trekstor usb hd 2,5'' (SAMSUNG HM160JC), 160 gb.
After 1 month of great job, my debian doesn't recognize it!
I post a dmesg:

usb 1-3: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
Vendor: SAMSUNG Model: HM160JC Rev: 0000
Type: Direct-Access ANSI SCSI revision: 00
SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)
sda: Write Protect is off
sda: Mode Sense: 27 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)
sda: Write Protect is off
sda: Mode Sense: 27 00 00 00
sda: assuming drive cache: write through
sda:<6>sd 1:0:0:0: SCSI error: return code = 0x08000002
sda: Current: sense key: Medium Error
Additional sense: Unrecovered read error
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
sd 1:0:0:0: SCSI error: return code = 0x08000002
sda: Current: sense key: Medium Error
Additional sense: Unrecovered read error
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
unable to read partition table
sd 1:0:0:0: Attached scsi disk sda
usb-storage: device scan complete
sd 1:0:0:0: SCSI error: return code = 0x08000002
sda: Current: sense key: Medium Error



........I do not understand what it means and how can it be solved.
Please help me!
thanks.
 
Old 09-16-2007, 06:26 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The error you are seeing, "Medium Error", means that the surface of the disk has been damaged. This usually happens when moving the drive while it's powered up and spinning.

You can try wiping the information, repartitioning and reformatting with a read/write bad block remap (the '-c -c' option), but it may not be possible depending on the extent of the damage:

Code:
# Wipe the label, partition table, LVM2 and MD areas
dd if=/dev/zero of=/dev/sda bs=512 count=64

# Repartition to create /dev/sda1
fdisk /dev/sda

# Reformat and map out bad blocks
mke2fs -c -c -j -m0 /dev/sda1
 
Old 09-16-2007, 06:47 AM   #3
volleyboy
LQ Newbie
 
Registered: Sep 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by macemoneta View Post
The error you are seeing, "Medium Error", means that the surface of the disk has been damaged. This usually happens when moving the drive while it's powered up and spinning.

You can try wiping the information, repartitioning and reformatting with a read/write bad block remap (the '-c -c' option), but it may not be possible depending on the extent of the damage:

Code:
# Wipe the label, partition table, LVM2 and MD areas
dd if=/dev/zero of=/dev/sda bs=512 count=64

# Repartition to create /dev/sda1
fdisk /dev/sda

# Reformat and map out bad blocks
mke2fs -c -c -j -m0 /dev/sda1

When I type
Code:
fdisk /dev/sda
I see this message:
Code:
luini:~# fdisk /dev/sda
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

You must set cylinders.
You can do this from the extra functions menu.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help):
..and now? What I have to do?

thank you
 
Old 09-16-2007, 07:03 AM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The command 'man fdisk' will have some help, but notice the "Command (m for help):".

Code:
Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
You want to create a new primary partition, and write the partition table to the drive:

Code:
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-xxxxxx, default 1): <just hit enter>
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-xxxxxx, default xxxxxx): <just hit enter>
Using default value xxxxxx

Command (m for help): w

Last edited by macemoneta; 09-16-2007 at 07:06 AM.
 
Old 09-16-2007, 07:07 AM   #5
volleyboy
LQ Newbie
 
Registered: Sep 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by macemoneta View Post
The command 'man fdisk' will have some help, but notice the "Command (m for help):".

Code:
Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
You want to create a new primary partition, and write the partition table to the drive:

Code:
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-xxxxxx, default 1): <just hit enter>
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-xxxxxx, default xxxxxx): <just hit enter>
Using default value xxxxxx

Command (m for help): w


If I type "n" , I see:
Code:
Command (m for help): n
You must set cylinders.
You can do this from the extra functions menu.
 
Old 09-16-2007, 07:19 AM   #6
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
This means that the drive has lost the basic geometry information. You will need to open the external drive case, and examine the disk drive inside. The physical cylinders, heads, sectors are printed on the label on the drive. Once you have this information you enter it via:

Code:
Command (m for help): x

Expert command (m for help): s
Number of sectors (1-63): <enter the value from the label>

Expert command (m for help): h
Number of heads (1-256): <enter the value from the label>

Expert command (m for help): c
Number of cylinders (1-131071): <enter the value from the label>

Expert command (m for help): r
 
Old 09-16-2007, 08:03 AM   #7
volleyboy
LQ Newbie
 
Registered: Sep 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by macemoneta View Post
This means that the drive has lost the basic geometry information. You will need to open the external drive case, and examine the disk drive inside. The physical cylinders, heads, sectors are printed on the label on the drive. Once you have this information you enter it via:

Code:
Command (m for help): x

Expert command (m for help): s
Number of sectors (1-63): <enter the value from the label>

Expert command (m for help): h
Number of heads (1-256): <enter the value from the label>

Expert command (m for help): c
Number of cylinders (1-131071): <enter the value from the label>

Expert command (m for help): r
ok.
Because of I can't open box. I've found on google this values:

Code:
/dev/hda:

 Model=SAMSUNG HM160JC, FwRev=AP100-16, SerialNo=S0Y8J10P209726
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
 RawCHS=16383/16/63, TrkSize=34902, SectSize=554, ECCbytes=4
 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5 udma3 udma4 udma5 
 AdvancedPM=yes: disabled (255) WriteCache=enabled
 Drive conforms to: ATA/ATAPI-7 T13 1532D revision 0:  ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7

 * signifies the current active mode

lfalkenburg@lfalkenburg-laptop:~$ sudo hdparm /dev/hda

/dev/hda:
 multcount    =  0 (off)
 IO_support   =  1 (32-bit)
 unmaskirq    =  1 (on)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 readonly     =  0 (off)
 readahead    = 256 (on)
 geometry     = 19457/255/63, sectors = 312581808, start = 0
Do you think that are right for me?

thanks again
 
Old 09-16-2007, 08:10 AM   #8
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Maybe. Manufacturers change drives without changing the model. You can try it. If the values are wrong, the drive will either appear smaller/larger than it should be, or the format will fail trying to write to non-existing areas.
 
Old 09-16-2007, 11:40 AM   #9
volleyboy
LQ Newbie
 
Registered: Sep 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Hi,
I don't understand the error.

Code:
Expert command (m for help): c
Number of cylinders (1-1048576): 19457

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Expert command (m for help): h
Number of heads (1-256, default 255):
Using default value 255

Expert command (m for help): s
Number of sectors (1-63, default 63):
Using default value 63
Warning: setting sector offset for DOS compatiblity

Expert command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 25: Inappropriate ioctl for device.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
...it seems to be really broken!
 
Old 09-16-2007, 11:50 AM   #10
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
I hate to complicate things, but the error message could also point to a failed controller, which in this case would most likely be the interface between the drive and the USB.

I'd be looking at this possibility before trying to go too far with that drive.

Given that the basic geometry info isn't being retrieved, I would actually assign the likelihood of a controller failure ahead of a drive failure; it is rare for any kind of drive failure that is short of total to result in the loss of geometry info, but this would be an expected response from a failed controller.

Last edited by jiml8; 09-16-2007 at 11:52 AM.
 
Old 09-16-2007, 11:56 AM   #11
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
volleyboy: Did you create the partition before attempting to write? If not, you didn't write anything, and reading the partition information will then fail.

jiml8: Yup, but I'm pursuing the optimistic path that the drive media has a correctable error. If it turns out that's not the case, then hardware has to be replaced, either incrementally (drive, case/interface) or all together.
 
Old 09-16-2007, 12:04 PM   #12
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
jiml8: Yup, but I'm pursuing the optimistic path that the drive media has a correctable error. If it turns out that's not the case, then hardware has to be replaced, either incrementally (drive, case/interface) or all together.
I would label that a pessimistic case, in that you are following a path that will result in all the data on the drive being lost. While this might not be a big deal since the drive has only been in use a month, it is never a good thing.

I would say that the first thing to do is remove the drive from the housing, plug it into a computer, and see if it can be read from there. This has the advantage of immediately ruling in or ruling out the controller, and if the controller is identified as the problem it makes it possible to immediately access the data.

Further, by directly plugging the drive into a computer, tools that don't work via USB (hdparm) can be used.
 
Old 09-16-2007, 12:43 PM   #13
volleyboy
LQ Newbie
 
Registered: Sep 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Do you think that a low level format can help me?
 
Old 09-16-2007, 12:52 PM   #14
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
jiml8: Read post #7. What you or I might do isn't necessarily an option. If you'd like to attempt the walk-through, I'll defer to you.
 
Old 09-16-2007, 01:00 PM   #15
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by macemoneta View Post
jiml8: Read post #7. What you or I might do isn't necessarily an option. If you'd like to attempt the walk-through, I'll defer to you.
Can't open box??? Oh well!

Reminds me of a joke.

The blonde was on her hands and knees, searching the floor closely. A fellow comes along, sees her peering at the floor and asks: "what did you lose? Can I help you find it?"

She responds: "Yes, I lost a contact lens over there (points across the room), and I am trying to find it."

"If you lost the lens over there, why are you searching for it here?"

"Because the light is better here"

Should the controller be at fault (and all the symptoms/diagnosis to this point sure suggests that) then not opening the box = not fixing the problem.

Carry on.
 
  


Reply



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
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM
USB disk lost after 10 minutes pingu Mandriva 2 01-16-2006 03:14 AM
Hard Disk crash, everything thrown into lost+found...and now what? vous Linux - Hardware 6 01-03-2006 06:47 AM
usb controller dies mounting external usb hard disk komasoftware Linux - Hardware 4 11-30-2005 01:18 PM
lost dell laptop 5100 hard disk password student04 Linux - Newbie 1 05-01-2005 09:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:09 AM.

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