1836743 Members
2900 Online
110109 Solutions
New Discussion

Re: copy prblm

 
dhanish
Regular Advisor

copy prblm

hi,
i want to copy one full file sysytem data say /fs1 (/dev/vg00/lvol5)from machine hp1 to machine hp2 on filesystem /fs2(/dev/vg01/lvol6).So what options i can use..
i thoght of
cd /fs2 on machine hp1
then
hp1>>cd /fs2
hp1:/fs2>>tar -cvf- . |remsh hp2 dd of=/dev/vg01/lovol6

eill this work
2200110034
Never Say Die
8 REPLIES 8
Vincenzo Restuccia
Honored Contributor

Re: copy prblm

hp1:/fs2>>tar cvf arch.tar *
#rcp hp2:/path /fs2/arch.tar

Herve BRANGIER
Respected Contributor

Re: copy prblm

Hi,

Just an idea, but I think that you can use
remote copy :
cd /fs1
rcp -r * hp2:/fs2

Also, you can try something like

cd /fs1
tar cvf - . | remsh hp2 -l root "cd /fs2 ; tar xvf -"
(you need a .rhost)

HTH

Herv?

federico_3
Honored Contributor

Re: copy prblm

i'd do like the following:

cd /fs1 on machine hp1
tar cf . | remsh hp2 "cd /fs2 && tar xf -"

On hp2 in your $HOME/.rhosts insert:
hp1 your-account

Federico
Bill McNAMARA_1
Honored Contributor

Re: copy prblm

Herv?s suggestion will work, your example wont.
rcp will work once the .rhosts is configured and the hostname can be looked up.

Bill
It works for me (tm)
Sachin Patel
Honored Contributor

Re: copy prblm

Hi
I will say use rdist command. It will keeps all your permissions and ownership unchanged.


# RDist File
# Run as:
# rdist -f filename
#
# To test RDist file:
# rdist -n -f filename
#
# To run on selected hosts:
# rdist -f filename -m host1 -m host2 ....
#
HOSTS = (
remotehost
)

FILES = (
/fs2
)

${FILES} -> ${HOSTS}
install -i -h -R /fs2;



Sachin
Is photography a hobby or another way to spend $
Shahul
Esteemed Contributor

Re: copy prblm


Hi

U have got a number of solution. OK, Good. But I am asking that why don't U try through NFS. I will list out the procedure.

U have HP1 system with fs1 file system and HP2 server with fs2 file system.

U want to transfer fs1 data of HP1 to fs2 of HP2.

First in HP1.

IF NFS server service is not running
#cd /etc
#cd rc.config.d
#vi nfsconf

Change the value of NFS-SERVER variable to 1

make sure that both machines are pinging each other by using host name. If not do changes in /etc/hosts file.

#cd /sbin/init.d
#./nfs.server start
#exportfs -o root=HP2 -i /fs1 (see man page of exportfs)
#exportfs (now it should show /fs1 in list)

Now go to HP2

Check up nfsclient service is running or not.
If not
#cd /etc/rc.config.d
#nfsconf

Change the value NFS_CLIENT variable to 1

#cd /sbin/init.d
#nfs.client start
#cd /
#mkdir /HP1fs1
#mount hp1:/fs1 /HP1fs1
#cd HP1fs1
#find . -xdev -depth -print | cpio -pxdm /fs2

U can use cp -r command also, as ur wish.


Best of luck

Shahul

Magdi KAMAL
Respected Contributor

Re: copy prblm

Hi nitin,

consider S1 and S2 (server one and two ) and you want to copy the entire file system /fs1 from S1 to S2, do the following :


1. Login into S2 server.
2. Edit the $HOME/.rhosts and put in it a line like the following for example:

S1 root

3. This allow root user to execute remote commands from server S1 on server S2.

4. Log to S1 and execute on server S1 the following command :

rcp -rp /fs1 S2:/

this will create directory /fs1 (and all its subdirectories) on S2 with the same ownership, last modification date and time.


Ajitkumar Rane
Trusted Contributor

Re: copy prblm

Hi,
If you r using rcp -pr or find to copy you should check the .* files are copied to the destination. I have encountered the problem with both rcp and find while x'fering files within system and to remote system.

Goodluck.
Amidsts difficulties lie opportunities