1847883 Members
5325 Online
104021 Solutions
New Discussion

Single User Mode

 
Rene_17
Regular Advisor

Single User Mode

Can I change the single user mode ?
Bsp.: - change the disk volumes, which have been mounted in single user mode ?

I have the problem that I can??t start the editor in single user mode, because the libaries aren??t mounted !
11 REPLIES 11
Robert-Jan Goossens
Honored Contributor

Re: Single User Mode

Hi,

Try this,

# /sbin/mount -a

Now you can use vi.

Hope it helps,

Robert-Jan.
T G Manikandan
Honored Contributor

Re: Single User Mode

/sbin/mount -a
twang
Honored Contributor

Re: Single User Mode

You need to mount /usr manually:
# mount /dev/vg00/lvolX /usr

Or use 'mount -a' to get all directories mounted which are in /etc/fstab
Rene_17
Regular Advisor

Re: Single User Mode

Thank you for your answers, but I??am interested in changing the single user mode configuration !
normally a runlevel have links to scripts in rcX directory, but single user mode has nothing ?
Michael Tully
Honored Contributor

Re: Single User Mode

You basically get nothing in single user mode, (/ and /stand are mounted, although you can fully control the rest at this point what you wish to do within reason. If you wish to edit files then you must have /usr mounted.

# mount /usr

To change the run-level config, you need to edit /etc/inittab If you change /etc/inittab you ned to issue a 'init q' command.
The default multi-user level is three, but some organisations have a couple more. We have up to four. The fourth being starting of databases and application servers. Yes the run-level (the first line in /etc/inittab) is the /sbin/rc.N directories, K to kill and S to start.
Anyone for a Mutiny ?
Robert-Jan Goossens
Honored Contributor

Re: Single User Mode

Rene,

I don't think I understand your question, if you are in single user mode nothing will be started. If you would like to start services you will have to change the init state. Take a look at the /etc/inittab and the /sbin/rc0.d rc1.d rc2.d rc3.d here are the scripts which will start all your services.

Hope it helps,

Robert-Jan.
twang
Honored Contributor

Re: Single User Mode

You don't need to configure 'single user mode', because it starts nothing(no service). Why we need to mount those filesystems? because without /var and /usr, you only have those binaries that are in /bin and /sbin. After mounting those filesystem, you have utilities to configure the server, then reboot server to multi-user mode.
Rene_17
Regular Advisor

Re: Single User Mode

It was only a question:
If I can change the configuration of the single user mode.

Thanks !!!
Caesar_3
Esteemed Contributor

Re: Single User Mode

Hello!

In this case in HPUX you can't change the
single user mode.

Caesar
Bill Hassell
Honored Contributor

Re: Single User Mode

Single user mode is defined as a special case and although the man page for shutdown and init indicate that you can reach single user mode using those commands. However, init s definitely does not enter singloe user mode as it leaves services running and mounted filesystems. Similarly, shutdown without an option (-r or -h) can still leave filesystems mounted. So, unlike other init states, single user mode is not managed by init.

It is important to understand that single user mode is very special and to note that only 2 filesystems will be mounted: / and /stand. All sysadmins need to understand this. They also need to understand that /usr (which contains /usr/bin and /usr/lib) are not mounted and for good reason. If a problem develops with the /usr filesystem, you may need single user mode to fix the problem. All the commands you have in single user mode are located in /sbin which is part of /.

Once in single user mode, you can gain access to /usr commands such as vi by doing this:

mount /usr
mount /tmp
mount /var

and now vi (and bdf and others) will be available. Don't use mount -a since this will mount everything including network filesystems which cannot be used in single user mode (no networking). So, you don't want to change the default behavior of single user mode, but to remember the environment when it is used.


Bill Hassell, sysadmin
Steve Post
Trusted Contributor

Re: Single User Mode

1. It sounds like you CAN change what gets mounted/started in single user mode.
It also sounds like it's NOT a good idea.

2. fyi: the reason why you need /tmp mounted for vi is because the vi program makes a file in the /tmp directory when you edit a file.

3. humorous fyi: When I went to single-user mode via "shutdown", I still had tons of stuff mounted. In order for ME to get into single-user mode to work with the /var filesystem, I had to POWERDOWN, then interrupt the boot process, then boot into single user mode from there. Otherwise I could not unmount /var. You see it had some pesky trivial program using it. Hmmm.. let's see what was that program called? Oh yeah. It was HPUX.