Operating System - HP-UX
1838483 Members
3204 Online
110126 Solutions
New Discussion

duplicating a file system and it's data

 
SOLVED
Go to solution
Bryan D. Quinn
Respected Contributor

duplicating a file system and it's data

Please forgive me if there is a thread out there that answers this question. I searched for one, but was unable to find.

Here is the situation, I have about 20 /oracle/SID/sapdataX directories mount on seperate file systems. My /oracle /oracle/SID and /oracle/stage directories are also mounted on seperate file systems. I have a need to copy the data from the /oracle /oracle/SID and /oracle/stage file systems to new temporary file systems, which will be mounted up as /oracle /oracle/SID and /oracle/stage when the copy is complete. So, my question is this, what is the best way to copy the data?

for /oracle
/dev/vg02/lvol1 --> /dev/vg03/lvol1

for /oracle/SID
/dev/vg02/lvol2 --> /dev/vg03/lvol2

for /oracle/stage
/dev/vg02/lvol2 --> /dev/vg03/lvol3

I need to make sure I just get the data on these file systems, therefore I cannot do a cp from /oracle --> /oracle_tmp because that will pick up my /oracle/SID/sapdata directories.

Any ideas would be greatly appreciated.

Thanks,
-Bryan
4 REPLIES 4
Sean OB_1
Honored Contributor
Solution

Re: duplicating a file system and it's data

You can copy the lower level mount points first, then unmount them and copy the /oracle mount point.

IE:

/oracle => mountpoint
/oracle/stage => mountpoint

copy /oracle/stage first
then unmount /oracle/stage
now copy /oracle

Bryan D. Quinn
Respected Contributor

Re: duplicating a file system and it's data

Thanks a million Sean!

Something so simple...thanks for straightening me out!

-Bryan
G. Vrijhoeven
Honored Contributor

Re: duplicating a file system and it's data

Hi Bryan,

You can also look at a combination of find with cpio.
I do not have a man pages present but with cd /target
find /oracle -xdept ( something like this, non crossing filesystems) | cpio cv .( other option)


Gideon
Michael Tully
Honored Contributor

Re: duplicating a file system and it's data

This is how I would approach this:

# mount /dev/myvg/mynewlv /copy

# cd /orig_dir
# find . -depth -print | cpio -pdumv /copy

umount /orig_dir
umount /copy
# mount /dev/myvg/mynewlv /orig_dir

Move onto to next directory
Anyone for a Mutiny ?