LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 10-20-2010, 09:09 AM   #1
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Rep: Reputation: 31
dd - why is this a bad idea? Why is it failing?


I'm duplicating a drive with the following command:

Code:
for i in 0 1 2 3 4 5; do dd if=/dev/dsk/c0t0d0s$i of=/dev/dsk/c0t1d0s$i bs=1024 conv=noerror,sync; done;
However, I'm getting the following:
write: No such device or address
132868+0 records in
132868+0 records out
blah blah blah

Is using DD to make an IDENTICAL copy a bad idea? Can anyone tell me why I'm getting these errors? Is this likely to work once dd completes?
 
Old 10-20-2010, 09:42 AM   #2
Joe of Loath
Member
 
Registered: Dec 2009
Location: Bristol, UK
Distribution: Ubuntu, Debian, Arch.
Posts: 152

Rep: Reputation: 28
EDIT: Didn't read properly...
 
Old 10-20-2010, 10:08 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Are you working on SPARC or x86 hardware ?
Are there mounted partitions on the source disk ?
 
Old 10-20-2010, 10:12 AM   #4
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by jlliagre View Post
Are you working on SPARC or x86 hardware ?
Are there mounted partitions on the source disk ?
SPARC. The source disk is entirely 100% blank, as in straight out of the packaging. I reckon it will work, I've done something similar before and got a perfectly 100% identical drive (this was actually a bad thing as I DD'd 9gb onto a 180gb drive, hehe - it worked though).

Also there aren't any mounted partitions at all, I'm running safe mode off the cd, I think mounting and then running DD is a bad idea. Guess we shall see! It's been going for about 4 hours now and has done 2 slices, both with the error mentioned above.
 
Old 10-20-2010, 10:28 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Did you duplicate the vtoc first (prtvtoc | fmthard) ?
Why aren't you just copying slice 2 which encompass the whole disk ?
 
Old 10-20-2010, 10:43 AM   #6
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Original Poster
Rep: Reputation: 31
I was under the impression the VTOC was on the first slice (slice 0) on the first cylinder and thus would get copied with dd, perhaps I'm wrong though. If slice 2 is the whole disk then this will take twice as long as it should do wont it... Oops! Should I just miss out the 2 in my if statement and start over? These "no such device or address" errors, are they anything to worry about? Do you think this will work once complete?
 
Old 10-20-2010, 11:04 AM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by genderbender View Post
I was under the impression the VTOC was on the first slice (slice 0) on the first cylinder and thus would get copied with dd, perhaps I'm wrong though.
Indeed. The vtoc isn't in slice 0, slice 0 isn't including the first cylinder, slice 2 does. Outside slice 2 which overlap the whole disk, remaining slices aren't necessarily numbered the way they are ordered.
Quote:
If slice 2 is the whole disk then this will take twice as long as it should do wont it...
Indeed.
Quote:
Oops! Should I just miss out the 2 in my if statement and start over?
Better dd'ing only slice 2.
Quote:
These "no such device or address" errors, are they anything to worry about?
They is certainly something to worry about with such errors. Probably due to the wrong vtoc on the target device.
Quote:
Do you think this will work once complete?
I'm quite skeptical.
 
1 members found this post helpful.
Old 10-20-2010, 11:40 AM   #8
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Original Poster
Rep: Reputation: 31
I've just been reading through the following webpage (here) which does exactly as you suggest, just dd the second slice. I don't think this process will fail but it will take significantly longer than it should do. The author even suggests duplicating the second slice in the first paragraph, so I'm pretty confident this will work.

I've got a few servers to do, so on my second server I'll make sure I do as both you and the author have suggested and just dd the second slice.

Thanks for your help, I'll mark this page as complete tomorrow if it finishes properly. I think the errors are either due to slices being used for swap (possible) or slices not existing on the new disk (also possible) rather than actual problems with the process.
 
Old 10-20-2010, 11:51 AM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by genderbender View Post
The author even suggests duplicating the second slice in the first paragraph, so I'm pretty confident this will work.
Your process will fail if slices 3 to 7 exist on the target drive and aren't located exactly where their source are.
Quote:
I think the errors are either due to slices being used for swap (possible) or slices not existing on the new disk (also possible) rather than actual problems with the process.
This is a write error so I hope you aren't writing to an active swap partition, which might lead to various crashes up to kernel panics. Nonexistent slices are more likely. Next time, use a larger block size than 1024. Such a low value explains why it is so slow now.
 
1 members found this post helpful.
Old 10-20-2010, 12:16 PM   #10
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Original Poster
Rep: Reputation: 31
Running this:
dd if=/dev/dsk/c0t0d0s2 of=/dev/dsk/c0t1d0s2 bs=2048 conv=noerror,notrunc

No errors I think using sync was a bad idea, I didn't and still don't really understand what conv=sync does, but it's got rid of the errors. When googling sync I've seen it used numerous times when duplicating DVDs/CDs.

I'll leave this running over night and let you know how I get on tomorrow.

Thanks for your help.

Last edited by genderbender; 10-21-2010 at 04:39 AM.
 
Old 10-21-2010, 06:14 AM   #11
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Original Poster
Rep: Reputation: 31
Any other ideas on how to do this? It's taking a loooong time to copy a 9gig drive, the systems a 220R and is VERY low spec but it's still taking a stupidly long ammount of time.
 
Old 10-21-2010, 06:36 AM   #12
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
How long is "a loooong time" ?
What data r/w rate are you observing (eg: what says "iostat -xntc 5 5")?
 
Old 10-21-2010, 06:40 AM   #13
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by jlliagre View Post
How long is "a loooong time" ?
What data r/w rate are you observing (eg: what says "iostat -xntc 5 5")?
Well it's a 9gb disk and has been going for around 3 hours or so, as this is single user mode I can't issue commands to check on the status. I left it running overnight but it was still in the same state in the morning so restarted with a higher block size? Should this be /dev/dsk and not /dev/rdsk? I'm happy to leave it running for longer, but if there's a reason it's taking so long then I'd like to eliminate it, otherwise I can just wait for it to complete.
 
Old 10-21-2010, 09:27 AM   #14
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Why don't you launch the dd in the background or put it there with ^Z + bg ?
That will give you a chance to investigate where the bottleneck is. I would expect copying 9 GB to take minutes, not hours or days. Stay with rdsk which should be faster than dsk as the cache is bypassed.
 
Old 10-22-2010, 04:38 AM   #15
Mikoman
LQ Newbie
 
Registered: Sep 2010
Posts: 5

Rep: Reputation: 0
try bigger block size. bs=128k or 256k that should speed up the process.
 
  


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
Not merely a bad idea...a dangerous one... jiml8 General 8 06-04-2010 07:59 AM
Good idea/bad idea: interface colors introuble General 5 10-30-2006 02:33 PM
Bad Idea dudeman41465 Linux - Software 1 10-10-2005 03:37 AM
is this a bad idea ? fileserver/firewall... epoo Linux - Security 8 05-07-2005 03:44 PM
Is this a good or bad idea? kemplej Linux - Software 2 10-26-2004 10:34 AM


All times are GMT -5. The time now is 03:06 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration