- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Booting into single user mode on 11iV1 and 11iV2 (...
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-05-2008 02:52 AM
06-05-2008 02:52 AM
I want to boot into single user mode on both 11iV1 and 11iV2 (PA). I interrupted the boot process to enter ISL prompt and issued this command:
ISL> hpux -is
The system seems to boot up in single user mode and shows the following msgs:
\----------
| INIT: Overriding default level with level 's'
|
| INIT: SINGLE USER MODE
|
| INIT: Running /sbin/sh
| #
/----------
But at this point if I check the run level using 'who -r', it shows 3.
\----------
| # who -r
| sh: who: not found
| # mount /usr
| # who -r
| . run-level 3 Jun 4 08:43 3 0 S
/----------
Am I missing something here? Shouldn't 'who -r' show run level as 's' or 'S'?
Thanks,
Vivek Srivastava
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2008 03:23 AM
06-05-2008 03:23 AM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
after booting you must do
#bcheckrc
regards,
mustafa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2008 08:24 PM
06-05-2008 08:24 PM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
\----------
| INIT: Overriding default level with level 's'
|
| INIT: SINGLE USER MODE
|
| INIT: Running /sbin/sh
| # bcheckrc
| /sbin/bcheckrc:
| Checking for LVM volume groups and Activating (if any exist)
| Volume group "/dev/vg00" has been successfully changed.
| vxfs fsck: sanity check: root file system OK (mounted read/write)
| Checking hfs file systems
| /sbin/fsclean: /dev/vg00/lvol1 (mounted) ok
| HFS file systems are OK, not running fsck
| Checking vxfs file systems
| /dev/vg00/lvol8 :
| vxfs fsck: sanity check: /dev/vg00/lvol8 OK
| /dev/vg00/lvol3 :
| vxfs fsck: sanity check: root file system OK (mounted read/write)
| /dev/vg00/lvol4 :
| vxfs fsck: sanity check: /dev/vg00/lvol4 OK
| /dev/vg00/lvol5 :
| vxfs fsck: sanity check: /dev/vg00/lvol5 OK
| /dev/vg00/lvol6 :
| vxfs fsck: sanity check: /dev/vg00/lvol6 OK
| /dev/vg00/lvol7 :
| vxfs fsck: sanity check: /dev/vg00/lvol7 OK
|
| Cleaning /etc/ptmp...
| # who -r
| sh: who: not found
| # mount /usr
| # who -r
| . run-level 3 Jun 5 09:17 3 0 S
/----------
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2008 11:56 PM
06-05-2008 11:56 PM
Solution(first in single user mode)
# who -r
. run-level 3 May 30 15:44 3 0 S
# strings /etc/utmp
system boot
run-level 3
...
# init 1
INIT: New run level: 1
...
# who -r
. run-level 1 Jun 6 11:41 1 0 S
# strings /etc/utmp
system boot
run-level 1
...
# ps -ef
...
/usr/sbin/utmpd
...
Some more:
INIT: Overriding default level with level 's'
INIT: SINGLE USER MODE
INIT: Running /sbin/sh
# set
...
INIT_STATE=s <===
...
I would guess the reason is that "who" cannot get the current status when just booted into single user mode.
Anyway, I think you will know if you are in su mode.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2008 12:14 AM
06-06-2008 12:14 AM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
One would think so but perhaps the entry isn't there in single use mode?
In any case, can you copy the /var/adm/wtmps in case it gets changed later.
In single user mode you could try:
/usr/sbin/acct/fwtmp -X < /var/adm/wtmps
And look at the end for:
system boot 0 2 0000 0000 1203631070 0 DATE 0
run-level 3 0 1 0063 0123 1203631070 0 DATE 0
Or you can get to user mode and do this on the copy.
I guess I should have used google first:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=217851
/sbin/getrunlvl
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=50401
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1179305
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=95011
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2008 07:57 PM
06-06-2008 07:57 PM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
----------
| INIT: Overriding default level with level 's'
|
| INIT: SINGLE USER MODE <<<===
|
| INIT: Running /sbin/sh
| #
/----------
http://docs.hp.com/en/A5201-96044/apas02.html#aes-npar-329
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2008 09:43 PM
06-06-2008 09:43 PM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
Coming back to my question. Even the getrunlvl command shows the run level as 3 in single user mode (on 11iV1, didn't try on V2):
\----------
| INIT: Overriding default level with level 's'
|
| INIT: SINGLE USER MODE
|
| INIT: Running /sbin/sh
| # getrunlvl
| New_level 3 Old_level S
/----------
The underlying issue that brought me to this 'who -r' question was that I was using getutid() from a C program to figure out the run level and it was returning 3 in single user mode. I then decided to check out what 'who -r' was doing to get the run level which is when I got stuck.
About the suggestion of using fwtmp:
\----------
| In any case, can you copy the /var/adm/wtmps in case it gets changed later.
| In single user mode you could try:
| /usr/sbin/acct/fwtmp -X < /var/adm/wtmps
|
| And look at the end for:
| system boot 0 2 0000 0000 1203631070 0 DATE 0
| run-level 3 0 1 0063 0123 1203631070 0 DATE 0
/----------
I haven't tried it out, but even if it were to work, it'll need /usr to be mounted in single user mode.
Any more tricks to figure this thing out, especially from a C program?
Thanks,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2008 09:54 PM
06-06-2008 09:54 PM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
INIT_STATE
variable?
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2008 10:40 PM
06-06-2008 10:40 PM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
Ah, you just copy /etc/utmp instead. Then check it when in user mode.
/usr/sbin/acct/fwtmp < utmp_copy
>I then decided to check out what 'who -r' was doing to get the run level
It probably just calls getutent(3).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 02:08 AM
06-09-2008 02:08 AM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
> Did you see my comment and the status of
> the INIT_STATE variable?
I did that now and yes, INIT_STATE is indeed set to 's' (checked on 11.23PA) in single user mode. The good thing is that it is set both when using 'hpux -is' as well as 'shutdown'. Looks like this could solve my problem. I just hope if works fine on all the platforms that we work on (11.00, 11.11, 11.23 PA/IA).
> @Dennis Handly:
> Ah, you just copy /etc/utmp instead. Then
> check it when in user mode.
> /usr/sbin/acct/fwtmp < utmp_copy
Uhh, I still didn't get you. In single user mode /usr won't be mounted (assuming it's a separate partition). So how would I run /usr/sbin/acct/fwtmp? Since I want to check for single user mode from inside a C program, fsck/mount are out of question.
Thanks,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 03:03 AM
06-09-2008 03:03 AM
Re: Booting into single user mode on 11iV1 and 11iV2 (PA-RISC)
>In single user mode /usr won't be mounted (assuming it's a separate partition). So how would I run /usr/sbin/acct/fwtmp?
You copy /etc/utmp while in single user mode. Then when you have the system up, you use fwtmp to see if the info is even in utmp. If not there, no need to pursue this.
>Since I want to check for single user mode from inside a C program
You won't be able to do this on IPF. No user C programs will work in single user mode since libc.a no longer exists.