Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dd question.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
First my history, I have two disks of equal size in my E450. I am running on one disk and the other I want to use as a spare. I am currently doing a ufsdump/ufsrestore (via crontab) but was told that dd is better because I don't have to install a bootblk like I do with ufsrestore and everything should be good to go on startup. So here is my question, if I were to do a dd if=/dev/dsk/c0t0d0s2 of=/dev/dsk/c0t1d0s2 would that copy everything over? If not what do I need to do?
 
I would use this command dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 bs=1024k

bs =block size in kilo dependent upon your virtual memory on the system. biiger blocks faster the dd. must be a multiple of 512.

Use rdsk instead of dsk.
 
that should do it!

keep in mind that this will take a while to finish, and you won't get a prompt again until it's done (unless following the command with the "&"). Jarod, The Lab Guy
[morning]
 
doesn't the rdsk and dsk depend on your system?

Jarod, The Lab Guy
[morning]
 
I cron this to copy my OS each night

cat /usr/local/bin/oscopy

#!/bin/sh
#
/usr/bin/dd if=/dev/dsk/c2t1d0s0 of=/dev/dsk/c2t2d0s0
/usr/bin/dd if=/dev/dsk/c2t1d0s6 of=/dev/dsk/c2t2d0s6
/usr/bin/dd if=/dev/dsk/c2t1d0s1 of=/dev/dsk/c2t2d0s1
/usr/bin/dd if=/dev/dsk/c2t1d0s5 of=/dev/dsk/c2t2d0s5
fsck -y /dev/dsk/c2t2d0s0
fsck -y /dev/dsk/c2t2d0s6
fsck -y /dev/dsk/c2t2d0s1
fsck -y /dev/dsk/c2t2d0s5 I tried to remain child-like, all I acheived was childish.
 
rdsk = raw disk will copy bit for bit where dsk will read it in blocks.

(had to look that one up) Jarod, The Lab Guy
[morning]
 
I was wondering if I needed to do the dd for each slice or if I could just be lazy and do it for slice 2 since its the whole disk. It seems that Jimbo is doing it individually which would lead me to believe that it the correct method. Thanks for all the feedback.
 
yes, you can do s2 instead of each individually. Jarod, The Lab Guy
[morning]
 
I do slices as my swap is on both disks, and I do not wish to overwrite one swap with the other I tried to remain child-like, all I acheived was childish.
 
I kicked off the dd yesterday and 13 hours later it is still running. Here's the syntax:

dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2

They are 18gb disks but 13 hours is way too long. Is this normal? I didn't add the bs=1024k. Would that account for the length of time? I'm going to try the slice by slice method next but it seems to me that ufsdump/restore is a lot faster.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top