- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to tell which file is the kernel that is runni...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 09:55 AM
06-09-2003 09:55 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 09:57 AM
06-09-2003 09:57 AM
Re: how to tell which file is the kernel that is running
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 09:57 AM
06-09-2003 09:57 AM
Re: how to tell which file is the kernel that is running
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 10:08 AM
06-09-2003 10:08 AM
Re: how to tell which file is the kernel that is running
Not 100% positive, but I believe if you look at the VERY top of the current /var/adm/syslog/syslog.log file, all the device discovery entries should be prefaced by date, time, hostname & then *kernel* name.
It's been forever since I booted an alternate kernel. But a quick test on a sandbox system ought to prove/disprove it.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 10:33 AM
06-09-2003 10:33 AM
Re: how to tell which file is the kernel that is running
But if you weren't there when the system booted, how do you know what the file name is for the kernel that is currently running?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 10:38 AM
06-09-2003 10:38 AM
Re: how to tell which file is the kernel that is running
I'm using a workstation on 11.0 and it is booted from the default kernel (/stand/vmunix). But, syslog doesn't contain anything about the file name of the kernel that is running. unless nothing is written to the log file if the default file name is used for the kernel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 10:44 AM
06-09-2003 10:44 AM
Re: how to tell which file is the kernel that is running
I'm looking in syslog on one of our boxes and it looks like it wrote 'vmunix' when it started booting:
Jun 4 20:13:47 dd01 syslogd: restart
Jun 4 20:13:47 dd01 vmunix: gate64: sysvec_vaddr = 0xc0002000 for 2 pages
Jun 4 20:13:47 dd01 vmunix: NOTICE: autofs_link(): File system was registered at index 3.
Jun 4 20:13:47 dd01 vmunix: NOTICE: cachefs_link(): File system was registered at index 5.
Jun 4 20:13:47 dd01 vmunix: NOTICE: nfs3_link(): File system was registered at index 6.
Jun 4 20:13:47 dd01 vmunix: 0 sba
Jun 4 20:13:47 dd01 vmunix: 0/0 lba
Jun 4 20:13:47 dd01 vmunix: 0/0/0/0 btlan
[etc.]
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 10:47 AM
06-09-2003 10:47 AM
Re: how to tell which file is the kernel that is running
Well it was worth a shot. I just tested that on a workstation by copying /stand/vmunix to /stand/vmunix.safe, rebooted interrupted the boot & entered @ the ISL> hpux /stand/vmunix.safe
Other than a message in syslog.log that I didn't have a DLKM.safe all the entries were STILL prefaced by vmunix:
I'm sure there's a way, I'll keep digging. I suspect that something ought to be able to tell you.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 10:47 AM
06-09-2003 10:47 AM
Re: how to tell which file is the kernel that is running
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 11:02 AM
06-09-2003 11:02 AM
Solutionecho "boot_string/s" | adb -k /stand/vmunix /dev/kmem
/stand/vmunix should be in the output but if not, the kernel file, /stand/umunix does NOT match the core image, /dev/kmem so the command should be repeated replacing /stand/vmunix with another kernel file,usually /stand/vmunix.prev.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 11:03 AM
06-09-2003 11:03 AM
Re: how to tell which file is the kernel that is running
vmunix in this situation, just means that the message was logged by the kernel. The message will contain vmunix no matter which file was booted from.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 11:35 AM
06-09-2003 11:35 AM
Re: how to tell which file is the kernel that is running
You can check the dmesg to find out!
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 11:47 AM
06-09-2003 11:47 AM
Re: how to tell which file is the kernel that is running
situation is:
/stand/vm is a copy of /stand/vmunix. /stand/vmunix.prev is different from /stand/vmunix even though it is the same size.
boot with /stand/vm as the kernel, clay's solution
using adb -k /stand/vm /dev/kmem correctly reports /stand/vm as the bootfile.
using adb -k /stand/vmunix /dev/kmem also correctly reports /stand/vm as the bootfile.
and using adb - /stand/vmunix.prev /dev/kmem doesn't report anything as the boot string. ie bootstring:
with no value.
I'm going to hold off on awarding the big points in the hope there will be an alternative solution.
Because, the reason for wanting to know which file is the kernel is so I can use that file as an argument for the adb command. And, clay's solution is to test all the possible kernels till one works. This seems more of a brute force type of solution.
although in reality, it isn't all that bad. after all how often aren't you using vmunix or vmunix.prev. and only in that case would I need to test all the large (>6M) files in /stand, which shouldn't be all that many.
thanks clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 11:52 AM
06-09-2003 11:52 AM
Re: how to tell which file is the kernel that is running
the kernel file name isn't reported within dmesg on my system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 12:26 PM
06-09-2003 12:26 PM
Re: how to tell which file is the kernel that is running
Dmesg should never be relied upon because once it's circular buffer fills, it begins to overwrite itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 12:49 PM
06-09-2003 12:49 PM
Re: how to tell which file is the kernel that is running
kmpath - retrieve kernel name and associated kernel component set
information
SYNOPSIS
/usr/sbin/kmpath [-k]
/usr/sbin/kmpath -c [kernel_name]
/usr/sbin/kmpath -i [kernel_name]
DESCRIPTION
kmpath retrieves the main kernel file name and path information of the
currently running kernel. kmpath also retrieves the Kernel ID String
(KIS) and the associated /stand/dlkm.KIS directory of the current or
specified kernel.
Each kernel is composed of several distributed component files, the
kernel component set, which use a defined naming convention, and are
all required for a kernel to boot and run properly. During the
process of configuring a new kernel, a unique Kernel ID String (KIS)
is embedded into the kernel image. The main kernel file (by default
/stand/vmunix) is associated to its component files via the KIS. The
/stand/dlkm.KIS directory contains several of the kernel component set
files used by the DLKM infrastructure, including dynamically loadable
kernel module images.
If no options are specified, kmpath returns the full path of the main
kernel file of the currently running kernel, which constitutes the
boot kernel path of the currently booted kernel (for example,
/stand/vmunix).
Options
The kmpath options have the following meanings:
-k Return the base name of the main kernel file of the currently
running kernel (for example, vmunix).
-c [kernel_name]
Return the /stand/dlkm.KIS directory name. If kernel_name is not
specified, KIS corresponds to the currently running kernel's
Kernel ID String. If kernel_name is specified, KIS corresponds
to the specified kernel's KIS.
-i [kernel_name]
If a kernel_name is not specified, return the KIS of the
currently running kernel. If a kernel_name is specified, return
the KIS associated with the specified kernel.
FILES
/stand/kernel_name Main kernel file.
Hewlett-Packard Company - 1 - HP-UX 11i Version 1.6: Feb 2002
kmpath(1m) kmpath(1m)
/stand/dlkm.KIS Directory containing DLKM-related elements of
the kernel component set. (KIS is the Kernel
ID string in the corresponding kernel image).
/stand/krs/KIS.p0 Kernel-specific kernel registry file. Element
of the kernel component set that contains
kernel-specific configuration data persistent
across system reboot. (KIS is the Kernel ID
string in the corresponding kernel image).
/stand/boot.KIS Directory that contains links to the files in
the kernel component set that are required by
the boot loader during the process of booting a
kernel with Kernel ID String KIS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 12:50 PM
06-09-2003 12:50 PM
Re: how to tell which file is the kernel that is running
vmunix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 01:59 PM
06-09-2003 01:59 PM
Re: how to tell which file is the kernel that is running
your getting closer. but while kmpath exists on my 11.0 system, it doesn't return anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 05:29 PM
06-09-2003 05:29 PM
Re: how to tell which file is the kernel that is running
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 06:59 PM
06-09-2003 06:59 PM
Re: how to tell which file is the kernel that is running
/usr/sbin/kmpath
/usr/sbin/kmpath -k
/usr/sbin/kmpath -c
all return the same thing, the shell prompt. on my system -i is an illegal option and there is no man page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 07:14 PM
06-09-2003 07:14 PM
Re: how to tell which file is the kernel that is running
#!/usr/bin/ksh
kernel=""
for i in $(find /stand -xdev -type f -size +12000 -print )
do
kernel=$(
echo boot_string/s |
adb -k $i /dev/kmem |
awk '{
if ( $0 ~ "/stand" ) {
a=match($0,"/stand");
b=substr($0,a);
print b;exit;}
}')
if [[ -n "$kernel" ]] ;then
break
fi
done
print "$kernel"
and one using another method
#!/usr/bin/ksh
/usr/sam/lbin/getkinfo -b
cat /var/sam/bot.config |
awk '/Kernel_Path/ {
while ( $1 != "string" ) getline;
split($0,a,"\"");
print a[2];
exit;
}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 07:24 PM
06-09-2003 07:24 PM
Re: how to tell which file is the kernel that is running
cat /var/sam/boot.config
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2003 10:52 PM
06-09-2003 10:52 PM
Re: how to tell which file is the kernel that is running
i have an alternative solution.
And if you get ther running kernel configuration? I will attacha short procedure at the bottom.
The idea is to extract (at low cost) the parameters from the running kernel.
Then you can compare (diff) the result either with /stand/system or with /stand/system.prev or whichever system file!
It's just a check with smaller files...
11.x
1. Change directories to /stand/build.
cd /stand/build
2. Create a new system file from the running kernel.
/usr/lbin/sysadm/system_prep -s /stand/build/system
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2003 01:39 PM
06-10-2003 01:39 PM
Re: how to tell which file is the kernel that is running
# what /usr/sbin/kmpath
/usr/sbin/kmpath:
$Revision: 82.20 $
There is no man page for kmpath at 11.0 but I'm not sure whether that means it's not meant to be a supported command. Normally, 'backend' commands are stored in /usr/lbin (or for sam, /usr/sam/lbin) and with a few exceptions, no man pages.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2003 01:53 PM
06-10-2003 01:53 PM
Re: how to tell which file is the kernel that is running
yes i'm using the absolute pathname /usr/sbin/kmpath.
yes what returns:
$Revision: 82.20 $
and i did look for possible patchs for kmpath but a seach didn't return any for 11.0 or 11.11