1847897 Members
3428 Online
104021 Solutions
New Discussion

CPIO to a mount point

 
SOLVED
Go to solution
yizhi wang
Occasional Contributor

CPIO to a mount point

Hello all,

I am trying to use CPIO to transfer some file systems from one system to another. I hope some of you could shed some light on it.

At the source server, I run,
cd /
find ./ -print | cpio -ocvB > /dev/rmt/0m

At the destination server, I run,

cd /
cpio -icvBdum abc/* < /dev/rmt/0m

"/abc" is a mount point for a file system. I made sure the root has right to write to "/abc".

After waiting for a few hours, I got nothing but "abc/lost+found".

However, if I run,
cd /abc
cpio -icvBdum abc/* < /dev/rmt/0m

I got all th files under "/abc/abc". I have to run "mv /abc/abc/* /abc" to get the files into the right place.
Since I have many file systems to transfer, I would like to be able to run command such as,

cpio -icvBdum abc/* abd/* abe/* ... < /dev/rmt/0m

Please advise.
Thanks.

Yizhi




4 REPLIES 4
Rick Garland
Honored Contributor
Solution

Re: CPIO to a mount point

Are you able to establish a NFS mount?

If so, mount the filesystem from the new system onto the old system.

Using CPIO,
# cd
# find . -depth | cpio -pmuldv

No need to swap tapes and you retain the permissions and owners (assuming the owners exist on the new system as well).



Rodney Hills
Honored Contributor

Re: CPIO to a mount point

Try-

cpio -icvBdum ./abc
Since the path names you fed to cpio begin with "./".

FYI- don't use "abc/*" on a command line since it will try to expand "*" to matching file names on the CURRENT directory- Not what is on the tape...

HTH

-- Rod Hills
There be dragons...
Robert-Jan Goossens
Honored Contributor

Re: CPIO to a mount point

Hi Yizhi,

Are both servers on the same network ?

Then you could use cpio between both systems.

# find /source | cpio -ov | remsh other_server " cd /target ; cpio -idvum "

Regards,
Robert-Jan
yizhi wang
Occasional Contributor

Re: CPIO to a mount point

Thanks to all your suggestions.
I trird the NFS idea Rick suggested. However, some of the files can not be read by the root at the new server, because these files are only accessible to the owner and the group.

Any ideas?

Best regrads.
yizhi