LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-20-2009, 12:42 PM   #1
djeikyb
Member
 
Registered: Nov 2005
Location: California
Distribution: ubuntu 10
Posts: 162

Rep: Reputation: 33
Did I hose my drive by canceling dd?


So I was trying to copy one of my internal 250 gB drives to an external usb 320 gB hard disk. I didn't think the throughput would be so bad (2.5 mB/s), and it ended up taking too long. I canceled it after fourteen hours with over a hundred gigs to go. It wasn't readable by my system next I plugged it in, and dmesg shows a bunch of io errors. All operations like
Code:
dd if=/dev/usbdisk of=/dev/null
fail with
Code:
dd: reading `/dev/sdd': Input/output error
and dmesg shows:
Code:
[31845.504813] Buffer I/O error on device sdd, logical block 4
[31845.568091] end_request: I/O error, dev sdd, sector 0
What can I do to fix it? Did I brick it?
 
Old 09-20-2009, 01:03 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
dd is not supposed to be used to copy the contents of a smaller drive to a larger one. Even if you had let the process finish, there is a good chance it wouldn't have worked anyway due to differences in drive geometry.

I am guessing that is probably why /dev/sdd (which I assume is the external) is no longer working properly. You can try putting a new partition table on the external drive, and reformatting it, but you might need to zero the drive out too. You could do something like:

Code:
dd if=/dev/zero of=/dev/sdd
This would write all zeros to the drive, but will probably take a very long time. Worst case scenario, you might actually need to do a low level format on the drive, which is usually done with OEM tools from your particular drive manufacturer.
 
Old 09-20-2009, 01:11 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by MS3FGX View Post
dd is not supposed to be used to copy the contents of a smaller drive to a larger one. Even if you had let the process finish, there is a good chance it wouldn't have worked anyway due to differences in drive geometry.
That shouldn't be a problem. all that would happen is that the partitions wouldn't take all the drive. Some unpartitioned space would remain at the end of the drive.

Quote:
I am guessing that is probably why /dev/sdd (which I assume is the external) is no longer working properly. You can try putting a new partition table on the external drive, and reformatting it, but you might need to zero the drive out too. You could do something like:
That shouldn't matter either. All dd does is to read raw bytes from the drive, it doesn't care about the consistency of the fs('s) inside it, in fact it doesn't even require an fs. The drive could be completely zeroed of full of random crap and dd would copy it regardless. It just copies bytes from one place to another.

It rather looks like a broken drive to me, but I don't have all the data to judge. I would start by using smartmontools to do some checks, and make sure that the connection is ok as well. USB plugs sometimes can be fried by static electricity.

About the speed, usb 2.0 and above should be much faster than that. Some boards nowadays include 2.0 and 1.x plugs, so it might worth a check to your mother board's manuals. If you only have usb 1.x then there's not much you can do, other than buying a new mother boards or using a pci expansion card to add some 2.x or 3.x usb ports.

ps. The bottleneck could also be your internal drive, since you are reading from it. So you should also check that your dma is on and you are using the most effective driver for your hd controller.

Last edited by i92guboj; 09-20-2009 at 01:12 PM.
 
Old 09-20-2009, 01:24 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by djeikyb View Post
So I was trying to copy one of my internal 250 gB drives to an external usb 320 gB hard disk. I didn't think the throughput would be so bad (2.5 mB/s), and it ended up taking too long. I canceled it after fourteen hours with over a hundred gigs to go. It wasn't readable by my system next I plugged it in, and dmesg shows a bunch of io errors. All operations like
Code:
dd if=/dev/usbdisk of=/dev/null
fail with
Code:
dd: reading `/dev/sdd': Input/output error
and dmesg shows:
Code:
[31845.504813] Buffer I/O error on device sdd, logical block 4
[31845.568091] end_request: I/O error, dev sdd, sector 0
What can I do to fix it? Did I brick it?
You mean 2.5 MB/s, not 2.5 mB/s? No, dd would not brick it. The symptoms suggest a hardware error on /dev/usbdisk (that is mapped to /dev/sdd?). In this situation I would run tests on /dev/usbdisk (sorry -- I do not know what commands to use to do that but netsearching will find something).
 
Old 09-21-2009, 06:56 PM   #5
djeikyb
Member
 
Registered: Nov 2005
Location: California
Distribution: ubuntu 10
Posts: 162

Original Poster
Rep: Reputation: 33
Gah, bits, bytes, b, B, doesn't seem to be standard abbreviations. Anyhow, I do believe dd was reporting 2.5 MB/sec. The drive is a WD 2.5" external mybook that claims to be usb 2.0, and my workstation mobo also claims 2.0, but I so rarely use the usb ports I can't be sure it isn't operating at 1.1. Though, I suppose the fastest usb1.1 is still only 1.5 mbytes/s (12mbits/8mbits/mbyte per second)

And yes, /dev/sdd == /dev/usbdisk.

I doubt the internal drive is the bottleneck. I know it copies faster to my other internal drives. It's a "Seagate Barracuda 7200.10 ST3250410AS 250GB 7200 RPM 16MB Cache SATA 3.0Gb/s 3.5in Internal Hard Drive - OEM" connected to a sata 2.0 onboard controller (mobo is k8n4e deluxe). That said, I really should make sure I'm using dma and the right kernel drivers. I haven't paid nearly so much attention to it since I switched from slackware to ubuntu.

So, I guess it's likely a broken disk. Thanks for confirming dd wouldn't cause this; Data (not Disk) Destroyer. I just bought the usb drive, so I can take it back no problem. After I use smartmontools and whatever I can find from wd to look it over.

Last edited by djeikyb; 09-21-2009 at 07:03 PM.
 
Old 09-22-2009, 11:01 AM   #6
djeikyb
Member
 
Registered: Nov 2005
Location: California
Distribution: ubuntu 10
Posts: 162

Original Poster
Rep: Reputation: 33
Update.. Costco has an amazing return policy.

Me: I think this drive came broken. It gave i/o errors--
Costco: Here's your cash back

Picked up a new one, paid exact change, and the dd copy was much more reasonable:
Code:
root@daedalus:~# dd if=/dev/sda1 of=/dev/sdd1 bs=1G

232+1 records in
232+1 records out
250056705024 bytes (250 GB) copied, 12378.6 s, 20.2 MB/s
 
Old 09-22-2009, 11:31 AM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
I am glad that everything worked as it should in the end.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why does my fstab file keep canceling my changes to it? newbiesforever MEPIS 5 02-08-2008 12:16 PM
Canceling login page at Fedora 5 jonnyhashem Fedora 4 01-09-2008 09:52 AM
Use IOMEGA 250MP Zip Parallel Port Drive on a Windows Guest under a Linux Hose MSwal2846 Linux - Hardware 0 07-31-2006 08:51 AM
2.6.13+ Kernels hose Synaptics Touchpad Archalien Linux - Laptop and Netbook 3 04-24-2006 02:22 AM
Will these commands hose my connection? AWyant Linux - Security 1 10-02-2003 08:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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