Operating System - HP-UX
1832979 Members
3432 Online
110048 Solutions
New Discussion

dd script to copy boot disk

 
SOLVED
Go to solution
David Owens_1
Advisor

dd script to copy boot disk

Just to add even more integrity to my system, I plan to do a raw disk copy of my boot disk using dd. My question is regarding block size. I will be trying the following:

dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=1024k

This works fine on other servers that have 4.3 GB and 9 GB disks. My concern is will this be a problem on a 36 GB disk or does it even matter? When running diskinfo the sector size 512 bytes.

Thanks in advance,
David Owens
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: dd script to copy boot disk

Hi David:

Overall disk capacity doesn't matter. What matters is that you copy data in integer multiples of the disk sector size.

Regards!

...JRF...
Pete Randall
Outstanding Contributor

Re: dd script to copy boot disk

David,

You might even try raising the bs value to 2048k or 4096k, just to see if it improves the performance but, in any case, you should be fine. Just make sure you use the raw device.


Pete

Pete
Helen French
Honored Contributor

Re: dd script to copy boot disk

The main thing is you have to use raw device files. The block size doesn't matter as long as you use a multiple of the secor size (which is 512). You can try different block sizes and choose the best one that suites for you.
Life is a promise, fulfill it!
A. Clay Stephenson
Acclaimed Contributor

Re: dd script to copy boot disk

As long as the source/dest disks are the same capacity and you use a blocksize that is a multiple of 512 then the copy will succeed. If you are doing this "online" then you want the copy to be as fast as possible to minimize the changes/corruption of the destination filesystem(s). Typically, I find that bs=4000k is a good overall value. The OS will divide this operation into smaller chunks anyway.

If you do need to boot from this disk, be prepared for fsck's. They are completely normal and expected as the filesystems were not umounted and marked "clean". I've never had one of these fail to boot.

The best advice that I can give you is to choose time when the system is quiescent as possible; for me that's 0300 on Sundays.
If it ain't broke, I can fix that.