Solved [Solved] Cannot dd between two USB hard drives

I am trying to clone two USB drives with dd(). Using this command:

Code:
dd if=/dev/da0 of=/dev/da1

I get the error /dev/da1 invalid argument

Trying to use if=/dev/zero gives the same error.

Thanks,
thewoose
 
Re: Cannot dd between two USB hard drives

thewoose said:
I am trying to clone two USB drives with dd. Using this command:

Code:
dd if=/dev/da0 of=/dev/da1

I get the error "/dev/da1 invalid argument"

Trying to use if=/dev/zero gives the same error.

Thanks,
thewoose
Greetings, @thewoose.
I'm guessing there are already partitions/slices,... on (at least) one of the SSd's.
What version of FreeBSD are you running?
What's the output from ls /dev | grep da?
gpart() show da0, as well as gpart list da0, will tell you what is seen on either da0, or when run against da1, will also possibly provide some clues. But possibly the easiest, would be the output from ls /dev | grep da. As you will see what FreeBSD sees on those USB disks (SSD's), as da0s1, da0s1a, etc.

--Chris
 
Last edited by a moderator:
Re: Cannot dd between two USB hard drives

Chris_H said:
I'm guessing there are already partitions/slices,... on (at least) one of the SSd's.
I don't think that really matters, you can write to the device at any time. You may need to force the system to re-read the partition table when it's done though. But dd(1) shouldn't complain. One thing I can think of is that /dev/da1 doesn't exist. Maybe it has a different name?
 
Re: Cannot dd between two USB hard drives

SirDice said:
Chris_H said:
I'm guessing there are already partitions/slices,... on (at least) one of the SSd's.
I don't think that really matters, you can write to the device at any time. You may need to force the system to re-read the partition table when it's done though. But dd(1) shouldn't complain. One thing I can think of is that /dev/da1 doesn't exist. Maybe it has a different name?
Right you are. I hadn't it through, far enough, before replying. :p
One thing I wished I had asked; is whether either of them were already mount()ed.

--Chris
 
Re: Cannot dd between two USB hard drives

Thanks for your responses!

The output of
Code:
ls /dev/ | grep da
is:

Code:
ls /dev | grep da
ada0
da0
da0p1
da0p2
da0p3
da1
da1p1
da1p2
da1p3

So there is a da0 and da1 ... I want to fully clone the drives though instead of slices. For some reason dd throws and error when I try to do this. Weird. And by the way I'm running FreeBSD 10.0 on ZFS.

-thewoose
 
Re: Cannot dd between two USB hard drives

Ahh. OK. Well, seems a new question then. So, if I understand you correctly; you want to clone (them?).
'Fraid I don't quite follow. So to help clarify; you want to clone both of them? Or you want to clone one of them, to the other? ...
I think you get the point. :) Could you please elaborate a bit further?

Thanks.

--Chris
 
Re: Cannot dd between two USB hard drives

Wonder what happened to the response I just posted to this thread...

Short form: dd(1) is bad at this. Don't ever use it to copy to an SSD.
If you must use dd(1) to copy, give it a buffer so it won't take forever: dd if=/dev/da0 of=/dev/da1 bs=128k
But that is a bad solution. See Backup Options For FreeBSD.
 
Re: Cannot dd between two USB hard drives

Sorry I wasn't clear about what I was doing. Using dd to clone drives is a bad idea, and didn't work for some reason anyway. I decided to use rsync which worked much better.

Thanks for your help.

-thewoose
 
Re: Cannot dd between two USB hard drives

Just to add some more into this in case some curious mind wants to try this - it can also be the case that the devices refuse to work with the default size dd uses. You can not, for example, copy a DVD raw image that way from the drive itself.
 
Re: Cannot dd between two USB hard drives

I've never used it myself but sysutils/clonehdd looks like a better tool for the job if you want to "clone" harddisks.
 
Back
Top