1832611 Members
2992 Online
110043 Solutions
New Discussion

Re: cpio vs. rsync

 
samash
Advisor

cpio vs. rsync

We are about to migrate from one SAN to another both filesystems will be mounted local to the host. I was wondering if anyone out there had any expericence with the fast way to copy the data. I was looking at cpio and rsync as options but I am open to others.

Thanks
10 REPLIES 10
Alzhy
Honored Contributor

Re: cpio vs. rsync

Samash - Greetings and Peace Be With You!

First, why would you be doing a migration that appears to be disruptive (i.e. copying filesystems?). Would it not be possible to simply use Mirroring?

But if that is your plan, here are the more efficient ways to do it and how it's done:

Using VXDUMP/VXRESTORE:

vxdump 0f - /oldsanfs | (cd /newsanfs;vxrestore rf -)


Using CPIO:

cd /oldsanfs
find ./ -depth -print | cpio -pdvmu /newsanfs


Be warned though, with CPIO -- if youve very large files (in excess of 2GB) you may have issues with CPIO.. so I suggest you stick with vxdump/vxrestore.

Other options you can use: tar and fbackup.


Cheers.
Hakuna Matata.
Court Campbell
Honored Contributor

Re: cpio vs. rsync

This can be used to copy one filesystem to another:

# cd /src_dir; fbackup â I . â f - | (cd /dest_dir; frecover â Xsrf -)


"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: cpio vs. rsync

# cd /src_dir; fbackup -I . -Â Â f - | (cd /dest_dir; frecover -Xsrf -)
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
samash
Advisor

Re: cpio vs. rsync

So you wouldn't recommend rsync as a possibilty?
James R. Ferguson
Acclaimed Contributor

Re: cpio vs. rsync

Hi:

Another method is to mirror your filesystems onto the "new" SAN. If you can do this, you have the ability to replicate without downtime.

Regards!

...JRF...
Court Campbell
Honored Contributor

Re: cpio vs. rsync

Oh my gosh. the crazy a's should be dashes. Argh.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
samash
Advisor

Re: cpio vs. rsync

Thanks guys. I'm going to look at mirroring as my option.
Jeff_Traigle
Honored Contributor

Re: cpio vs. rsync

rsync isn't a good option for copying files to an empty destination. If you're migrating data to an empty destination, you already know all files need to be copied so the checking rsync does is counterproductive and actually increases the time the transfer takes. This is mentioned somewhere in the rsync man page or FAQ or something, I think.
--
Jeff Traigle
mobidyc
Trusted Contributor

Re: cpio vs. rsync

Hello,

if my memory is good, rsync can handle sparse files.

you could also take a look at pvmove(1M), it can help you.

Regards,
Cedrick Gaillard
Best regards, Cedrick Gaillard
samash
Advisor

Re: cpio vs. rsync

Thanks for clearing up the rsync mystry