Single-User Mode vs. Maintenance Mode

Edit: Avoid a resume generating event.

Originally posted February 9, 2016 on AIXchange

Recently I was telling a customer about the differences between booting into single-user mode and booting into maintenance mode. If you’re not familiar with these procedures, I recommend either using an existing LPAR or creating a new LPAR and trying them both. But before you do that, check out two valuable IBM support technotes (FAQs) that walk through each method.

This document tells you how to boot AIX to single-user mode to perform maintenance. (Note: You’ll need to know the root password to do this):

In AIX we don’t tend to use single-user mode very much, because many problems require having the rootvg filesystems unmounted for repairs. However, there are some instances when it’s beneficial to use single-user:

  • The system boot hangs due to TCP/IP or NFS configuration issues
  • [To] do work on non-root volume groups
  • To debug problems with entries in /etc/inittab
  • To work on the system without users attempting to log in
  • To work without applications starting up
  • It is easy to unmount /tmp and /var if they need to be checked with fsck or recreated

If the system boots fine from the rootvg, then booting into single-user to repair or perform work has advantages:

  • It boots quicker than Maintenance Mode.
  • You can boot off the normal system rootvg without finding AIX Install media or setting up a NIM SPOT.
  • It allows you to run all commands you would normally have access to in multiuser.
  • Unlike maintenance mode, there is no possibility that hdisks will be renamed.

Procedure
Standalone System (no HMC):
1. Boot system with no media in the CD/DVD drive
2. Wait until you see the options of choosing another boot list, and hear beeps on the console
3. Press 6 to start diagnostics.

System using an HMC:
1. Select the LPAR in the HMC GUI
2. Select Operations -> Activate
3. In the Activate window, click the button that says “Advanced”
4. Change “Boot mode” to “Diagnostic with stored boot list”
5. Click “OK” to save that change, then “OK” again to activate.

More menu options follow, so be sure to read the whole thing.

This doc tells you how to boot into maintenance mode on AIX systems to perform maintenance on the rootvg volume group or restore files from an mksysb backup.

There is a variety of media that can be used to boot an AIX system into Maintenance Mode. These consist of:
    1.A non-autoinstall mksysb taken from the same system or another system running the same level of AIX, either on tape or CD/DVD media.
    2.AIX bootable installation media (CD or DVD).
    3.A NIM server with a SPOT configured, and set up to boot this machine for maintenance work.

For certain work it is important to have the exact same level (AIX version, Technology Level, and Service Pack) on the boot media as is installed on disk. In these cases if the system is booted with different levels, the rootvg filesystems and commands may not be available to use.

This portion of the doc is found under the heading, Maintenance Mode Options:

At this point a decision must be made.

Option 1 will attempt to mount the rootvg filesystems and load the ODM from /etc/objrepos. If this works you will have full access to the rootvg filesystems and ODM, so you may run commands such as bosboot, rmlvcopy, syncvg, etc. If the version of AIX you have booted from (either from media or NIM SPOT) is not exactly the same as on disk, this will error and fail to mount the filesystems.

Option 2 will import the rootvg and start an interactive shell before mounting any filesystems. This interactive shell has very few commands available to it. As it has not mounted any filesystems from the rootvg it does not have access to rootvg files or the ODM. Use this option when performing maintenance on the rootvg filesystems themselves, such as fsck, rmlv, or logform.

    1) Access this Volume Group and start a shell
    2) Access this Volume Group and start a shell before mounting filesystems

This portion of the doc is found under the heading, Notes on Maintenance Mode:

1.The terminal type is not usually set up correctly for using the vi editor (in Option 2 only). To set this type:
    # export TERM=xterm

2.If you mount any rootvg filesystems (either automatically under Option 1 or by hand under Option 2) and change any files you must manually sync the data from filesystem buffer cache to disk. Normally the syncd daemon does this for you every 30 seconds, but no daemons are running in maintenance mode. To sync the data type:
    # sync; sync; sync

3.Typically there is no network connectivity in maintenance mode, so FTP or telnet are not available.

4.If you are in Option 2 with no filesystems mounted and wish to mount the filesystems and load the ODM you can type:
    # exit

Leaving Maintenance Mode
If you have chosen Option 2 and you have not mounted any filesystems by hand, just shut down the LPAR (via the HMC) or power off a standalone server. If you are ready to boot AIX to multiuser then activate the LPAR or if a standalone server power it on via the front panel.

If you have chosen Option 1 type these commands to reboot the system:
    # sync; sync; sync; reboot

Again, read both documents in their entirety to learn more. And because preparation is always worthwhile, I’ll add that it’s always a good time to verify that you have good mksysb images that you could use if needed. 

Speaking of the importance of preparation, not long ago I heard from someone whose server failed to bootup after a recent power outage. They were booting from local disks and didn’t have their rootvg mirrored. They did not have backups. They did have a very a bad day. Some folks refer to this type of situation as an RGE, or a resume generating event. With minimal effort now, you can avoid the same fate.