Operating System - HP-UX
1830310 Members
2372 Online
110000 Solutions
New Discussion

Using dd to copy a filesystem

 
SOLVED
Go to solution
Bill Costigan
Honored Contributor

Using dd to copy a filesystem

I would like to use dd to copy a filesystem from one lvol to another.

Will this work and should I use the raw or cooked lvol?

e.g.

dd if=/dev/vg03/rlvol3 of=/dev/vg04/rlvol3 bs=1024K

Thank you in advance.
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Using dd to copy a filesystem

As long as the destination LVOL is at least as large as the source that will work just fine --- and yes, you want the raw (character) device nodes. The filesystem should be unmounted before the dd is run.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Using dd to copy a filesystem

Hi Bill:

Use the raw filesystem and a large blocksize as you have shown for the best performance. There is no sense to invoking the buffer cache by using the cooked device files.

The source and target filesystems should not be mounted during the copy and an 'fsck' afterwards is advisable.

Regards!

...JRF...
Bill Costigan
Honored Contributor

Re: Using dd to copy a filesystem

Thank you both!