- Table of Contents
-
- 01-Fundamentals Configuration Guide
- 00-Preface
- 01-CLI configuration
- 02-RBAC configuration
- 03-Login management configuration
- 04-FTP and TFTP configuration
- 05-File system management configuration
- 06-Configuration file management configuration
- 07-Software upgrade configuration
- 08-Emergency shell configuration
- 09-Automatic configuration
- 10-Device management configuration
- 11-Tcl configuration
- 12-Python configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
08-Emergency shell configuration | 108.93 KB |
Contents
Restrictions and guidelines: Emergency shell
Emergency shell tasks at a glance
Obtaining a system image from a file server
About obtaining a system image from a file server
System image acquisition tasks at a glance
Configuring the management Ethernet interface
Checking the connectivity to the file server
Displaying boot image version information
Display and maintenance commands for emergency shell
Emergency shell usage examples
Example: Using the emergency shell
Using the emergency shell
About the emergency shell
At startup, the device tries to locate and load the following images on the startup software images list:
· Boot image, required for the device to operate.
· System image, required for the device to operate.
· Feature images, used to provide features as needed.
· Patch images, used to fix bugs as needed.
If the boot image is available but one or more of the other images are not, the device enters emergency shell mode.
In emergency shell mode, common service interfaces are not available. You can log in to the device only through the console port. After login, you can obtain and load a system image to start the Comware system.
For more information about software images, see "Upgrading software."
Restrictions and guidelines: Emergency shell
The device starts up independently. If the device enters emergency shell mode, log in to the device through its console port to load a system image for it.
Emergency shell tasks at a glance
To use the emergency shell, perform the following tasks:
1. (Optional.) Managing the file systems
2. Obtaining a system image from a file server
Managing the file systems
About this task
The emergency shell provides some basic file system management commands for managing files, directories, and storage media.
Procedure
To manage the file systems, execute the following commands as needed in user view:
· Display the current status of the file systems.
¡ Display files or directories.
dir [ /all ] [ file | directory ]
¡ Display the working directory.
pwd
¡ Display the contents of a text file.
more file
· Create a directory.
mkdir directory
The parent directory must already exist. The name for the new directory must be unique in the parent directory.
· Copy a file.
copy source-file { dest-file | dest-directory }
· Move a file.
move source-file { dest-file | dest-directory }
The destination directory must have enough space for the file.
· Delete files or directories.
¡ Permanently delete a file.
delete file
Use this command with caution. The deleted file cannot be restored.
¡ Delete a directory.
rmdir directory
To delete a directory, first delete all files and subdirectories in the directory.
Use this command with caution. The deleted directory cannot be restored.
· Format a file system.
format filesystem
Use this command with caution. This command permanently deletes all files and directories from the file system. The deleted files and directories cannot be restored.
Obtaining a system image from a file server
About obtaining a system image from a file server
If the required system image is saved on an FTP or TFTP server, configure the management Ethernet interface and obtain the system image as described in this section.
System image acquisition tasks at a glance
To obtain a system image, perform the following tasks:
1. Configuring the management Ethernet interface
2. Checking the connectivity to the file server
3. Displaying boot image version information
Configuring the management Ethernet interface
About this task
To use FTP, TFTP, SSH, and Telnet services in emergency shell mode, you must configure the management Ethernet interface correctly. If the servers reside on a different network, you also must specify a gateway for the management Ethernet interface.
Configuring the management Ethernet interface on an IPv4 network
1. Enter system view.
system-view
2. Enter management Ethernet interface view.
interface m-eth0
3. Assign an IPv4 address to the interface.
ip address ip-address { mask-length | mask }
By default, no IPv4 address is assigned to the management Ethernet interface.
4. Specify an IPv4 gateway for the interface.
ip gateway ip-address
By default, no IPv4 gateway is specified for the management Ethernet interface.
5. Bring up the interface.
undo shutdown
By default, the management Ethernet interface is in up state.
Configuring the management Ethernet interface on an IPv6 network
1. Enter system view.
system-view
2. Enter management Ethernet interface view.
interface m-eth0
3. Assign an IPv6 address to the interface.
ipv6 address ipv6-address prefix-length
By default, no IPv6 address is assigned to the management Ethernet interface.
4. Specify an IPv6 gateway for the interface.
ipv6 gateway ipv6-address
By default, no IPv6 gateway is specified for the management Ethernet interface.
5. Bring up the interface.
undo shutdown
By default, the management Ethernet interface is in up state.
Checking the connectivity to the file server
To check the connectivity to a file server, execute one of the following commands in any view:
IPv4:
ping [ -c count | -s size ] * ip-address
IPv6:
ping ipv6 [ -c count | -s size ] * ipv6-address
Displaying boot image version information
To display boot image version information, execute the following command in any view:
display version
Downloading a system image
About this task
In emergency shell mode, the device can act as an FTP or TFTP client to download a software image from an FTP or TFTP server. Make sure the version of the downloaded system image matches the version of the boot image.
Downloading a system image from an IPv4 FTP or TFTP file server
To download a system image from an IPv4 FTP or TFTP file server, execute one of the following commands in user view:
· Download a system image from an IPv4 FTP server.
ftp server-ipv4-address get remote-file local-file
· Download a system image from an IPv4 TFTP server.
tftp server-ipv4-address get remote-file local-file
Downloading a system image from an IPv6 FTP or TFTP file server
To download a system image from an IPv6 FTP or TFTP file server, execute one of the following commands in user view:
· Download a system image from an IPv6 FTP server.
ftp ipv6 server-ipv6-address get remote-file local-file
· Download a system image from an IPv6 TFTP server.
tftp ipv6 server-ipv6-address get remote-file local-file
Loading the system image
To load the system image, execute the following commands in user view:
1. Display version information for the boot image and system image.
display version
display install package
Make sure the version of the system image matches the version of the boot image.
2. Load the system image.
install load system-package
To ensure the device can reboot correctly, this command modifies the main startup software image set to include only the boot image and system image.
Rebooting the device
About this task
For the system image to take effect, you must reboot the device.
Procedure
reboot
Display and maintenance commands for emergency shell
Execute display commands in any view.
Task |
Command |
Display copyright information. |
display copyright |
Display software package information. |
display install package package |
Display management Ethernet interface information. |
display interface m-eth0 |
Display IPv4 routing information. |
display ip routing-table |
Display IPv6 routing information. |
display ipv6 routing-table |
Display boot image version information. |
display version |
Emergency shell usage examples
Example: Using the emergency shell
Network configuration
As shown in Figure 1, the device has only the boot image file (boot.bin). After startup, the device entered emergency shell mode. The device and PC can reach each other.
Use the TFTP client service on the device to download system image system.bin from the PC and start the Comware system on the device.
Procedure
# Identify which files are stored and how much space is available in the file system.
<boot> dir
Directory of flash:
0 drw- 5954 Apr 26 2007 21:06:29 logfile
1 -rw- 1842 Apr 27 2007 04:37:17 boot.bin
2 -rw- 1518 Apr 26 2007 12:05:38 startup.cfg
3 -rw- 2045 May 04 2007 15:50:01 backcfg.cfg
524288 KB total (513248 KB free)
The output shows that boot image file boot.bin is present but the matching system image file (system.bin) is not. The available space is 513248 KB, enough for saving system image file system.bin.
# Identify the version information of the boot image.
<boot> display version
H3C Comware Software
Copyright (c) 2004-2017 New H3C Technologies Co., Ltd. All rights reserved.
H3C S5830V2-24S uptime is 0 weeks, 0 days, 0 hours, 29 minutes
Boot image: flash:/s5820v2_5830v2-cmw710-boot-t2206.bin
Boot image version: 7.1.035
H3C S5830V2-24S with 2 Processors
2048M bytes SDRAM
256M bytes Nor Flash Memory
Config Register points to Nor Flash
# Configure an IP address and a gateway for the management Ethernet interface.
<boot> system-view
[boot] interface m-eth0
[boot-m-eth0] ip address 1.1.1.1 16
[boot-m-eth0] ip gateway 1.1.1.2
# Verify that the device and the TFTP server can reach each other.
<boot> ping 1.2.1.1
PING 1.2.1.1 (1.2.1.1): 56 data bytes
56 bytes from 1.2.1.1: seq=0 ttl=128 time=2.243 ms
56 bytes from 1.2.1.1: seq=1 ttl=128 time=0.717 ms
56 bytes from 1.2.1.1: seq=2 ttl=128 time=0.891 ms
56 bytes from 1.2.1.1: seq=3 ttl=128 time=0.745 ms
56 bytes from 1.2.1.1: seq=4 ttl=128 time=0.911 ms
--- 1.2.1.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.717/1.101/2.243 ms
# Download the system.bin file from the TFTP server.
<boot> tftp 1.2.1.1 get system.bin flash:/system.bin
# Verify that the system image is compatible with the boot image.
<boot> display install package flash:/system.bin
flash:/system.bin
[Package]
Vendor: H3C
Product: S5820V2_5830V2
Service name: system
Platform version: 7.1.035
Product version: TEST 2206
Supported board: mpu
[Component]
Component: system
Description: system package
# Load the system image to start the Comware system.
<boot> install load flash:/system.bin
Check package flash:/s5820v2_5830v2-cmw710-system-t2206.bin ...
Extracting package ...
Loading...
Line con1 is available.
Press ENTER to get started.
After you press Enter, the following information appears:
<System>
<System>%Sep 23 18:29:59:777 2012 S58.59 SHELL/5/SHELL_LOGIN: TTY logged in from con1.