1827696 Members
3136 Online
109967 Solutions
New Discussion

Copying a Filesystem

 
SOLVED
Go to solution
Joe Redman
Advisor

Copying a Filesystem

I have a 24GB filesystem that I need to copy to another device. I have used cpio, tar, and dd in the past to copy a filesystem from one device to another. Extent size is 1024. Runnin HP-UX 11.0 on a 8-way N-class with 10GB memory. I was wondering if anybody can tell me the quickest way to accomplish this copy. I am testing with dd but, am wondering if I am setting all the correct switches to minimize time.

Any assistance would be appreciated.

Peace!
Joe
Peace
12 REPLIES 12
Victor BERRIDGE
Honored Contributor

Re: Copying a Filesystem

Faster would be making a mirror copy of that lvm, only mirro-ux is a not free option...
and only works if I remember right within a same volume group...
then dd, then cpio...

All the best

Victor
harry d brown jr
Honored Contributor

Re: Copying a Filesystem

cp -rp

The problem with dd is that you could be copying bad track info.

live free or die
harry
Live Free or Die

Re: Copying a Filesystem

Well I wouldn't expect dd to be the quickest as it will merrily copy all the empty space on you file system as well. tar & cpio should do the job fine - you might also want to look at volcopy

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Darrell Allen
Honored Contributor
Solution

Re: Copying a Filesystem

Hi Joe,

$ cd /source_dir
$ find . | cpio -pudlm /destination_dir

I formerly used tar until a post by Bill Hassell taught me that cpio is much faster.

Darrell

"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
G. Vrijhoeven
Honored Contributor

Re: Copying a Filesystem

Hi,

i should use fbackup / frecover.

Hope this will help,

Gideon
James R. Ferguson
Acclaimed Contributor

Re: Copying a Filesystem

Hi Joe:

I always use 'cpio' and the options to preserve file permissions and modification timestamps:

# cd myolddir
# find . -depth -print|cpio -pudlmv mynewdir

Regards!

...JRF...
Jeff Machols
Esteemed Contributor

Re: Copying a Filesystem

If you are using dd, make sure you use the raw device for the disks (/dev/rdsk/c1t1d0). you can also change the blocksize with the -bs option, the default is 512, you can go way higher than that
Sanjay_6
Honored Contributor

Re: Copying a Filesystem

Roger Baptiste
Honored Contributor

Re: Copying a Filesystem

hi joe,

I use the find & Cpio combination for Copy.
Works as you want it and is fast too.

#cd olddir
find . -depth -print|cpio -pdlmv $newdir

-> You can remember this command by a simple trick. The words pdlmv -> paddlemove!

HTH
raj
Take it easy.
Darrell Allen
Honored Contributor

Re: Copying a Filesystem

Hi again Joe,

Notice I omitted the "v" option for cpio. It will run faster without verbose output, especially if displaying on a terminal (like a 9600 baud console).

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
fg_1
Trusted Contributor

Re: Copying a Filesystem

Joe

Your configuration should not present a problem as far as speed of this copy. Follow the steps below to safely accomplish your task:

1) Ensure that the device you are copying to has the same characteristics as the drive you are copying from.

2) Create the area you are copying to with the same parameters that you used on the original.

3) cd /source_dir

4) find . | cpio -pudlm /destination_dir (the raw partition if it's a raw device)

Good luck.

Helen French
Honored Contributor

Re: Copying a Filesystem

hey,

I would suggest u to do this:

# cd source_dir
# find . -depth -print | cpio -pdlmuva dest_dir

HTH,
Shiju
Life is a promise, fulfill it!