System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best command to copy file from one system to the other

 
Jeongbae Min
Advisor

What is the best command to copy file from one system to the other

Hello,

I'd like to move HP server from EMC DMX to EMC NS40. When I move file from DMX to NS40, I'd like to us cpio command. What is the right syntax to use it? if it is not good command, what it the best command to use it?

please let me know exact syntax for me.

Thank you in advance,

Jeong
20 REPLIES
Steven E. Protter
Exalted Contributor

Re: What is the best command to copy file from one system to the other

Shalom,

If the arrays can be connected, perhaps to the same fiber network, you should use EMC commands.

If that won't work you should investigate the symclone command that ships with EMC software.

The syntax depends on the relationship between the disks, which hopefully someone has set up on the target server.

You could if both systems present disk to the system at the same time be as simple as cp -rn

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
Jeongbae Min
Advisor

Re: What is the best command to copy file from one system to the other

Hello Steven,

Unfortunately, We can connect two EMC boxes.

Can you provide me other solution?

Thank you for your input.

Jeong
Kapil Jha
Honored Contributor

Re: What is the best command to copy file from one system to the other

do you have both the disks presented on the server then there are a few commands...

cpio,rsync and dd.

If this is a data disk and your application is running rsync is the best I suppose.

If apps is not running dd and cpio is good.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Jeeshan
Honored Contributor

Re: What is the best command to copy file from one system to the other

You can either use Openmigrator

Or

use Vgextend with the new disk of new storage then mirror and finally vgreduce.
a warrior never quits
Prasanth V Aravind
Trusted Contributor

Re: What is the best command to copy file from one system to the other


Mirroring & unmirroring is a gud option , But there are some limits.

When you do mirroring the disks can get very busy & which impacts server performance. Also there is no option for roll back.

I suggest to go for any hostbase data migration tool.

You can go for softek.

Gudluck
Prasanth
Bill Hassell
Honored Contributor

Re: What is the best command to copy file from one system to the other

>> I'd like to us cpio command.

cpio is a good choice as long as you will not be copying files larger than 2GB. The man page warns you about this limitation. The commands would be (after creating an lvol on the new disk array):

# mkdir /newmount
# mount /dev/vgnew/lvolX /newmount
# cd /oldmount
# find . | cpio -pudlmv /newmount

The verify the counts:

find /oldmount -type f | wc -l
find /newmount -type f | wc -l
find /oldmount -type d | wc -l
find /newmount -type d | wc -l

The sizes (reported by du and bdf) for the source and destination will usually not match due to sparse file and directory optimization.


Bill Hassell, sysadmin
R.O.
Esteemed Contributor

Re: What is the best command to copy file from one system to the other

Another option is with fbackup-frecover:

(cd ; fbackup -i . -vf -) | (cd destination; frecover -Xrf -)

But if you have HP-UX 11.31 i think fbackup is no longer supported.

Regard,
"When you look into an abyss, the abyss also looks into you"
James R. Ferguson
Acclaimed Contributor

Re: What is the best command to copy file from one system to the other

Hi:

> R.O. : But if you have HP-UX 11.31 i think fbackup is no longer supported.

That's not true. The 'fbackup'/'frecover' utilities are deprecated in 11.31 but are still available.

Another alternative to everything mentioned thus far is to use 'pax'.

Regards!

...JRF...
R.O.
Esteemed Contributor

Re: What is the best command to copy file from one system to the other

"That's not true. The 'fbackup'/'frecover' utilities are deprecated in 11.31 but are still available."

It's good to know it !!!

Regards,
"When you look into an abyss, the abyss also looks into you"
Bill Hassell
Honored Contributor

Re: What is the best command to copy file from one system to the other

> fbackup no longer supported...

Actually it is more like "no longer recommended". And unfortunately, changes were made to fbackup for 11.31 that affect compatibility with all previous versions of fbackup. I think fbackup is being deprecated in order to push sales for Data Protector. The alternative utilities such as pax, tar and cpio cannot handle ultra-high speed tape drives like the LTO4. fbackup can handle any size file, runs up to 6 separate reader processes to keep the tape drive busy and adds high speed search marks for very fast restores of selected files.

So the fbackup-frecover pair continues to work at 11.31 and would be the fastest file-by-file transfer method with no limits on file size. rsync is also a great choice, especially if you must keep the machine online as long as possible. rsync (after the initial pass) will update only the changed files and directories and can scan millions of files in terabytes of filesystems in just a few minutes when there are just a few differences. rsync is probably not on your system -- get a copy from http://software.hp.com

dd is by far the fastest but requires a little more thought. It is a raw disk copy and with a block size of 1 to 4 MB, can run as fast as the arrays allow. You create lvols on the new array that match the current lvols, being careful to handle the boot disk for vg00 correctly.


Bill Hassell, sysadmin
Jeongbae Min
Advisor

Re: What is the best command to copy file from one system to the other

Hi Bill,

Thank you for your input.

We had files bigger than 2 GByte. then only option is DD.

I don't need to copy root volume group. what should I be careful and what is the exact command to copy files system from one to the other box.

Thank you in advance.
Bill Hassell
Honored Contributor

Re: What is the best command to copy file from one system to the other

> what should I be careful and what is the exact command to copy files system from one to the other box.

The fbackup/frecover given above by R.O. will work just fine. Filesystems simply sit inside an lvol, so if you want the same physical layout, you'll need to create the same volume group(s) and lvol(s) for the destination array. Naturally, the VG name will be different but can be changed later. Or you can rearrange the VG and lvol names and sizes but this assumes you can keep track of everything.

If you use fbackup+frecover, then use newfs for each lvol, then mount them under temporary directories and copy the files. Then verify the file and directory count with find+wc mentioned above.

With dd, you will still create the destination lvols and then for each of the volumes:

dd if=/dev/vg01/lvol1 of=/dev/vgnew01/lvol1 bs=2048k

Repeat for each lvol.

For the dd command, you'll be copying an active mountpoint and therefore the destination will need fsck to clear up incomplete pointers. For both methods, files will change during the copy so you need to understand if some files depend on others (like matching records) and resolve this with your applications -- or run the commands during a quiet maintenance period.


Bill Hassell, sysadmin
bullz
Super Advisor

Re: What is the best command to copy file from one system to the other

rsync command is always the best commnad for taking backup (or) copying files from one directory to other.

i will post the syntax soon.
James R. Ferguson
Acclaimed Contributor

Re: What is the best command to copy file from one system to the other

Hi (again):

> We had files bigger than 2 GByte. then only option is DD.

Not true. 'fbackup'/'frecover' handle largefiles just fine. Too, using 'pax' this can be accommodated also.

Regards!

...JRF...
Jeongbae Min
Advisor

Re: What is the best command to copy file from one system to the other


If I used a commend as below "cp -rp old_mount_point new_mount_point" instead of dd, cpio commands

do you think it has any problems ?
James R. Ferguson
Acclaimed Contributor

Re: What is the best command to copy file from one system to the other

Hi Jeong:

> if I used a commend as below "cp -rp old_mount_point new_mount_point" instead of dd, cpio commands do you think it has any problems ?

Make sure that the 'new_mount_point' doesn't exist when you begin the process. Since 'cp' creates the new directory, the destination directory should not already exist.

You will not preserve sparse files with 'cp'. Instead, they wilk be "un-sparsed".

The use of 'fbackup/frecover' as R.O. noted is a better alternative than 'cp' in my opinion.

Regards!

...JRF...
Jeongbae Min
Advisor

Re: What is the best command to copy file from one system to the other

Hi James,

Can you give me a good syntax for fbackup/fresore command to copy from one storage system to the other?

Thank you in advance

Jeong
James R. Ferguson
Acclaimed Contributor

Re: What is the best command to copy file from one system to the other

Hi (again) Jeong:

If you wish to use 'fbackup'/'frecover' you could do:

# # cd srcdir && fbackup -i . -f - | ( cd dstdir && frecover -Xsrf - )

Regards!

...JRF...
Suraj K Sankari
Honored Contributor

Re: What is the best command to copy file from one system to the other

Hi,
If you satisfied with the answer and your problem got solved then

please make a habit to assign points,
Those people who give there valuable time for your problem they

should expect some apparition from you in terms of points.

To know how to assign points please go through the below link

http://forums13.itrc.hp.com/service/forums/helptips.do?admit=1094476

27+1256027208667+28353475#33

Thanks
Suraj
Suraj K Sankari
Honored Contributor

Re: What is the best command to copy file from one system to the other