Operating System - HP-UX
1835388 Members
2952 Online
110078 Solutions
New Discussion

Re: Can I copy /var from one system to another safely?

 
Ray Humpage
Frequent Advisor

Can I copy /var from one system to another safely?

I have a test system that is built on the identical hardware as my production system. I have a disk error on the test system and /var will not mount. I have tried every variation of fsck and it will not come back clean.

The test system has another drive but for some reason it's not mirrored to it. And the ignite tape for the test box can't currently be located.

I have the ignite tape for the production box.

Now I am wondering if I should use the production ignite tape to ignite onto the the test box and then try to import my test vg's.

Or can I fbackup /var on the production box, do a newfs on /var on the test box and then restore it there from the tape. Once it's restored I can then mirror to the other drive and then use that drive to boot off going forward.

Is there anything system specific in /var that would cause problems?

Ironically all my databases and software are currently up and running on the test system.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: Can I copy /var from one system to another safely?

Hi:

I would use the production Ignite tape as the master from which to clone a new test server.

If you are making your Ignite recovery tapes properly, they contain only vg00 filesystems. Given that, you can rebuilt your test server from the Ignite tape; and then 'vgimport' your non-vg00 test volume groups.

The problem with blindly copying '/var' from the production server is that '/var/adm/sw' holds the IPD (Installed Product Database) information which tracks what patches and what products are installed. Further, the contents of this directory are assumed to be synchronized with the actual files in '/etc', '/usr' and '/opt' including the matching of their modification timestamps and checksums.

Hence, do not try to copy 'var' from one server.

Regards!

...JRF...
Ray Humpage
Frequent Advisor

Re: Can I copy /var from one system to another safely?

I might be in more trouble here than originally imagined. This is not only a test server. After doing some investigation it is a test server and it also serves as a failover server for the production server.

I ran cmviewcl and it's currently marked as failed and is not part of the cluster.

If I rebuild this using the production ignite tape won't I run into problems with overlaying things in /etc.

I know that you said that /var syncs with /opt and other filesystems.

The only thing running on this server as far as software is a CACHE database and Serviceguard.

Should I use ignite or risk the restore?

If I use ignite will I run any risk of importing anything that might make this think it's the production server and cause more problems?
jaivinder
Frequent Advisor

Re: Can I copy /var from one system to another safely?

This is not recommended to copy the /var from other running server. This can put you in trouble because the /var directory basically have the logs and the patch database also. The other server as per you is a production server running a cluster. So it is not recommended to copy the /var from production server. The only option you have is find the Ignite tape and then restore the /var from this tape.
Johnson Punniyalingam
Honored Contributor

Re: Can I copy /var from one system to another safely?

Hi Ray,

do you have free disk space to "create /var2 file system..?

assuming you have free disk space

# lvcreate -L /dev/vg00/lvolx
# mkdir /var
# mount /dev/vg00/lvolx /var2

(perform fbackup)

# cd /var; fbackup -f - -i . | (cd /var2; frecover -f - -r)

(once fbackup has been complted)

reboot the single -user mode

# lvremove /dev/vg00/lvolx --> refers to your old /var file system

# mount /dev/vg00/lvolx /var --> refers to your newly created /var file system

# vi /etc/fstab
comment the old entry for your old /var file system
add a new entry for your new /var file system

# shutdown -ry 0 -> reboot you system

Hope this helps,

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Johnson Punniyalingam
Honored Contributor

Re: Can I copy /var from one system to another safely?

sorry type-oo- error in my "# mkdir /var"

should be # mkdir /var2

Thanks,
Johnson
Problems are common to all, but attitude makes the difference