Operating System - HP-UX
1847086 Members
6044 Online
110262 Solutions
New Discussion

Re: I may have a Kernel Problem

 
NIGEL WHITE_2
Frequent Advisor

I may have a Kernel Problem

Hello,

Back in the days of HP-UX 10, you could copy /stand/vmunix to /stand/vmunix.bak and everything would be ok. I have just copied a vmunix file on a HP-UX 11.11 system and I've been advised that I may have corrupted my running Kernel because I used cp and not mv ???

Question:

1. Have I corrupted the Kernel and will the machine fail to boot next time its rebooted? As the Kernel has not been modified yet, why could it be corrupted? Is it being written too while the system is running? Theres no indication that the vmunix file has been written to???

2. If my cp command has corrupted vmunix how do I fix it.

This was in preparation to using SAM to change the maxvgs from 10 to 32, but like I say I have not changed the Kernel yet, I've just copied the /stand/vmunix file to /stand/vmunix.bak.

Please advise, as I'm reluctant to reboot until someone explains why it MAY be corrupted by using cp.

Regards
Nigel
16 REPLIES 16
Steven E. Protter
Exalted Contributor

Re: I may have a Kernel Problem

Shalom Nigel,

The premise that using cp and not mv can corrupt the kernel is false. I've used cp and mv interchangeably when deploying new kernels manually.

It is best to use the same commands that sam does. I would suggest you do a kernel change in sam on a good kernel and check the sam command log.

If your kernel is corrupt, it is from some other cause. There could be a problem with the /stand filesystem.

SEP
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
NIGEL WHITE_2
Frequent Advisor

Re: I may have a Kernel Problem

Many thanks.

Like I say, there's no indication of corruption as I've not made any changes yet. I'm planning on changing maxvgs over the weekend. So the fact that you have made copies of /stand/vmunix in the past using cp on a running system is very good to hear.

How would you change maxvgs on HP 11.11 server to 32 (sam) ?

I used to do the following on HP-Ux 10:

1. system_prep a new system file in /stand/build

2. edit /stand/build/system with whatever .....

3. mk_kernel -s ./system

4. mv /stand/vmunix /stand/vmunix.old
mv /stand/system /stand/system.old

5. cp /stand/build/system /stand
cp /stand/build/vmunix_test /stand/vmunix

6. shutdown -r 0

Cross fingers.

I've been advised the above method is no longer supported in HP-UX 11.11 ????

Is this true? and should I just use SAM?

Regards
Nigel
A. Clay Stephenson
Acclaimed Contributor

Re: I may have a Kernel Problem

This is nonsense. Essentially the only difference in behavior other than the obvious difference that cp does not unlink the original file is that if the file were sparse cp would "fill in" the "holes" with ASCII NUL's but even then a sparse file should behave exactly the same as a non-sparse file because the read() system call silently fills in the "holes". The other difference is that within the same filesystem mv reuses the same inode but none of this will result in a corrupt kernel.

Now, you don't want to run the system very long with a renamed kernel (ie the current "vmunix" is not the "vmunix" that the box booted) because applications that read the kernel's symbol table and use it to access /dev/kmem are going to get erroneous results but this would be true no matter what mechanism were used to rename/move/copy the kernel.

If it ain't broke, I can fix that.
NIGEL WHITE_2
Frequent Advisor

Re: I may have a Kernel Problem

So, as Ive not made any Kernel changes yet, I still have a good Kernel after using the cp command and if i was to reboot now, it would come backup?

Hope so.

Nigel
John Guster
Trusted Contributor

Re: I may have a Kernel Problem

here are steps to take to make kernel changes in HP-UX 11.11
1. cd /stand/build
2./usr/lbin/sysadm/system_prep -v -s system
3. vi system==>to modify the parameter
4. cp -p /stand/system /stand/system.work
5. cp /stand/build/system /stand/system
6. /usr/sbin/mk_kernel -s /stand/build/system==>has to done under /stand/build
7. /usr/sbin/kmupdate
8. /usr/sbin/shutdown -ry 0

confidence you build from here. Each version of HP-UX OS has its own way to be treated.
NIGEL WHITE_2
Frequent Advisor

Re: I may have a Kernel Problem

Thanks.

When I run the system_prep command and edit the new system file under /stand/build/system, I notice there's no maxvsgs parameter???

Do i have to create it myself??

Regards
Nigel
Steven E. Protter
Exalted Contributor

Re: I may have a Kernel Problem

Shalom again Nigel,

kumtune

This will display all kernel values possible that can be altered by a user. If its not there you can't set it.

You don't have to do anything special.

Just as a precaution, I use Ignite to do a make_tape_recovery backup of a system before doing this work. Then I do it.

I think its time to try.

SEP
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
John Guster
Trusted Contributor

Re: I may have a Kernel Problem

if it is default value, then it will not show up in this file. You have to add:
maxvgs 32

John Guster
Trusted Contributor

Re: I may have a Kernel Problem

if it is a default value, then it will not show up in this file. You have to add:
maxvgs 32

John Guster
Trusted Contributor

Re: I may have a Kernel Problem

the get a complete list of your kernel values, do
sam->Kernel Configuration->Configurable Parameters, go file->print; select file (not printer), give /tmp/kernel.lst(something like that), then OK. you can view /tmp/kernel.lst to check maxvgs which must be 10 in your case.
whiteknight
Honored Contributor

Re: I may have a Kernel Problem

Nigel,

to troubleshoot, you can verify using mk_kernel to verify the integrity of the kernel compilation, this will not have any system impact.

The proper steps of manual kernel regeneration in 11.11

please refer to:-
http://docs.hp.com/en/5185-6559/ch01s01.html#cjacdbcg
Problem never ends, you must know how to fix it
NIGEL WHITE_2
Frequent Advisor

Re: I may have a Kernel Problem

one last question about SAM HP-UX 11.11:

Once I change the maxvgs setting to 32 will a new Kernel be built and then reboot. Or will it rebuild the Kernel and then ASK if I want to reboot?

I would like to make the change before the weekend so when the Server is rebooted over the weekend, it comes up with the new MAXVGS setting.

Its been so long since I used SAM, having trouble remmebering.lol

BTW, don't tell anyone Im using SAM. I have a reputation you know.lol

R.
Nigel
Anshumali
Esteemed Contributor

Re: I may have a Kernel Problem

Hi Nigel,

maxvgs is a static parameter and system needs to be restarted to bring the changes into effect. If you change it using SAM, you need to select-->Actions, "Process New Kernel." It will ask for your confirmation that system will be rebooted, once you press ok, it will show /stand will be overwritten{ok}. Click and final(i hope) it gives u, Move the kernel and restart the system.

But .... Please take appropriate backups.
1. Always Ignite.
2. /stand/vmunix (i hope this was original thread how to take, with cp or mv.... ;) )

your best bet then is vmunix.prev or your saved kernel.

Cheers!
Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Bill Hassell
Honored Contributor

Re: I may have a Kernel Problem

> I've been advised that I may have corrupted my running Kernel because I used cp and not mv ???

You were advised incorrectly. As Clay mentioned, if the currently running kernel does not match /stand/vmunix, a few commands may have difficultie, specifically ipcs which needs to coordinate kernel memory with information from the vmunix file. That may have been what your advisor meant but it has nothing to do with mv or cp.

> I notice there's no maxvsgs parameter???

The system file is the CHANGE file for kernel parameters. If a parameter is not listed, then it takes on the default value. Add the parameters you wish to change. Note that SAM does all these steps automatically so if you support several versions of HP-UX (ie, 10.xx through 11.31) it is advisable to use SAM to make the changes (drivers, kernel parameters, etc) so you won't have to remember all the differences. In this case, SAM is the best choice -- you want to get the steps right.

When using SAM to make the changes, it will first build the kernel, then it stops to ask you if you want to save the current kernel, and move the new one into place or forget the all the changes. If you say OK to move then SAM will move the new kernel into place and ask if you want to reboot now or later. I don't remember whether you have to leave SAM running until you finally reboot.


Bill Hassell, sysadmin
NIGEL WHITE_2
Frequent Advisor

Re: I may have a Kernel Problem

Thanks Guys, you have all been great. I've spent so much time with Redhat LINUX over the last 12months I can hardly remember my HP-UX.lol

Thanks again,

Nigel
Anshumali
Esteemed Contributor

Re: I may have a Kernel Problem

Hi Nigel,

If you really think this thread was helpfull, please assign the points.
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!