81
HUAWEI TECHNOLOGIES CO., LTD. www.huawei.com Huawei Confidential Security Level: Internal Use On 22/3/24 Mo Qiuju /57859 Topic on Solaris 10

Topic-on-Solaris-10

Embed Size (px)

DESCRIPTION

Solaris operation system 10

Citation preview

Topic on Solaris 10Topic on Solaris 10
Preface
This course is developed on the basis of common requirement on knowledge about Solaris 10 operating system for technical service engineers.
This course is used for engineers to improve the management and application capabilities of Solaris 10 operating system.
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential
Study Guide
The main part of this course is common operations of Solaris 10 operating system and the difficulty lies in troubleshooting on Solaris 10 operating system.
HUAWEI TECHNOLOGIES CO., LTD.
Know main delivered hardware of the workstation
Know the evolvement of Solaris, Sybase and T2000 and describe differences and features between solaris10 and solaris8
Understand common operations, common maintenance commands and application of basic tools of Solaris operating system
Troubleshoot common problems
Troubleshooting on Solaris 10
HUAWEI TECHNOLOGIES CO., LTD.
HUAWEI TECHNOLOGIES CO., LTD.
Blade2500
T2100
T2000/T2100 HA System (Sun Cluster)
Netra240+3310 disk array
SUN Fire V890 or SUN Fire V490
T2000 HA System (VERITAS Warm Standby)
SUN Fire V890 or SUN Fire V490
HUAWEI TECHNOLOGIES CO., LTD.
The basic configuration of SUN workstation includes:
Host
CD-ROM
T2000/T2100 single system software
T2000/T2100 HA system software
The hardware changes very fast and the red means that they are recommended hardware.
HUAWEI TECHNOLOGIES CO., LTD.
Q2: Describe standard workstations equipped with delivered T2000.
Q3: Describe basic software and hardware configurations of SUN workstation.
Q1:refer to P7;
Q2:refer to p8;
Q3:refer to P9;
Models of SUN
HUAWEI TECHNOLOGIES CO., LTD.
Troubleshooting on Solaris 10
HUAWEI TECHNOLOGIES CO., LTD.
Versions of Solaris and matching relations with T2000 and Sybase
Differences between Solaris10 and Solaris 8
HUAWEI TECHNOLOGIES CO., LTD.
Main features:
HUAWEI TECHNOLOGIES CO., LTD.
Application Program
The original shell was the Bourne shell, sh. Every Unix platform will either have the Bourne shell, or a Bourne compatible shell available. It has very good features for controlling input and output, but is not well suited for the interactive user. To meet the latter need the C shell, csh, was written and is now found on most, but not all, Unix systems. It uses C type syntax, the language Unix is written in, but has a more awkward input/output implementation. It has job control, so that you can reattach a job running in the background to the foreground. It also provides a history feature which allows you to modify and repeat previously executed commands.
The default prompt for the Bourne shell is $ (or #, for the root user). The default prompt for the C shell is %.
Numerous other shells are available from the network. Almost all of them are based on either sh or csh with extensions to provide job control to sh, allow in-line editing of commands, page through previously executed commands, provide command name completion and custom prompt, etc. Some of the more well known of these may be on your favorite Unix system:
the Korn shell, ksh, by David Korn and the Bourne Again SHell, bash, from the Free Software Foundations GNU project, both based on sh;
the T-C shell, tcsh, and the extended C shell, cshe, both based on csh. Below we will describe some of the features of sh and csh so that you can get started.
Execute a shell script
sh [csh] XXXX[.sh]
or ./XXXX[.sh]
ls –l to check the executable permission and owner, pay attention to current shell.
A example of sh script
#!/usr/bin/sh
Select_Language()
do
read LANGUAGE
Tree level or structure
Function of creating, copying and deleting file and file tree
Dynamic accretion of file
Peripheral (printer, disk etc.) and directory treated as file
HUAWEI TECHNOLOGIES CO., LTD.
bin
dev
etc
opt
var
cdrom
sh
csh
rc3.d
sybase
tmp
T2000
client
server
usr
Bin is used to install Shell files.
Dev is used to install device files.
Etc is used to install system configuration files which are very important.
Usr is the default father directory of the users.
Opt is used to install some useful software for example Sybase.
Tmp in var is a temporary directory which will be empty after reboot.
Cdrom is the directory of CDROM device.
Green means the software or directory are installed by the user not part of Solaris.
The files in Solaris are very important. Please don’t change them, otherwise the OS will die.
HUAWEI TECHNOLOGIES CO., LTD.
UNIX File Permission
-rwx r-x r-- 2 reed t2000 32 Oct 17 15:33 a.txt
111
101
100
7
5
4
other
group
owner
owner
group
other
In this example, the file named service is an ordinary file.
The owner named eed of this file has the permission of read, write and execute.
The members in group named in have the permission of read and execute.
The other uses only have the permission of read.
If we name yes as 1 and no as 0, then rwx is yesyesyes, accordingly the permission of the owner is 111 (i.e. 7 in Decimal).
And the permission of the group is 101 (i.e. 5 in Decimal), the permission of others is 100 (i.e. 4 in Decimal)
In this way, we can say the permission of this file is 754.
The file information includes the mode, permission, link information, owner, group, size, last modification (time). If the file is a symbolic link, an arrow (-->) precedes the pathname of the linked-to file.
The meanings of mode are as follow:
d directory
- plain file
s socket file
The example of the slide means that a.txt is a plain file, owner is reed, group is t2000, size is 32 bytes, the latest modification time is Oct 17 15:33.
The most important is permission.
For the file a.txt, it allows the user(owner) reed to read, write and excute; other users except reed in the t2000 group assigened to the file to read and excute; users on the system only to read.
HUAWEI TECHNOLOGIES CO., LTD.
Shell
The shell sits between you and the operating system, acting as a command interpreter. It reads your terminal input and translates the commands into actions taken by the system. The shell is analogous to command.com in DOS.
There are several types of shell: B Shell, K Shell, C Shell.
Sh( B shell) uses the startup file .profile and the default prompt is $; Csh uses the startup files .cshrc and .login, the default prompt is %.
Normally the default shell is Bourne Shell. To change shell, just input corresponding shell command. For example, input “ksh” to change to Korn shell in B shell.
The shell sits between you and the operating system, acting as a command interpreter. It reads your terminal input and translates the commands into actions taken by the system. The shell is analogous to command.com in DOS. When you log into the system you are given a default shell. When the shell starts up it reads its startup files and may set environment variables, command search paths, and command aliases, and executes any commands specified in these files.
The original shell was the Bourne shell, sh. Every UNIX platform will either have the Bourne shell, or a Bourne compatible shell available. It has very good features for controlling input and output, but is not well suited for the interactive user. To meet the latter need the C shell, csh, was written and is now found on most, but not all, UNIX systems. It uses C type syntax, the language UNIX is written in, but has a more awkward input/output implementation. It has job control, so that you can reattach a job running in the background to the foreground. It also provides a history feature which allows you to modify and repeat previously executed commands.
The default prompt for the Bourne shell is $ (or #, for the root user). The default prompt for the C shell is %.
Numerous other shells are available from the network. Almost all of them are based on either sh or csh with extensions to provide job control to sh, allow in-line editing of commands, page through previously executed commands, provide command name completion and custom prompt, etc. Some of the well known of these may be on your favorite UNIX system:
the Korn shell, ksh, by David Korn and the Bourne Again Shell, bash, from the Free Software Foundations GNU project, both based on sh;
the T-C shell, tcsh, and the extended C shell, cshe, both based on csh. Below we will describe some of the features of sh and csh so that you can get started.
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential
Environment Variables
Environment variables are used to provide information to the programs you use. The following information are example: display mode, default editor, terminal type, resource configuration of serial ports and network cards, login user name, hostname, group name, path, prompt.
2 types: global environment and local shell variables. Global environment variables are available in every Shell, but local shell variables are available only in one Shell.
Common environment variables of NMS:
PATH:Paths to be searched for commands
SYBASE:Sybase installation path,normally, SYBASE=/opt/sybase
T2000DBServer:Sybase Server Name
Query the value of environment variables:
input echo $ environment variable name
Eg. echo $ IMAP
Solaris 2.7
Solaris 2.9
Not used.
Solaris 2.10
The latest version, which T2000/T2100 will switch to, is the main version now.
Execute the following command line in terminal window:
showrev
The prompt information include OS Release, which minus 3 equal Solaris version. If OS Release is 5.5.1, then Solaris version is 2.5.1. If OS Release is 5.6, then Solaris version is 2.6, also called Solaris 6.
HUAWEI TECHNOLOGIES CO., LTD.
The database since Solaris10 starts to be switched to Sybase12.5.
The T2000V2R2 and V2R3 start to support Solaris10 and Sybase12.5 as well as Solari8 and Sybase12.0.
The T2100V2R1 starts to match Solaris10 and Sybase12.5 and no longer supports Solaris8 abd Sybase11.9.2.
When the NMS is upgraded, pay attention to the matching relations with the operating system and database.
HUAWEI TECHNOLOGIES CO., LTD.
Persistent availability: Predictive Self Healing
Incomparable security: Process Rights Management,Crypto Infrastructure
Optimized utilization: N1 Grid Containers
HUAWEI TECHNOLOGIES CO., LTD.
solaris10
solaris8
/etc/ftpusers /opt/sybase/interfaces ip Denoted in hexadecimal format
The version of Solaris 10 graphic operation interface is upgraded to 1.6, but that of Solaris 8 is 1.4.
Solaris 10 features the SMC function and is a graphic operation interface. SMC can be used to create new users. In Solaris 8, SMC is called Admintool.
The following functions are implemented by Solaris 10: container, built-in SSH2, Dynamic Tracing and x86. Solaris 8 does not feature these functions.
The last difference relates to technical service. Some files in Solaris 10 are saved in different directories, compared with Solaris 8. The IP display mode also changes.
HUAWEI TECHNOLOGIES CO., LTD.
Question
Q1: Describe the levels of structure of the UNIX file system.
Q2: Which versions of the T2000 and T2100 start to support Solaris 10 respectively? What Sybase versions match Solaris 10?
Q3: Where are Solaris 10 and Solaris 8 saved?
Q1:Three level, refer to slide P18
Q2:T2000:V2R2;T2100:V2R1;Sybase 12.5
Q3:Solaris 10:/etc/ftpd/ftpusers
Solaris 8:/etc/ftpusers
System structure and basic concept of Solaris
Versions of Solaris and matching relations with T2000 and Sybase
Differences between Solaris10 and Solaris 8
HUAWEI TECHNOLOGIES CO., LTD.
Troubleshooting on Solaris 10
HUAWEI TECHNOLOGIES CO., LTD.
Normal operation for Engineering
Normal operation for Maintenance
Start a terminal window
Enable/disable ftp or telnet, the use of ftp or telnet
Control Keys
Power-off and Restart the sun workstation
HUAWEI TECHNOLOGIES CO., LTD.
Host
CD-ROM
Sun Netra240
The hardware changes very fast and the red means that they are recommended hardware.
HUAWEI TECHNOLOGIES CO., LTD.
The software of SUN workstation in default configuration includes:
Solaris operating system: the fundamental software of operating system of SUN workstation
CDE (Common Desktop Environment): providing graphic user interface
Additional software needed when SUN workstation is used in the NM includes:
Sybase database system: providing database service
NM program
Two ways to turn on the host of Sun workstation:
Turn on the power switch of the host
Press the Power button on the top-right corner of the keyboard
HUAWEI TECHNOLOGIES CO., LTD.
Installation Preparations
Before you install the T2000 system, make sure that the preparations for the software, hardware and environment are done.
The T2000's software and hardware running environment is strictly selected and tested.
Hardware Installation
Installing the Operating System Solaris 10
Press STOP+A. The ok prompt is displayed.
Insert the CD/DVD for Solaris 10 Software 1 (01/06 SPARC Platform Edition).
Notes:
Divide disk According to the divided requirement of disk in Installation Guide
More detail installation step refer to the T2000/T2100 Installation Guide
HUAWEI TECHNOLOGIES CO., LTD.
Confirm the Solaris 10 has been installed
Configure the operation system
Install the T2000
Install T2000 License
Enabling the Northbound Interface (Optional)
Creating a Disk Mirror (Optional)
Verifying the Installation
More detail installation step refer to the T2000/T2100 Installation Guide
HUAWEI TECHNOLOGIES CO., LTD.
Two ways to open the terminal window:
Click the terminal window icon on the bottom of the screen (the name is “this host”)
Right-click at the blank place of screen, a menu will pop out. Choose “Hosts” -> “Terminal Console” in the menu
Two ways to close the terminal window:
Type command ”exit” behind the prompt in terminal window
Double click the top-left corner of terminal window
HUAWEI TECHNOLOGIES CO., LTD.
Disable/Enable telnet server in Solaris10:
(Only the root user has the right to do it)
# svcadm disable network/telnet
# svcadm enable network/telnet
( Only the root user has the right to do it )
# svcadm disable network/ftp
# svcadm enable network/ftp
steps
a) enable the ftp and telnet function only by root user
# svcadm enable telnet
# svcadm enable ftp
b) enable telnet connection and enable ftp connection of a special user
#root
enable telnet connection -- Change the /etc/default/login file and add # before CONSOLE=/dev/console to:
# CONSOLE=/dev/console
enable ftp connection of a special user– Change the /etc/ftpd/ftpusers file and add # before the user name. To enable ftp connection of the root user, add # before root: #root
To get a file from Workstation B (/usr/home), execute the following commands in WS A:
% ftp IP address of B
User name: t2000
Password: XXXX
1) ftp>ascii (ascii mode is used to transfer text files while bin mode to executable files.)
2) ftp>cd /usr/t2000
3) ftp>lcd /usr/t2000
4) ftp>get filename
(a) Disable telnet and ftp connection of a special user.
Disable telnet connection—Change the /etc/default/login file and remove # before #CONSOLE=/dev/console to:
CONSOLE=/dev/console
Disable ftp connection of a special user– Change the /etc/ftpd/ftpusers file and remove # before the user name. To disable ftp connection of the root user, remove # before root.
(b) Disable ftp and telnet functions.
Only the root user is authorized to perform this operation.
# svcadm disable telnet
# svcadm disable ftp
Use ftp to Transfer Files
Application scenario: File transfer is needed between two workstations or between a workstation and a PC. In this event, the ftp function is needed. Before using ftp, make sure that the ftp function of two computers that transfer files to each other is enabled.
Example: Transfer a file from a PC to a workstation
“Start” “Run” cmd (necessary for a PC and unnecessary for a workstation)
ftp ip address
Type in the user name and password.
ftp> ascll (transfer mode: text file in ascll mode; other files in bin mode)
ftp>cd /aaa (directory of files in the workstation)
ftp>lcd d:\
ftp>put bbb (bbb refers to the file name. To obtain a file from the workstation, replace put with get.)
ftp>bye (ftp ends.)
Notes: When ftp is used to transfer files, the ASCII file can be transferred in binary format. However, the binary file cannot be transferred in ASCII format. Otherwise the contents of the binary file may be destroyed and may not be used.
HUAWEI TECHNOLOGIES CO., LTD.
Use of Telnet
Application scenario: When the workstation server is placed remotely or the server cannot be randomly used, you need to log in to the server remotely on the client (PC or workstation) to perform some operations. After remote login by using the Telnet function, using the workstation server is the same as using the local workstation.
Procedure for Telnet
“Start” “Run” cmd (necessary for a PC and unnecessary for a workstation)
telnet server IP address
Type in the user name and password.
Precaution: Telnet cannot be used to open graphic interface program. For example, T2000DM tool and T2000 monitor client need open these graphic interface programs on the local server.
HUAWEI TECHNOLOGIES CO., LTD.
Control+D
Control+S
Control+Q
Stop + A
HUAWEI TECHNOLOGIES CO., LTD.
Application scenario
The tar command combines files into one device or filename for archiving purposes. The tar command does not compress the files; it merely makes a large quantity of files more manageable.
Syntax
Common Options
c create an archive (begin writing at the start of the file)
t table of contents list
x extract from an archive
v verbose
Example
tar cvf aaa.tar aaa (In current directory, dump all the files and sub-directories in aaa directory to aaa.tar in the current directory)
tar xvf aaa.tar (restore aaa.tar into the current directory)
HUAWEI TECHNOLOGIES CO., LTD.
compress and uncompress command
When a file has been compressed using the compress command, a suffix of .Z is appended to the file name.
Syntax
Gzip and gunzip command
Gunzip restores the files originally compressed by gzip. When a file has been compressed using the gzip command, a suffix of .gz is appended to the file name.
Syntax :
Example:
gzip aaa gunzip aaa.gz
The compress command is used to reduce the amount of disk space utilized by a file. When a file has been compressed using the compress command, a suffix of .Z is appended to the file name. The ownership modes and access and modification times of the original file are preserved. Uncompress restores the files originally compressed by compress.
Syntax:
Common Options:
-c write to standard output and don't create or change any files
-f force compression of a file, even if it doesn't reduce the size of the file or if the target file (file.Z) already exists.
-v verbose. Report on the percentage reduction for the file.
Examples:
% compress abc454
The filename is abc454.Z after compression. To uncompress it, you can use:
% uncompress abc454.Z
Pack and unpack command
When a file has been compressed using the pack command, a suffix of .z is appended to the file name.
Syntax: pack name unpack name
Example: pack aaa unpack aaa.z
zip and unzip command
unzip restores the files originally compressed by zip. When a file has been compressed using the gzip command, a suffix of .zip is appended to the file name.
Syntax :
Example:
HUAWEI TECHNOLOGIES CO., LTD.
Steps
Execute “cd /T2000(T2100)/server/bin”
Execute “./t2000server”(./startserver.sh) to start T2000(T2100);
Execute “./showt2000server”(./show_server) to check the running status of T2000 server(T2100 server). If returned value includes the process and PID for each related process of T2000(T2100) , that is to say , the T2000 server(T2100 server) is running.
Execute ”./shutdownserver”(./stopserver.sh) to shutdown T2000(T2100)
HUAWEI TECHNOLOGIES CO., LTD.
1) Use “su” to enter the root authority of superuser
2)Excute “sync” several times to write the data from memory to disk
3) Run “shutdown -y -g0 -i0” to return to “ok” prompt, then switch off the host, or type command “power-off”, or press Ctrl+Alt+ Power keys to switch off the system power.
4)Run “shutdown -y -g0 -i5” to power-off directly.
Methods to restart are as follows:
Run command “reboot” under superuser root
Run “init 0” to enter prompt “ok”, then type “boot”
Run “shutdown -y -g0 –i6”
HUAWEI TECHNOLOGIES CO., LTD.
Modify the hostname
Configure the default network route
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential
switch user
Two methods
Method1:su xxx
Method2:su – xxx
Method1 is used to switch user in the current environment variables;
Method 2 is used to switch user completely .(recommend to use)
Example:
Directory Navigation and Control
The UNIX file system is set up like a tree branching out from the root. The root directory of the system is symbolized by the forward slash (/). System and user directories are organized under the root. The following table summarizes some directory navigation commands.
Command/Syntax
list directory contents or file permissions
mkdir [options] directory
make a directory
Example: % pwd
%cd / changes directory to the system's root
%cd .. goes up one directory level
make a directory ---mkdir
Ls ---list directory contents
Syntax: ls [options] [parameter]
-a lists all files, including those beginning with a dot (.),such as .login
-l long listing lists the mode, link information, owner, size, last modification (time). If the file is a symbolic link, an arrow (-->) precedes the pathname of the linked-to file.
Example: ls –l
Return value: drwxr-xr-x 2 t2000 ems 512 May 3 13:58 T2000/
Explanation :For the directory T2000, it allows the user (owner) t2000 to read, write and execute; other users except t2000 in the UNIX group assigened to the file to read and execute; users on the system only to read.
HUAWEI TECHNOLOGIES CO., LTD.
Usage structure for command line is:
Command [Option] [Parameter]
Command -[Option 1][Option 2][Option 3][ ...]
For example: ls –alF
Command -[Option 1] -[Option 2] -[Option 3] -[ ...]
For example: ls -a -l –F
Command line is sensitive to lowercase or capital.
“” means space
mkdir Create directory
cp/rcp Copy files
rmdir Delete directory
mv Move file or change file name
man Obtain help information on command
su Switch user
touch Used to create a file, for example: touch a.txt
find Recursively search the indicated directory tree to find files
matching a type or pattern you specify
grep Search specified string in the whole text file
chmod Change access authority over file
chown Change the ownership of a file
chgrp Change the group of the file
cat Display the contents of a file with the concatenate command
more/less/pg Page through a text file
head/tail Display the head/tail N lines of a file
echo Repeat the characters you give to the standard output, for
example: echo $SYBASE
System Resource Commands
df Summarize disk block and file usage, for example: df -k
du Report disk space in use, for example: du –k /usr/t2000
who Provide a listing of users accessing the system
which Display the path of the shell files
date Configure or display the time and date
env Display or configure the current environment variables
tar Combines files into one file for archiving purposes
compress/uncompress Compress/uncompress a file
HUAWEI TECHNOLOGIES CO., LTD.
uname Display the computer’s information
hostname Configure or display the hostname
hostid Display the hostid
id Display the ID and name of the user and group
pkginfo Check the installed software package
pkginfo –l xxx Check the detailed information of the software package
showrev Check the Solaris version, for example: showrev -p
HUAWEI TECHNOLOGIES CO., LTD.
uname Display the computer’s information
hostname Configure or display the hostname
hostid Display the hostid
du Report disk space in use, for example: du –k /usr/t2000
id Display the ID and name of the user and group
pkginfo Check the installed software package
pkginfo –l xxx Check the detailed information of the software package
showrev Check the Solaris version, for example: showrev -p
HUAWEI TECHNOLOGIES CO., LTD.
Query the hardware information
Syntax: prtdiag
Example: %prtdiag
Return value: the clock frequency, the amount of memory , CPU information, I/O information
Query the basic information of system
Syntax: uname –a,hostname,hostid
Example: %uname –a
Query the information of system patch
Execute showrev –p | grep patch number to query the pacth whether it has been installed.
Example: #showrev -p | grep 117350
Return value:
SUNWcarx, SUNWcar, SUNWcsr, SUNWpmu, SUNWpmux, SUNWhea
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential
Controlling Processes
Generally speaking, a process is a running task. The UNIX system realizes time-sharing multi-tasks by controlling, provisioning and storage management of the processes.
Every process on a UNIX system has a integer as process ID, or PID which is exclusive.
Common commands
ps show status of active processes, for example: ps –ef
kill terminate a process, for example: kill -9 213
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential
Modifying Hostname
Modify /etc/nodename file, input the new hostname. If the new hostname is Primary, input Primary in nodename file.
Open /etc/hostname.interface file, change the old hostname to the new one.
Notes: interface is the name of network card + a integer, for example: eri + 0 = eri0.
There is at least one hostname.interface0 file in /etc.
Modify /etc/inet/hosts and /etc/hosts files, change the old hostname to the new one.
Modify /etc/inet/ipnodes files,change the old hostname to the new one.
HUAWEI TECHNOLOGIES CO., LTD.
#ifconfig name of network card device plumb
#ifconfig name of network card device IP netmask up
Example: #ifconfig bge0 10.77.30.105 255.0.0.0 up
Permanent configuration of IP address ( validated after restart ):
Modify /etc/inet/ipnodes file
Modify /etc/hosts file, the content is IP tab character string
Modify /etc/netmasks file, writting the corresponding netmask of IP
Query the IP address and MAC address
ifconfig a
return value:
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.72.86.11 netmask ff000000 broadcast 10.255.255.255 ether 0:3:ba:18:40:62
HUAWEI TECHNOLOGIES CO., LTD.
Application scenario: default route is configured in routine maintenance where one workstation is used to log in to other remote workstation in different LANs.
Procedure
a.route add default 129.9.1.254 1
The parameter route indicates the route management command; add indicates adding route option; default indicates the default route; 129.9.1.254 indicates the IP address of the internal port of the local network; 1 refers to the hop number.
b. Run the netstat –nr command to query the added default route in the system route table. In this event, NEs at other network segments can be pinged through.
c. To facilitate the system to automatically add the default route when the system is restarted every time, create the defautrouter file in the /etc directory and write in the IP address of the relevant route port (take 129.9.1.254 as an example)
vi /etc/defaultrouter
Huawei Confidential
Tools --Vi
Application scenario: vi command is a powerful tool for editing text file in UNIX, it can create and modify the text file.vi has two basic modes for manipulating text, command mode and text entry mode. When you start vi, you will be in command mode until you enter one of the text entry commands, such as i, a, s, or o, which are explained in Entering Text with vi.
To create a file named myfile and open it for editing, use this command: vi filename
control command
ESC Key: switch between Command mode and text input mode
b: cursor go to the beginning of last word
X: delete a word dd: delete an row
i: Insert the text at the location before the cursor(insert)
j:Move the cursor to up
k:Move the cursor to down
l:Move the cursor to right
o: insert the text in the next line where the cursor is(open)
:wq:Save and exit :w! :Only save, no exit
:q! :Force exit without save
:e ! : reedit the file again without change
HUAWEI TECHNOLOGIES CO., LTD.
Tools --Use of Snapshot Tool
Application scenario: when window snap or screen snap on a workstation is needed
Procedure
Right-click the desktop and choose Application > Snapshot to enable the snapshot program.
Choose Hide the window during snapshot. Click the window to snap or choose the screen. Snapshot is complete after waiting for eight seconds.
On the graphic viewer, choose File > Save as jpeg. Note: When typing in the file name, do type in the suffix name like XXXX.jpg(jpeg).
HUAWEI TECHNOLOGIES CO., LTD.
In the /opt/haT2000-veritas-scripts/Monitor directory of the Veritas HA system, the Veritas_Explorer.pl data collection script exists. Run the script to check the status of the HA system and collect data.
It takes about 10 minutes to complete data collection and the size of the files is about 8M.
As some data collected is large, the data should be divided and then transmitted. The WinRAR function is available.
HUAWEI TECHNOLOGIES CO., LTD.
Application scenario: graphic interfaces of common operations on the workstation
admintool in Solaris8 is changed to smc in Solaris10. Compared with admintool, smc features better expansion performance. smc does not provide specific functions, but provides interfaces that access these functions.
Assign authority and role for users.
Create and carry out the user policy.
View the system log and find out abnormal or doubtful log records.
Create a mail list.
Configure and format the new system disk, including disk partition and preparation for RAID configuration disk copy.
Enable the smc tool
Question
Q1: How to open the T2000 or T2100 in the workstation?
Q2: How to enable the ftp and telnet functions?
Q3: How to use the VI editor?
Q1:refer to P41
Q2:refer to P34/35
Q3:refer to P60
Normal operation for Engineering
Normal operation for Maintenance
Troubleshooting on Solaris 10
HUAWEI TECHNOLOGIES CO., LTD.
The User Password Is Forgotten
The SH Script Cannot Be Run.
The workstation does not respond to the keyboard and mouse
HUAWEI TECHNOLOGIES CO., LTD.
Problem description:
When a user logs in to CDE, the password is correct, but the system is down after the desktop is displayed.
Problem cause:
The configuration file of Desktop of the user may be damaged.
Solution:
Two methods are available:
Method 1: Use a terminal to log in. Run “rm -rf .dt” and then re-log in to CDE.
Method 2: Create a user and copy some configuration files such as .cshrc, .login, and .dtprofile in the user directory to the new user directory. Then customize the environment and create action icon for the new desktop.
HUAWEI TECHNOLOGIES CO., LTD.
Problem description
After installing Solaris 10 operating system, the engineer press the popup key under the driver, but the CD fails to pop up.
Solution
Type in ./etc/init.d/volmgt stop to take out the CD.
Run the following command to restore the system:
./etc/init.d/volmgt start
The User Password Is Forgotten.
If a common user forgets the password, use the root user to change the password.
(a) Log in to the system as the root user.
(b) Run the passwd command to change the user password.
#passwd user
If the root user password is forgotten, do as follows:
(a) Enter OK and enter the following commands:
#fsck -y /dev/rdsk/c0t0d0s0 (depending on the equipment of the root partition)
#mount -F ufs /dev/dsk/c0t0d0s0 /mnt
#TERM=ansi; export TERM (if using vi is normal, do not use the statement.)
#vi /mnt/etc/shadow
(b) Delete the character between the first and second colons after root. This can delete the password of the root user.
#umount /mnt
HUAWEI TECHNOLOGIES CO., LTD.
Problem description
The .sh script fails to be run on the workstation. The system returns a prompt that the script fails to be run.
Problem cause
The user has no enough authority and is not switched to other relevant user.
The file has no executable authority.
In these two cases, use ls –l XXX.sh (script name) to view the file attribute.
Solution
In case 1, switch the user or change the script host. If the executable authority is insufficient, add the executable authority.
If the script is changed on the PC, check whether the transport mode is correct (ASCII). In addition, use the sh –x xxx.sh debugging mode to check the execution course of the script and analyze the problem.
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential
The workstation does not respond to the keyboard and mouse, so it is nonoperable.
Problem description: The workstation does not respond to the keyboard and mouse, so it is nonoperable.
Problem cause: The process runs abnormally.
Solution: Find out the abnormal process and kill it or restart the workstation. Specifically, do as follows:
(a) Connect another computer (laptop computer, PC or workstation) to this workstation with a network cable. Enter the following command on this computer:
Telnet the IP address of the workstation.
Follow the prompt to type in the rms user name and relevant password and then log in to the workstation.
(b) Find out the abnormal process and kill it.
Enter the following command to find out the possible abnormal process and record the process number:
%ps -ef
%kill -9 process number
If the abnormal process is unclear, kill the dtsession process. Then the workstation interface restarts and enters in the login status.
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential
The workstation does not respond to the keyboard and mouse, so it is nonoperable.
(c) If the workstation is restored after the preceding operations are carried out, restart NMS in the workstation.
If the system remains abnormal, use the following command to restart the workstation:
#/usr/sbin/shutdown -y -g0 -i6
Then the system is restarted.
If no computer connects to the workstation onsite or the computer fails to telnet the workstation due to some reasons, do as follows:
(1) Type in “STOP”+“A”.
(2) When the system displays the “ok” prompt, type in “sync” to restart the system.
Warning:
The preceding operation is bad to the file system, so it is used only when there is no other method. Use fsck to check the file system after the system is restarted.
HUAWEI TECHNOLOGIES CO., LTD.
Question
Q1: How to do when the workstation CD fails to pop up?
Q2: How to do when the sh script fails to be run?
Q3: How to do when the user password is forgotten?
1,70
2,73
3,71
The User Password Is Forgotten
The SH Script Cannot Be Run.
The workstation does not respond to the keyboard and mouse
HUAWEI TECHNOLOGIES CO., LTD.
Introduction to server hardware
Troubleshooting on Solaris 10