1833756 Members
2547 Online
110063 Solutions
New Discussion

Re: unix newby dd issue

 
SOLVED
Go to solution
ABC Inc
Advisor

unix newby dd issue

HPUX 10.20 B2600 workstation. HP 36gb on PO and Seagate 36gb on P1 bothe scsi.

Mount command by itself gives

10/0/15/0.6.0 disk HP 36 etc
10/0/15/0.5.0 disk Seagate 36 etc

I formated the dd command as:

dd if=10/0/15/0.6.0 of=10/0/15/0.5.0

but I receive an error that dd can't find 10/0/15/0.6.0

Please help.

Thanks

Dave
21 REPLIES 21
Torsten.
Acclaimed Contributor

Re: unix newby dd issue

The "if" is "input file", but 10/0/15/0.6.0 is a path, not a file.

Use ioscan to find the device file, e.g. /dev/rdsk/c1t2d0

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Suraj K Sankari
Honored Contributor

Re: unix newby dd issue

HI,

Did you tried with physical path.

dd if=/dev/dsk/cXtXdX of=/dev/dsk/cXtXdX

Suraj
ABC Inc
Advisor

Re: unix newby dd issue

When I run ioscan I don't see the file like that. What is the best way to run ioscan?
Torsten.
Acclaimed Contributor

Re: unix newby dd issue

# ioscan -fn

or

# ioscan -fnCdisk

or

# ioscan -fnkCdisk

or

# ioscan -fnH10/0/15/0

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Steven E. Protter
Exalted Contributor

Re: unix newby dd issue

Shalom Dave,

I think ioscan -fnCdisk

Is best.

I/O path's not being files will not work with dd

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
ABC Inc
Advisor

Re: unix newby dd issue

Thanks everyone. I will try these and let you know in 2 hours of so.

Dave
Torsten.
Acclaimed Contributor

Re: unix newby dd issue

If you consider to "clone" the boot disk, disk with ID 5 must have ID 6 in order to boot (without modification), so you need to swap these disks.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
ABC Inc
Advisor

Re: unix newby dd issue

The current boot disk is id 6. I will swap them when id 6 fails or I want to replace it.

Thanks
ABC Inc
Advisor

Re: unix newby dd issue

dd if=/dev/dsk/c2t6d0 of=/dev/dsk/c2t5d0 worked.

Thanks Guys.

Now I just have to figure how to schedule this to happen every Sunday at 3am in the background. That is when no one has used the workstation since Friday.

Thanks

Dave
Bill Hassell
Honored Contributor
Solution

Re: unix newby dd issue

> dd if=/dev/dsk/c2t6d0 of=/dev/dsk/c2t5d0 worked.

Very, very slowly. Without the bs option, it will take 3-4 times longer since each read/write is only 512 bytes. Add bs=1024k to the end of the line:

dd if=/dev/dsk/c2t6d0 of=/dev/dsk/c2t5d0 bs=1024k


Bill Hassell, sysadmin
ABC Inc
Advisor

Re: unix newby dd issue

how about bs=32768k. I have plenty of memory
James R. Ferguson
Acclaimed Contributor

Re: unix newby dd issue

Hi Dave:

> dd if=/dev/dsk/c2t6d0 of=/dev/dsk/c2t5d0 worked.

And you can improve its performance not only by increasing the block size as Bill noted, but by using the *raw* device file. This bypasses the UNIX buffer cache which is a pure waste in this operation. Use:

# dd if=/dev/rdsk/c2t6d0 of=/dev/rdsk/c2t5d0 bs=1024k

Note the raw ('rdsk') devices.

Regards!

...JRF...
ABC Inc
Advisor

Re: unix newby dd issue

OK, thanks. But how about using bs=32768k? Also, what about scheduling it to run in the background?
James R. Ferguson
Acclaimed Contributor

Re: unix newby dd issue

Hi (again) Dave:

> # dd if=/dev/rdsk/c2t6d0 of=/dev/rdsk/c2t5d0 bs=1024k

Note the raw ('rdsk') devices.

Regards!

...JRF...
ABC Inc
Feb 3, 2010 22:28:04 GMT N/A: Question Author
> OK, thanks. But how about using bs=32768k? Also, what about scheduling it to run in the background?

I seem to recall that 1024k is an optimal upper bound.

As for running in the background, simply do:

# nohup dd if=/dev/rdsk/c2t6d0 of=/dev/rdsk/c2t5d0 bs=1024k &

Regards!

...JRF...
ABC Inc
Advisor

Re: unix newby dd issue

I mean background as scheduled for Sunday morning.

Thanks

Dave
Bill Hassell
Honored Contributor

Re: unix newby dd issue

> 1024K versus 32768K

Empirical testing shows that the speed increase begins to fall off at 1 MB records (1024K). It's not the RAM that is the issue, it is the disk and drivers. Some kernel subsystems will break up ultra long records (like 32 MB) into 1 or 2 MB chunks. I your case, you have a slow workstation with slow internal disks running an OS that was obsolete 10 years ago.

You can certainly do some testing with smaller data chunks by limiting the block count (count=100) and then varying the bs size.


Bill Hassell, sysadmin
James R. Ferguson
Acclaimed Contributor

Re: unix newby dd issue

Hi (again) Dave:

> I mean background as scheduled for Sunday morning.

Then 'cron' the process:

0 1 * * 0 dd if=/dev/rdsk/c2t6d0 of=/dev/rdsk/c2t5d0 bs=1024k

See the 'crontab' manpages. The above would run at 0100 hours every Sunday. You will get a mail to your account with the record count when it finishes.

Regards!

...JRF...
ABC Inc
Advisor

Re: unix newby dd issue

Thanks JRF. Yesterday I started the dd without the bs option. It is still running. The LCD on the 2600 workstation has a verticle bar then a right hand arrow, then want looks like a hardr drive then a heart.

The right arrow and the heart are blinking.

How long should it take on a 36.4 gb scsi drive?

Can I reboot the system or how do I stop it or should I stop it?

Thanks again

Dave
James R. Ferguson
Acclaimed Contributor

Re: unix newby dd issue

Hi Dave:

> Yesterday I started the dd without the bs option. It is still running. How long should it take on a 36.4 gb scsi drive?

I'm not surprised that with a default block size of 512 bytes it is still going.

Find the process (pid) and kill it. If it is running in the background of your current session, do 'jobs' and then 'kill %n' where 'n' is the number in square brackets at the very left of the line describing the process.

If the process is running in the foreground, type 'CTL+C' to kill it. Otherwise:

# UNIX95= ps -C dd -opid= | xargs kill -9

Regards!

...JRF...
ABC Inc
Advisor

Re: unix newby dd issue

I tried ctrl + C at the same time but still running.

Thanks
ABC Inc
Advisor

Re: unix newby dd issue

Thanks everyone. With the right dd command using rdsk and bs=1024k the whole copy took less than 1 hour.

Now I will put in the cron job and be finished.

Thanks again.

Dave