Accessing and Using the GRUB Mode

Cisco Catalyst 8000V has a 16-bit configuration register in NVRAM. Each bit has the value 1 (on or set) or value 0 (off or clear), and each bit setting affects the router behavior upon the next reload power cycle. The GRUB mode supports a subset of configuration register options which is comparable to the ROMMON options on other Cisco routers.

You can use the configuration register to:

  • Force the router to boot into the GRUB mode (bootstrap program)

  • Select a boot source and the default boot filename

  • Recover a lost password

The following table describes the configuration register bits.

Table 1. Configuration Register Bit Descriptions

BitNumber

Hexadecimal

Meaning

00–03

0x0000–0x000F

Boot field. The boot field setting determines whether the router loads an operating system and where it obtains the system image.

See the table "Boot Field Configuration Register Bit Descriptions" for details.

06

0x0040

Causes the system software to ignore the contents of NVRAM. This can be used for password recovery.


Note


Entering the GRUB mode for Cisco Catalyst 8000V running on cloud solutions depends on the console access capabilities of the cloud provider. If the cloud provider provides limited access to console, you cannot access the GRUB mode for password recovery.



Note


Use the 0x000 setting to configure the router to automatically enter the GRUB mode when the router reboots.

Accessing the GRUB Mode

Perform the following step to access the GRUB mode:

Procedure


Step 1

enable

Example:


Router> enable

Enables the privileged EXEC mode.

  • Enter your password, if prompted.

Step 2

config-register 0x0000

Example:


Router# config-register 0x0000

Enters the GRUB mode by entering the “0000” value (0x0).

The following shows an example of entering GRUB mode.


Router(config)# config-register 0x0000

GNU GRUB  version 2.02

Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists possible
device or file completions. ESC at any time exits.

grub> confreg 0x2102

If you enter a question mark at the grub> prompt, the system shows you the two options available - for either viewing the system help or for entering the config register command.


Using the GRUB Menu

The GRUB menu is used to display the software images loaded on the router, and to select which image to boot from. To access the GRUB menu, enter ESC at the GRUB prompt. The following shows the GRUB menu display.

Select the image to boot the router from using the up and down arrow key. To return to the GRUB prompt, enter the letter c .

Entering the GRUB Mode and Selecting the Image

To load the new system image from the GR and Unified Bootloader (GRUB) mode, follow these steps, beginning in EXEC mode.

Procedure


Step 1

dir bootflash:

Use this command to display a list of all files and directories in bootflash memory:

Example:


Router# dir bootflash:
 
Directory of bootflash:/
    3  -rw-     6458388   Dec 18 2020 00:00:58 c8000v.tmp 
 1580  -rw-     6462268   Dec 18 2020 06:14:02 c8000v-ata
63930368 bytes total (51007488 bytes free)

Step 2

configure terminal

Use this command to enter the global configuration mode:

Example:


Router# configure terminal
Router(config)#

Step 3

boot system bootflash: system-image-filename .bin

Use this command to load the new system image after the next system reload or power cycle. For example:

Example:


Router(config)# boot system bootflash:
c8000v-universalk9.17.04.01a.SPA.bin

Note

 
If the new system image is the first file or the only file displayed in the dir bootflash: command output, you do not need to perform this step.

Step 4

do write

or

do write memory

Example:


Router(config)# do write memory

Note

 
Entering the do write or do write memory command updates the GRUB menu list of images available on the bootflash disk.

Step 5

config-register 0x0000

Use this command to enter the GRUB mode.

The following shows a sample configuration output of entering the GRUB mode.

Example:

GNU GRUB  version 2.02

   Minimal BASH-like line editing is supported. For the first word, TAB
   lists possible command completions. Anywhere else TAB lists possible
   device or file completions. ESC at any time exits.


grub> confreg 0x2102

Example:

Note

 

If you set the config-register to 0x0000, you should reset it back to the default of 0x2102 for the system to autoboot. If the value is 0x0, the system stops in the GRUB mode.

Step 6

At the grub> prompt, enter ESC to access the GRUB menu.

The system displays the GRUB menu with the images that are available to boot.

Example:

Cisco IOS XE Software, Version 2020-09-17_09.24_kamitch
Cisco IOS Software [Bengaluru], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Experimental Version 17.5.20200916:194029 [HEAD-/scratch/kamitch/git/polaris-work/boottime1 106]
Copyright (c) 1986-2020 by Cisco Systems, Inc.
Compiled Wed 16-Sep-20 15:45 by kamitch


Cisco IOS-XE software, Copyright (c) 2005-2020 by cisco Systems, Inc.
All rights reserved.  Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0.  The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY.  You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0.  For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.


ROM: IOS-XE ROMMON

Router uptime is 18 minutes
Uptime for this control processor is 21 minutes
System returned to ROM by reload
System image file is "bootflash:packages.conf"

Select the image to boot the router by using the up and down arrow key. To return to the GRUB prompt, enter the letter c .

Step 7

Select the .bin file to upgrade the software image on the router to the new version.

Step 8

Press Enter to boot the selected image which begins the upgrade process.


Modifying the Configuration Register (confreg)

This section describes how to modify the configuration register by using the confreg GRUB command. This command is similar to the confreg ROMMON command on other Cisco hardware routers. Because the router does not include a ROMMON mode, the similar functionality is handled in GRUB command mode.

You can also modify the configuration register setting from the Cisco IOS XE CLI by using the config-register command in global configuration mode.


Note


The modified configuration register value is automatically written into NVRAM, but the new value does not take effect until you reset or power-cycle the router.

Procedure


confreg [value ]

Example:


grub> confreg 0x2102

Changes the configuration register settings while in GRUB command mode.

  • Optionally, enter the new hexadecimal value for the configuration register. The value range is from 0x0 to 0xFFFF.

  • If you do not enter the value, the router prompts for each bit of the 16-bit configuration register.


What to do next

The following code is an example of entering the GRUB mode and using the configuration register. You access the GRUB mode by entering the Cisco IOS XE config-register command and specifying the value as “0000”.


Router(config)# config-register 0x0000
 
GNU GRUB  version 0.97  (638K lower / 3143616K upper memory)
 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.  ESC at any time exits to menu. ]
grub> help
 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.  ESC at any time exits to menu. ]
confreg [VALUE]                        help [--all] [PATTERN ...]
grub> confreg
           Configuration Summary
   (Virtual Configuration Register: 0x0)
enabled are:
boot: the boot loader
do you wish to change the configuration? y/n [n
]:
ignore system config info? y/n [n
]:
automatically boot default system image? y/n [n
]:
Configuration Register: 0x0
grub> confreg    
           Configuration Summary
   (Virtual Configuration Register: 0x0)
enabled are:
boot: the boot loader
do you wish to change the configuration? y/n [n
]:
ignore system config info? y/n [n]:
automatically boot default system image? y/n [n]:
Configuration Register: 0x42
grub> confreg 0x2102
Configuration Register: 0x2102
grub> confreg
           Configuration Summary
   (Virtual Configuration Register: 0x2102)
enabled are:
boot: default image
do you wish to change the configuration? y/n [n
]:
grub>   
grub>
    GNU GRUB  version 2.02  (638K lower / 3143616K upper memory)
-------------------------------------------------------------------
 0: C8000v - packages.conf
 1: C8000v - c800v-packages-universalk9
 2: C8000v - GOLDEN IMAGE
-------------------------------------------------------------------
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, or 'c' for a command-line.
    Highlighted entry is 0: 
  Booting 'C8000v - packages.conf'
root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
kernel /packages.conf rw root=/dev/ram console=ttyS1,9600 max_loop=64 HARDWARE=
virtual SR_BOOT=harddisk:packages.conf
Calculating SHA-1 hash...done
SHA-1 hash:
        calculated   817e1716:e8e62778:7dd0b806:32db2bdd:13e51407
        expected     817e1716:e8e62778:7dd0b806:32db2bdd:13e51407
package header rev 1 structure detected
Calculating SHA-1 hash...done
SHA-1 hash:
        calculated   d4eaba99:34cbda63:26151233:9d0e9aa4:9c625302
        expected     d4eaba99:34cbda63:26151233:9d0e9aa4:9c625302
Package type:0x7531, flags:0x0
   [Linux-bzImage, setup=0x2e00, size=0x2c18c00]
   [isord @ 0x7e6d0000, 0x191f000 bytes]

Changing the Configuration Register Settings

You can change the configuration register settings from either the GRUB or the Cisco IOS XE CLI. This section describes how to modify the configuration register settings from the Cisco IOS XE CLI.

To change the configuration register settings from the Cisco IOS XE CLI, complete the following steps:

Procedure


Step 1

Power on the router.

Step 2

If you are asked whether you would like to enter the initial dialog, answer no:

Example:


Would you like to enter the initial dialog? [yes]: no

After a few seconds, the system displays the user EXEC prompt ( Router> ).

Step 3

Enter the privileged EXEC mode by typing enable, and if prompted, enter your password:

Example:


Router> enable
Password: password
Router#

Step 4

Enter the global configuration mode:

Example:


Router# configure terminal
Enter configuration commands, one per line.
Edit with DELETE, CTRL/W, and CTRL/U; end with CTRL/Z 

Step 5

To change the configuration register settings, enter the config-register value command, where value is a hexadecimal number preceded by 0x :

Example:


Router(config)# config-register 0x
value

Step 6

Exit the global configuration mode:

Example:


Router(config)# end
Router#

Step 7

Save the configuration changes to NVRAM:

Router# copy running-config startup-config

The new configuration register settings are saved to NVRAM, but they do not take effect until the next router reload or power cycle.


Displaying the Configuration Register Settings

To display the configuration register settings that are currently in effect and the settings that will be used at the next router reload, enter the show version command in privileged EXEC mode.

The configuration register settings are displayed in the last line of the show version command output:


Configuration register is 0x142 (will be 0x142 at next reload)