Operating System - HP-UX
1834394 Members
1582 Online
110066 Solutions
New Discussion

Re: copying usr and var file systems

 
golfnut
Frequent Advisor

copying usr and var file systems

I have to move usr and var to new disks and mirror them.

What is the best way to copy them keeping all the links and permissions.

I have seen a bunch of options searching for this and many different flags with cpio.

I am used to tar and that has worked well for me on Tru64 UNIX.

tar -cf - * | (cd /the/new/directory; tar -xf -)

If I use cpio, what are the flags that I need to be using. I saw one like below in my searches.

# find .|cpio -pudlmv /destinationdirectory

thanks for your feedback.

2 REPLIES 2
Mic V.
Esteemed Contributor

Re: copying usr and var file systems

Hi,

I've used your tar method many times to do this same thing on various versions of HP-UX with no issues. I generally use a "v" on one of the tar commands, though, so I can tell how far it's gotten and whether it's hung or where an error occurred.

I highly recommend making a backup of /var and /usr before you start (tape and/or another disk; choose your paranoia :-). It should ideally be done in single-user mode; if not, there are things you have to deal with that make it more messy. Personally, I like to make /var (and sometimes /var/adm/sw, /var/spool) into their own filesystems so that I can handle disk space issues in a more independent fashion.

My $.02. HTH,
Mic
What kind of a name is 'Wolverine'?
lawrenzo
Trusted Contributor

Re: copying usr and var file systems

Hello,

Ensure you have a full backup of the system.

# pvmove -n

This will move the physical extends and directory structure to your new disk - lvol? being what ever /usr or /var is.

# lvextent -m 1

see man pages for pvmove and lvextend

HTH
hello