Operating System - HP-UX
1832890 Members
2268 Online
110048 Solutions
New Discussion

Would you do this? - Script in Single User Mode

 
SOLVED
Go to solution
Greg Stark_1
Frequent Advisor

Would you do this? - Script in Single User Mode

Here is the lovely situation I'm in:
-Server: D270 - HP-UX 11.00
-No Online JFS
-No Web Console
-No local I/T or technical peope of any kind

Here's what I need to do:
-Install latest patches by EOM

Here's the problem:
-Analysis failed becuase both /var and /usr need to be increased.

What seems more risky, trying to walk a steel mill employee over the phone how to boot to single user mode and increase these filesystem, or, try to write a script for a steel mill employee to run once in single user mode to increase the filesystems?

Is it even possible to write a script to increase /var and /usr?

Thanks again,
Greg
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: Would you do this? - Script in Single User Mode

Greg.

If you're really, really lucky and have some spare room available in vg00, create a /newvar and /newusr (perhaps one at a time), copy the contents of /var into /newvar and the contents of /usr into /newusr, switch the /etc/fstab entries and reboot.

Pete

Pete
Pete Randall
Outstanding Contributor

Re: Would you do this? - Script in Single User Mode

If you're not really, really lucky, I vote for the script. Test it out as much as you can and say a prayer (or two).

Pete

Pete
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Would you do this? - Script in Single User Mode

It's certainly possible to write such a script but you must take extreme care to only use commands that are available in /sbin. These commands are all statically linked and thus will not need shared libraries from /usr.

Once you verified the LVOL's that you wish to extend, all you need are lvextend and extendfs - both of which are in /sbin. You obviously can only run /sbin/sh and you need to make certain that you install your script in /.
If it ain't broke, I can fix that.
Chris Wong
Trusted Contributor

Re: Would you do this? - Script in Single User Mode

Use the script, our language is foreign to them and they will make typos. Yes, you can write a script. Just make sure the script is placed where it will be available when in single user mode. Also doublecheck to make sure all the commands you use in the script will also be available.

- Chris
Jeff Schussele
Honored Contributor

Re: Would you do this? - Script in Single User Mode

Hi Greg,

First thing I'd do is determine:
1) Why /var & /usr are so full.
2) If so, what can be done to "clean" them up.

You could catch a break & find "junk" in there that can be removed. Even find that logs can be trimmed, cleanup can be run to commit old patches, etc.

You may not *need* to extend these at all.
Sure would be much easier than extensions.

My 2 cents,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
James Odak
Valued Contributor

Re: Would you do this? - Script in Single User Mode

This may not be popular but i've done it in extreme situations where i absolutely could not extend any volumes

1.) run cleanup -c 1 (hey with limmited space, rolling back patches is a luxury only)

2.) install as many patches as it will let you before you run out of space maybe 1/2 or 1/4 or even 1/10 of the total patches ..at worst 1 patch at a time

reboot and repeat till all patches are done
Jordan Bean
Honored Contributor

Re: Would you do this? - Script in Single User Mode

If you're willing to risk your job, you may try this:

1. lvextend the logical volumes while they're still mounted. (Yes, you can do this.)

2. Edit /etc/lvmrc to do an extendfs of the filesystems during boot just after the volume groups are activated.

3. Reboot the host and pray.

Volker Borowski
Honored Contributor

Re: Would you do this? - Script in Single User Mode

Hmm,

no web console ?
So a real console ?

Set a a local RS232 Modem for suport at your site, test it carefully and fly it down.

Let Mr. steel mill unplug Console and Plug in Modem, Dial in and do it on your own.

Check for special HP-Cables, they allow to stay connected while the system boots, so the port reset will not result in a modem reset.
You can even do ctrl-b and manage the IPL remote ! HP had Multitech Modems for remotesupport to do this in my Computer childhood.

Should work
Volker
Steven E. Protter
Exalted Contributor

Re: Would you do this? - Script in Single User Mode

I would do it myself via the modem solution.

If you do it via scripting, the only way to be sure it will work is try it out on a playaround server at your locatoin.

You mention steel mill. We have lots of steel mills near here. If its near Chicago, my time can be bought!!!!

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
RolandH
Honored Contributor

Re: Would you do this? - Script in Single User Mode

Why are using a modem?
It??s to hard to configure!

A web-console from HP works on the console port exactly as on a N-Class Server.

Roland


Sometimes you lose and sometimes the others win
Jean-Louis Phelix
Honored Contributor

Re: Would you do this? - Script in Single User Mode

Hi,

I agree ... scripting is dangerous, but non technical people can be even worse. Some time ago, I got this script to do an extendfs at reboot. I kept it ... and I can now give it back !

Regards.

In fact it's a text file to be splitted in some files, but really easy to understand.
It works for me (© Bill McNAMARA ...)