- 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-ISSU configuration
- 09-Emergency shell configuration
- 10-Automatic configuration
- 11-Device management configuration
- 12-MDC configuration
- 13-TCL configuration
- 14-License management
- Related Documents
-
Title | Size | Download |
---|---|---|
09-Emergency shell configuration | 122.97 KB |
Contents
Obtaining a system image from an FTP/TFTP server
Configuring the management Ethernet port
Checking the connectivity to a server
Displaying device information in emergency shell mode
At startup, the device tries to locate and load the Comware startup software images, which might include a boot image, a system image, some feature images, and some patch images. If the startup boot image is OK but the startup system image or any startup feature or patch image is missing or corrupted, the device enters emergency shell mode.
After the device enters emergency shell mode, you can log in through the console port and get and load a system image to start the Comware system. After the Comware system is started, you can load feature images and patch images as described in "Upgrading software", "Performing an ISSU by using issu series commands", or "Performing an ISSU by using install series commands." This chapter describes how to get and load the system image in emergency shell mode.
If the device has two MPUs, the two MPUs start up independently. If one MPU enters emergency shell mode, log in to that MPU through its console port to load a system image for it.
For more information about software images, see "Upgrading software." For more information about how to log in through the console port, see "Logging in through the console port for the first device access."
Managing the file system
The emergency shell provides some basic file system management commands for managing the files on the device's storage media. You can use these commands to manage the file system.
|
IMPORTANT: · A file deleted by using the delete command cannot be restored. · The format command permanently deletes all files and folders from a storage medium, and the deleted files and folders cannot be restored. |
To manage the file system, execute the following commands in user view:
Task |
Command |
Remarks |
Display files or folders. |
dir [ /all ] [ file-url ] |
N/A |
Create a folder on a storage medium. |
mkdir directory |
The parent folder must already exist. For example, to create folder flash:/test/mytest, the parent folder test must already exist on the Flash. The name for the new folder must be unique under the parent folder. |
Display the current path. |
pwd |
N/A |
Copy a file. |
copy fileurl-source fileurl-dest |
N/A |
Move a file. |
move fileurl-source fileurl-dest |
The target folder must have enough space for the file. |
Display the contents of a file. |
more file-url |
N/A |
Permanently delete a file. |
delete file-url |
N/A |
Delete a folder. |
rmdir directory |
To delete a folder, first delete all files and child folders in the folder. |
Format a storage medium. |
format medium-name |
N/A |
Obtaining a system image from an FTP/TFTP server
If the required system image is saved on an FTP or TFTP server, configure the management Ethernet port and obtain the system image as described in the following sections.
The version of the system image must match that of the boot image. Before obtaining a system image, check the version of the boot image by using the display version command and the version of the system image by reading the release notes.
Configuring the management Ethernet port
To use FTP, TFTP, SSH, and Telnet services in emergency shell mode, you must configure an IP address for the management Ethernet port and activate the port at first. If the servers are on a different network, you must also specify a gateway for the management Ethernet port.
To configure the management Ethernet port on an IPv4 network:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enter management Ethernet port view. |
interface m-eth0 |
N/A |
3. Assign an IPv4 address to the port. |
ip address ip-address { mask-length | mask } |
By default, the management Ethernet port has no IPv4 address. |
4. Specify an IPv4 gateway for the port. |
ip gateway ip-address |
By default, the management Ethernet port has no IPv4 gateway configured. |
5. Activate the port. |
undo shutdown |
By default, the management Ethernet port is active. |
6. Return to system view. |
quit |
N/A |
To configure the management Ethernet port on an IPv6 network:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enter management Ethernet port view. |
interface m-eth0 |
N/A |
3. Assign an IPv6 address to the port. |
ipv6 address ipv6-address prefix-length |
By default, the management Ethernet port has no IPv6 address. |
4. Specify an IPv6 gateway for the port. |
ipv6 gateway ipv6-address |
By default, the management Ethernet port has no IPv6 gateway configured. |
5. Activate the port. |
undo shutdown |
By default, the management Ethernet port is active. |
6. Return to system view. |
quit |
N/A |
Checking the connectivity to a server
After completing network parameter configuration, you can use the ping command to check the connectivity between the device and the intended FTP or TFTP server.
To check the connectivity between the device and a server on an IPv4 network, execute the following command in any view:
Task |
Command |
Check the connectivity to an IPv4 address |
ping [ -c count | -s size ] * ip-address |
To check the connectivity between the device and a server on an IPv6 network, execute the following command in any view:
Task |
Command |
Check the connectivity to an IPv6 address |
ping ipv6 [ -c count | -s size ] * ipv6-address |
Accessing the server
In emergency shell mode, the device can:
· Operate as an FTP or TFTP client to download software packages from an FTP or TFTP server.
· Operate as an FTP or TFTP client to upload software packages to an FTP or TFTP server.
· Operate as a Telnet or SSH client so you can log in to a server to, for example, view and manage files on the server.
If you cannot connect to an SSH server from the device because the server has changed its public key, use the reset ssh public-key command to delete all locally saved server public keys and then try again.
To access a remote IPv4 server, execute one of the following commands as appropriate in user view:
Task |
Command |
Use FTP to download a file from or upload a file to an IPv4 server. |
ftp server-ipv4-address user username password password { get remote-file local-file | put local-file remote-file } |
Use TFTP to download a file from or upload a file to an IPv4 server. |
tftp server-ipv4-address { get remote-file local-file | put local-file remote-file } |
Telnet to an IPv4 server. |
telnet server-ipv4-address |
Use SSH to connect to an IPv4 server. |
ssh2 server-ipv4-address |
To access a remote IPv6 server, execute one of the following commands to obtain a system image in user view:
Task |
Command |
Use FTP to download a file from or upload a file to an IPv6 server. |
ftp ipv6 server-ipv6-address user username password password { get remote-file local-file | put local-file remote-file } |
Use TFTP to download a file from or upload a file to an IPv6 server. |
tftp ipv6 server-ipv6-address { get remote-file local-file | put local-file remote-file } |
Telnet to an IPv6 server. |
telnet ipv6 server-ipv6-address |
Use SSH to connect to an IPv6 server. |
ssh2 ipv6 server-ipv6-address |
Loading the system image
|
IMPORTANT: The version of the system image must match that of the boot image. Before loading a system image, use the display version and display install package commands to check the version information of the boot image and system image. |
When you load the system image, the system modifies the main startup software image set to include only the boot image and system image so the device can reboot normally.
To load the system image, execute the following command in user view:
Task |
Command |
Load a system image. |
install load system-package |
Rebooting the device
To reboot the device, execute one of the following commands as appropriate in user view:
Task |
Command |
Reboot the current MPU. |
reboot |
Displaying device information in emergency shell mode
Execute display commands in any view.
Task |
Command |
Display copyright information. |
display copyright |
Display software package information. |
display install package package |
Display management Ethernet port 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 example
Network requirements
The device has only the boot image and enters emergency shell after startup. The device and PC can reach each other.
Use the TFTP client service on the device to download the system image from the PC and start the Comware system on the device.
Figure 1 Network diagram
Usage procedure
# Check which files are stored and how much space is available on the storage medium of the device.
<boot> dir cfa0:/
Directory of cfa0:
0 -rw- 2709 Dec 24 2011 15:38:50 vlantest.txt
1 -rw- 2709 Dec 27 2011 11:17:24 vlantest2.txt
2 -rw- 29450240 Jan 14 2012 20:17:38 boot-a7122.bin
3 -rw- 439291 Jan 12 2012 14:50:00 diatest.txt
4 drw- - Jan 14 2012 22:19:56 test
249537 KB total (222847 KB free)
The output shows that the device has a boot image but does not have the matching system image, and the available space is 222847 KB, enough for saving the system image.
# Check the version information of the boot image.
H3C Comware Software
Copyright (c) 2004-2012 Hangzhou H3C Tech. Co., Ltd. All rights reserved.
H3C S12508 uptime is 0 weeks, 0 days, 0 hours, 13 minutes
Last reboot reason : User reboot
Boot image: cfa0:/s12500-cmw710-boot-a7122.bin
Boot image version: 7.1.028
CPU: e500v2 with 1 Processor
2560M bytes SDRAM
128M bytes Nor Flash Memory
247M bytes CFA Memory
# Configure an IP address and a gateway for the management Ethernet port.
<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
# Test the connectivity between the device and the TFTP server.
<boot> ping 1.2.1.1
PING 1.2.1.1(1.2.1.1):56 data bytes
64 bytes from 1.2.1.1:seq=0 ttl=64 time=0.160 ms
64 bytes from 1.2.1.1:seq=1 ttl=64 time=0.062 ms
64 bytes from 1.2.1.1:seq=2 ttl=64 time=0.061 ms
64 bytes from 1.2.1.1:seq=3 ttl=64 time=0.065 ms
64 bytes from 1.2.1.1:seq=4 ttl=64 time=0.063 ms
--- 1.2.1.1 ping statistics ---
5 packets transmitted,5 packets received,0% packet loss
round-trip min/avg/max = 0.061/0.082/0.160 ms
# Download the file system.bin from the TFTP server.
<boot> tftp 1.2.1.1 get system.bin cfa0:/system.bin
# Check whether the version of system.bin matches that of boot.bin.
<boot> display install package cfa0:/system.bin
cfa0:/system.bin
[Package]
Vendor: H3C
Product: ****
Service name: system
Platform version: 7.1.028
Product version: Alpha 7122
Supported board: mr, lc, sfc
[Component]
Component: system
Description: system package
# Load the system image to start the Comware system.
<boot> install load cfa0:/system.bin
Check package cfa0:/system.bin ...
Extracting package ...
Loading...
System application is starting...
Set bootargs.
CPIO Length: 0x96e7d8.
cpio=0x96e7d8@0x13000000
CPIO Length: 0x96e7d8.
Starting application at 0x02000000 ..HA_Register OK, ulModuleID = 252772352, ulS
ubID = 6.HA_Register OK, ulModuleID = 254803968, ulSubID = 0.HA_Register OK, ulM
oduleID = 252706816, ulSubID = 0.HA_Register OK, ulModuleID = 255983616, ulSubID
= 2.HA_Register OK, ulModuleID = 256442368, ulSubID = 0.HA daemon start as 1 (b
uild Jul 29 2011 11:50:56).
System service initialization completed, cost 28 seconds.
Autorun service initialization completed, cost 5 seconds.
Ondemand service initialization completed, cost 30 seconds.
User interface con1 is available.
Press ENTER to get started.