Operating System - HP-UX
1829048 Members
2680 Online
109986 Solutions
New Discussion

possible to make_sys_image without backing up /home?

 
SOLVED
Go to solution
jh_yang
Advisor

possible to make_sys_image without backing up /home?

We are trying to build a golden image using make_sys_image. The source server has a huge /home file system located outside of vg00. Considering the side of /home, we'd like to exclude /home from the golden image. so:

1) We tried with default and hoping make_sys_image won't pick up /home since it's not part of vg00, but it included it.

2) Then we created excluded file and use -f option trying to exclude it, but it included it again.

Is /home a must to have file system to create the golden image? Is there a way to get around with it?


Thanks,
David
9 REPLIES 9
Dave Johnson_1
Super Advisor

Re: possible to make_sys_image without backing up /home?

Not sure if including /home is forced or not. If the system is not being used, you might be able to unmount /home while you make the image. If there are some directories under /home you want as part of the image, make a new lvol mount it as /home2, copy what you want, umount /home and /home2, then mount new fs as /home and make the image.
jh_yang
Advisor

Re: possible to make_sys_image without backing up /home?

We've considered this option, but seems too much trouble. (We don't have console connection and SSH to root has been disabled too). Any other easy way? Wondering if the following line in exclude_file will work or not. Please comment.

+NO_ARCHIVE
/home/*

or

+NO_ARCHIVE
/home/user1
/home/user2
.
.
.
/home/userN
jh_yang
Advisor

Re: possible to make_sys_image without backing up /home?

I should make myself a little bit clear: the 2nd try we ran is using the following lines in excluded_file and it doesn't work:

+NO_ARCHIVE
/home
TwoProc
Honored Contributor

Re: possible to make_sys_image without backing up /home?

Just a hunch,

*try* commenting out /home from /etc/fstab

-> don't unmount /home!

and then run your command, and see if it works.

If the command is checking /etc/fstab (and a lot of things do), then it might just work.

Don't forget to put it back!

We are the people our parents warned us about --Jimmy Buffett
jh_yang
Advisor

Re: possible to make_sys_image without backing up /home?

Thanks for this suggestion. But I don't have the window to test it, I'd like to be sure about the solution.
TwoProc
Honored Contributor

Re: possible to make_sys_image without backing up /home?

Commenting a file system out of /etc/fstab doesn't "do" anything, unless you're mounting and unmounting file systems. It won't affect a running, mounted file system at all to comment it out /etc/fstab. You just want it back in there so that it can remount automatically, or manually with all of the correct command line options,etc.

So, when you run the make_sys_image command, if the /home directory is *not* backed up, the command "worked". All you have to do then, is just uncomment the line for the /home directory. No harm, no foul.

If you get my meaning: in between mounting a file system, and unmounting a file system, the /etc/fstab entry for /home isn't doing anything, and has nothing to do with whether or not that file system is in use, available, etc.

However, some commands (for example, possibly make_sys_image) may read /etc/fstab
to figure out what to save. If so, commenting it out of /etc/fstab may work for you. However, it may not - it may get its list of what to back up from other methods (lots of ways to get that info), and commenting it out won't have any effect on your problem, or be even remotely helpful.

Anyways, that's why I suggested it - as it has no more risk to it than running your command (make_sys_image) like now. Only if you forget to uncomment when you're done would you notice a difference (like next time you reboot - you'd have to manually mount /home because the OS would miss it). Even that's not a disaster, because all you'd do is uncomment it from the /etc/fstab file and type "mount /home" as root before you start running things and letting users on. Still, not a big deal.

Oh well, do as you wish, it was a remote chance for success anyways. Good luck.
We are the people our parents warned us about --Jimmy Buffett
Jim Walls
Trusted Contributor
Solution

Re: possible to make_sys_image without backing up /home?

We use the following syntax in the exclusions file for making golden images.

+ ONLY NO_ARCHIVE
/home/*


...plus lines for any other directories and/or files to be excluded


jh_yang
Advisor

Re: possible to make_sys_image without backing up /home?

To TwoProc:
since HP suggests minimum server usage while running make_sys_image, we have to shutdown all the applications before hand. That's what I mean I don't have the window to run the test. I just can't ask for more windows to run the test on this production server. If your suggestion doesn't work, I waste another valuable server outage window and it's hard to explain to the manager. I know we should have a test/dev server, but the reality is we don't.

thanks
jh_yang
Advisor

Re: possible to make_sys_image without backing up /home?

Problem solved. I think the ONLY keyword made the trick, but I am not sure. I was thinking make_sys_image only archives the content of vg00, but it turns out to be everything except those listed in the exclusion file. Can anybody confirm it?