AIX Command Summary

Snap:Linux现代软件分发与沙箱化运行时详解 Snap 是一种面向 Linux 的声明式软件打包与安全分发机制,其核心在于将应用及其全部依赖封装为自包含的 squashfs 镜像,并通过 mount/pid/network 命名空间、AppArmor 和 seccomp-bpf 构建强隔离沙箱。它解决了传统包管理中的依赖冲突、发行版碎片化和权限失控等根本问题,实现了‘一次构建、随处安装、默认安全’的技术价值。在桌面端支撑 VS Code、Spotify 等主流应用,在服务器与 IoT 场景中提供原子更新与可靠回滚能力。本文深入解析 Snap 的接口(i 阅读详情

Command Summary

Startup, Logoff and Shutdown

<Ctrl>d (exit)               logoff the system (or the current shell).
shutdown                    shuts down the system by disabling all processes. If in single-user mode, may want  to use -F option for fast shutdown. -r option will reboot system. Requires user to be root.

Directories

mkdir make directory
cd  change directory. Default is $HOME directory.
rmdir remove a directory (beware of files starting with ".")
rm remove file; -r option removes directory and all files and
subdirectories recursively.
pwd print working directory
ls list files
-a (all)
-l (long)
-d (directory information)
-r (reverse alphabetic)
-t (sort by time changed)
-C (multi column format)
-R (recursive listing)
-F (places / after each directory name & * after each exec file) 

Files - Basic
cat list file contents (concatenate).
Can open a new file with redirection, for example, cat > newfile.
Use <Ctrl>d to end input.
chmod change permission mode for files or directories.
•chmod =+- files or directories
•(r,w,x = permissions and u, g, o, a = who )
•can use + or - to grant or revoke specific permissions.
•can also use numerics, 4 = read, 2 = write, 1 = execute.
•can sum them, first is user, next is group, last is other.
•for example, "chmod 746 file1" is user = rwx, group = r, other =rw.

chown change owner of a files; for example. chown owner file
chgrp change group of a files
cp copy file
del delete files with prompting (rm for no prompting)
mv move and rename file
pg list file contents by screen (page)
h (help)
q (quit)
<cr> (next pg)
f (skip 1 page)
l (next line)
d (next 1/2 page)
$ (last page)
p (previous file)
n (next file)
. (redisplay current page)
. Current Directory
.. Parent Directory
/string (find string forward), ?string (find string backward), --
(move backward - pages), +- (move forward - pages)
rm remove (delete) files (-r option removes directory and all files and
subdirectories)
head print first several lines of a file
tail print last several lines of a file
wc report the number of lines (-l), words (-w), characters (-c) in a file.
No options gives lines, words, and characters.
su switch user
id displays your user ID environment how it is currently set
tty displays the device that is currently active. Very useful for
Xwindows where there are several pts devices that can be
created. It's nice to know which one you have active. who am i
will do the same.

Files - Advanced
awk programmable text editor / report write
banner display banner (can redirect to another terminal 'nn' with
'>/dev/ttynn')

 cal calendar (cal [month] year)
cut cut out specific fields from each line of a file
diff differences between two files
find find files anywhere on disk. Specify location by path (will search
all subdirectories under specified directory).
-name fl (file names matching fl criteria)
-user ul (files owned by user ul)
-size +n (or -n) (files larger (or smaller) than n blocks)
-mtime +x (-x) (files modified more (less) than x days ago)
-perm num (files whose access permissions match num)
-exec (execute a command with results of find command)
-ok (execute a command interactively with results of find
command)
-o (logical or) -print (display results. Usually included)
find syntax: find path expression action
•for example, find / -name "*.txt" -print
•or find / -name "*.txt" -exec li -l {} /;
(executes li -l where names found are substituted for {})
; indicates end-of-command to be executed and / removes
usual
interpretation as command continuation character)
grep search for pattern, for example, grep pattern files. Pattern can
include regular expressions.
-c (count lines with matches, but don't list)
-l (list files with matches, but don't list)
-n (list line numbers with lines)
-v (find files without pattern)
expression metacharacters
•[ ] matches any one character inside.
•with a - in [ ] will match a range of characters.
•&and. matches BOL when &and. begins the pattern.
•$ matches EOL when $ ends the pattern.
•. matches any single character. (same as ? in shell).
•* matches 0 or more occurrences of preceding character.
(Note: ".*" is the same as "*" in the shell).
sed stream (text) editor. Used with editing flat files.
sort sort and merge files
-r (reverse order); -u (keep only unique lines)
Editors
ed line editor
vi screen editor
INed LPP editor
emacs screen editor +
Shells, Redirection and Pipelining
< (read) redirect standard input; for example, command < file reads input
for command from file.
> (write) redirect standard output; for example, command > file writes
output for command to file overwriting contents of file.
>> (append) redirect standard output; for example, command >> file appends
output for command to the end of file.
2> redirect standard error (to append standard error to a file, use
command 2>> file) combined redirection examples:
•command < infile > outfile 2> errfile
•command >> appendfile 2>> errfile < infile
; command terminator used to string commands on single line
| pipe information from one command to the next command.
for example, ls | cpio -o > /dev/fd0 will pass the results of the ls
command to the cpio command.
/ continuation character to continue command on a new line.
Will be prompted with > for command continuation.
tee reads standard input and sends standard output to both standard
output and a file. For example, ls | tee ls.save | sort results in ls
output going to ls.save and piped to sort command.
Metacharacters
* any number of characters ( 0 or more)
? any single character
[abc] [ ] any character from the list
[a-c] [ ] match any character from the list range
 ! not any of the following characters (for example, leftbox !abc right
box)
; command terminator used to string commands on a single line
& command preceding and to be run in background mode
# comment character
/ removes special meaning (no interpretation) of the following
character
removes special meaning (no interpretation) of character in
quotes
" interprets only $, backquote, and / characters between the
quotes.
' used to set variable to results of a command;
for example, now='date' sets the value of now to current results of
the date command.
$ preceding variable name indicates the value of the variable.
Variables
= set a variable (for example, d=day sets the value of d to day).
Can also set the variable to the results of a command by the '
character;
for example, now=date sets the value of now to the current result
of the date command.
HOME home directory
PATH path to be checked
SHELL shell to be used
TERM terminal being used
PS1 primary prompt characters, usually $ or #
PS2 secondary prompt characters, usually >
$? return code of the last command executed
set displays current local variable settings
export exports variable so that they are inherited by child processes
env displays inherited variables
echo echo a message (for example, echo HI or echo $d).
Can turn off carriage returns with /c at the end of the message.
Can print a blank line with /n at the end of the message.

Tapes and Diskettes
format AIX command to format a diskette
backup backs up individual files.
-i reads file names form standard input
-v list files as backed up;
for example, backup -iv -f/dev/rmto file1, file2
-u backup file system at specified level;
for example, backup -level -u filesystem
Can pipe list of files to be backed up into command;
for example, find . -print | backup -ivf/dev/rmt0 where
you are in directory to be backed up.
restore restores commands from backup
-x restores files created with backup -i
-v list files as restore
-T list files stored of tape or diskette
-r restores filesystem created with backup -level -u;
for example, restore -xv -f/dev/rmt0
cpio copies to and from an I/O device. Destroys all data previously on
tape or diskette. For input, must be able to place files in the same
relative (or absolute) path name as when copied out (can
determine path names with -it option). For input, if file exists,
compares last modification date and keeps most recent (can
override with -u option).
-o (output)
-i (input)
-t (table of contents)
-v (verbose)
-d (create needed directory for relative path names)
-u (unconditional to override last modification date)
for example, cpio -o > /dev/fd0
file1
file2
<Ctrl-d>
or cpio -iv file1 < /dev/fd0
tar alternative utility to backup and restore files
pax alternative utility to cpio and tar commands
 Transmitting
mail send and receive mail. With userid sends mail to userid. Without
userid, displays your mail. When processing your mail, at the ?
prompt for each mail item, you can:
d - delete
s - append
q - quit
enter - skip
m - forward
mailx upgrade of mail
uucp copy file to other UNIX systems (UNIX to UNIX copy)
uuto/uupick send and retrieve files to public directory
uux execute on remote system (UNIX to UNIX execute)
System Administration
df display filesystem usage
installp install program
kill (pid) kill batch process with ID or (pid) (find using ps);
kill -9 (PID) will absolutely kill process
mount associate logical volume to a directory;
for example, mount device directory
ps -ef shows process status (ps -ef)
umount disassociate filesystem from directory
smit system management interface tool
Miscellaneous
banner displays banner
date displays current date and time
newgrp change active groups
nice assigns lower priority to following command
(for example, nice ps -f)
passwd modifies current password
sleep n sleep for n seconds
stty show and or set terminal settings
touch create a zero length files

xinit initiate X-Windows
wall sends message to all logged-in users
who list users currently logged in (who am i identifies this user)
man,info displays manual pages
System Files
/etc/group list of groups
/etc/motd message of the day, displayed at login.
/etc/passwd list of users and sign-on information. Password shown as !.
Can prevent password checking by editing to remove !.
/etc/profile system-wide user profile executed at login. Can override variables
by resetting in the user's .profile file.
Shell Programming Summary
Variables
var=string set variable to equal string. (NO SPACES).
Spaces must be enclosed by double quotes.
Special characters in string must be enclosed by single quotes to
prevent substitution.
Piping (|), redirection (<, >, >>), and & symbols are not
interpreted.
$var gives value of var in a compound
echo displays value of var; for example, echo $var
HOME = home directory of user
MAIL = mail file name
PS1 = primary prompt characters, usually $ or #
PS2 = secondary prompt characters, usually >
PATH = search path
TERM = terminal type being used
export exports variables to the environment
env displays environment variables settings
${var:-string} gives value of var in a command. If var is null, uses string instead.
$1 $2 $3... positional parameters for variable passed into the shell script
$* used for all arguments passed into shell script $# number of arguments passed into shell script
$0 name of shell script
$$ process ID (pid)
$? last return code from a command
Commands
# comment designator
&& logical-and. Run command following && only if command
preceding && succeeds (return code = 0).
|| logical-or. Run command following || only if command preceding
||fails (return code < > 0).
exit n used to pass return code nl from shell script. Passed as variable
$? to parent shell
expr arithmetic expressions
Syntax: expr expression1 operator expression2
operators: + - /* (multiply) / (divide) % (remainder)
for loop for n (or: for variable in $*); for example:
do
command
done
if-then-else if test expression
then command
elif test expression
then command
else
then command
fi
read read from standard input
shift shifts arguments 1-9 one position to the left and decrements
number of arguments
test used for conditional test, has two formats.
if test expression (for example, if test $- -eq 2)
if [ expression ]
(for example, if [ $# -eq 2 ]) (spaces req'd)
integer operators:
-eq (=)
-lt (<)
-le (=<)
-ne (<>)

-gt (>)
-ge (=>)
string operators:
=
!= (not eq.)
-z (zero length)
file status (for example, -opt file1)
-f (ordinary file)
-r (readable by this process)
-w (writable by this process)
-x (executable by this process)
-s (non-zero length)
while loop           while test expression
                             do
                            command
                            done
Miscellaneous
sh execute shell script in the sh shell
-x (execute step by step - used for debugging shell scripts)


vi Editor

Entering vi
vi file edits the file named file
vi file file2 edit files consecutively (via :n)
.exrc file that contains the vi profile
wm=nn sets wrap margin to nn
Can enter a file other than at first line by adding + (last line), +n
(line n), or +/pattern (first occurrence of pattern).
vi -r lists saved files
vi -r file recover file named file from crash
:n next file in stack
:set all show all options
:set nu display line numbers (off when set nonu)
:set list display control characters in file
:set wm=n set wrap margin to n
 :set showmode set display of INPUT when in input mode
Read, Write, Exit
:w write buffer contents
:w file2 file2 write buffer contents to file2
:w >> file2 write buffer contents to end of file2
:q quit editing session
:q! quit editing session and discard any changes
:r file2 read file2 contents into buffer following current cursor
:r! com read results of shell command com following current cursor
:! exit shell command (filter through command)
:wq or ZZ write and quit edit session
Units of Measure
h, l character left, character right
k or <Ctrl>p move cursor to character above cursor
j or <Ctrl>n move cursor to character below cursor
w, b word right, word left
&hat., $ beginning, end of current line
<CR> or + beginning of next line
- beginning of previous line
G last line of buffer
Cursor Movements
Can precede cursor movement commands (including cursor arrow) with number of times to
repeat; for example, 9--> moves right 9 characters.
0 move to first character in line
$ move to last character in line
&and. move to first nonblank character in line
fx move right to character x
Fx move left to character x
tx move right to character preceding character x
Tx move left to character preceding character x
; find next occurrence of x in same direction
, find next occurrence of x in opposite direction
w tab word (nw = n tab word) (punctuation is a word)
W tab word (nw = n tab word) (ignore punctuation)
b backtab word (punctuation is a word)
B backtab word (ignore punctuation)
e tab to ending char. of next word (punctuation is a word)
E tab to ending char. of next word (ignore punctuation)
( move to beginning of current sentence
) move to beginning of next sentence
{ move to beginning of current paragraph
} move to beginning of next paragraph
H move to first line on screen
M move to middle line on screen
L move to last line on screen
<Ctrl>f scroll forward 1 screen (3 lines overlap)
<Ctrl>d scroll forward 1/2 screen
<Ctrl>b scroll backward 1 screen (0 line overlap)
<Ctrl>u scroll backward 1/2 screen
G go to last line in file
nG go to line n
<Ctrl>g display current line number
Search and Replace
/pattern search forward for pattern
?pattern search backward for pattern
n repeat find in the same direction
N repeat find in the opposite direction
Adding Text
a add text after the cursor (end with <esc>)
A add text at end of current line (end with <esc>)
 i add text before the cursor (end with <esc>)
I add text before first nonblank char in current line
o add line following current line
O add line before current line
<esc> return to command mode
Deleting Text
<Ctrl>w undo entry of current word
@ kill the insert on this line
x delete current character
dw delete to end of current word (observe punctuation)
dW delete to end of current word (ignore punctuation)
dd delete current line
d erase to end of line (same as d$)
d) delete current sentence
d} delete current paragraph
dG delete current line thru end-of buffer
d&and. delete to the beginning of line
u undo last change command
U restore current line to original state before modification
Replacing Text
ra replace current character with a
R replace all characters overtyped until <esc> is entered
s delete current character and append test until <esc>.
s/s1/s2 replace s1 with s2 (in the same line only)
S delete all characters in the line and append text
cc replace all characters in the line (same as S)
ncx delete n text objects of type x; w, b = words, ) = sentences, } =
paragraphs, $ = end-of-line, &and.=beginning of line) and enter
append mode
C replace all characters from cursor to end-of-line.
Moving Text
p paste last text deleted after cursor (xp will transpose 2 characters)
P paste last text deleted before cursor
nYx yank n text objects of type x w, b = words, ) = sentences, } =
paragraphs, $ = end-of-line, and no x indicates lines. Can then
paste them with "p" command. Yank does not delete the original.
"ayy can use named registers for moving, copying, cut/paste with "ayy
for register a (use registers a-z). Can then paste them with "ap
command.
Miscellaneous
. repeat last command
J join current line w/next line

(重要)AIX command 使用总结.txt AIX常用命令://查看机器序列号,IBM的基本信息都可以通过该命令查询得到 #prtconf #oslevel -r == uname -a //操作系统版本 #oslevel //查看操作系统版本ex :5.1.0.0 #oslevel -r //ex:5100-04 == oslevel -q //双机软件版本号 # lslpp -l|grep cluster //显示graphic display # lsdisp //查看CPU的个数 # bindprocessor -q //查看CPU的主频,操作系统版本最低是AIX 5.1,包含在软件包bos.pmapi.pmsvcs pmcycles This machine runs at 1500MHz //显示cpu的主频是1.5G #如何查找根文件系统(/)中的大文件 find -xdev -size +xxxx -ls #查找根卷组下大于2M的文件, 并根据文件大小排序, 大文件在前. find / -xdev -size +1024 -ls |sort -r +6 8277 624 -r-xr-xr-x 1 root system 635390 Jul 31 2003 /sbin/helpers/jfs2/fsck 28 596 -rw-r--r-- 1 root system 609388 Apr 12 17:25 /smit.log 30 1660 -rw-r--r-- 1 root system 3338083 Apr 5 14:08 /core #查看备份磁带中备份文件的大小 tcopy /dev/rmt0 tcopy: Tape File: 1; Records: 1 to 251; Size: 2097152. ---磁带机文件头大小 tcopy: Tape File: 1; Record: 252; Size 344064. ---磁带机文件头大小 tcopy: File: 1; End of File after: 252 Records, 526729216 Bytes. ---文件大小 tcopy: The end of the tape is reached. tcopy: The total tape length is 526729216 bytes. #如何取定文件与文件集的对应关系,有时想使用某个安装文件, 但没有安装包含该文件的文件集,找到文件集来安装所需文件 首先确认系统中已经安装了“bos.content_list”文件集(fileset), 如果没有安装, 请使用smitty installp进行安装. 运行which_fileset命令, 根据文件查找对应的文件集. 例如: #which_fileset iostat /usr/bin/iostat bos.acct 5.1.0.0 运行lslpp -f 命令, 查看指定文件集中包含的文件: #lslpp -f bos.acct //出于AIX系统安全考虑, 需要使某些用户只能在控制台登录使用,而不允许远程登陆使用. 更改/etc/security/user 文件中需要限制的用户的rlogin属性(rlogin = false) 当再次尝试远程登录时, 系统报错:Remote logins are not allowed for this account, 表示修改成功 //如何自动logout用户 有的用户登录后就长时间空闲,有可能导致安全上的问题,通过打开 /etc/profile 中 TMOUT 注释,将在设置的时间到达后自动logout用户 例如: export TMOUT=120 那么, 用户两分钟没有击键,将自动logout //AIX系统中如何限制用户所使用文件的大小(AIX小型机有大文件限制) >#smit chuser 在菜单上选择要控制的用户, 并修改下面两项: Soft FILE size [aaa] Hard FILE size [aaa] 则修改后用户的文件大小最大为aaa×512 bytes. >如何验证? 可以用该用户登录系统, 使用命令“ulimit -f”和“ulimit -Hf”可分别显示其fsize,fsize_hard的大小. //如何查看小型机适配器卡及硬盘的微码级别microcode level lscfg -vl device_name //查询SSA卡的微码级别 # lscfg -vl ssa0 //ssa0是此SSA卡的设备名,输出结果中的ROS level及ID即是微码级别(microcode level) //用下面命令可以得到一个硬盘的微码级别: # lscfg -vl pdisk* //IBM小型机AIX5.1操作系统密码文件丢失或者误删的恢复方法 进入维护模式: 1、将安装盘第一张放入光驱; 重启小型机选择主控台,按屏幕上提示的数字;选择语言,一般选english;选择3进入维护模式(start maintenence mode for system recovery); 选择1进入access a root volume group;选择0进入下一个菜单; --选择1--选择第一个磁盘; 选择1 access this volume group and start a shell 当出现提示符(如#时)开始操作 # cd /etc # cp passwd.old passwd (就是你刚刚保存的那个文件) # chown root:security passwd # reboot //查看内存信息两部曲: # lsdev -C | grep mem mem0 Available 00-00 Memory # lsattr -El mem0 size 1024 Total amount of physical memory in Mbytes False goodsize 1024 Amount of usable physical memory in Mbytes False //命令中的Machine/Cabinet Serial NO项即是 # lscfg -pvl sysplanar0 | grep "Machine/Cabinet" ##bootinfo命令start //若此命令返回值是1, 表示hdisk11可以由AIX引导, 其他返回值表示hdisk11不是rootvg制作镜像的候选 #bootinfo -B hdisk11 //显示CPU位数是64还是32 bootinfo -K //查看那个硬盘是引导区 bootinfo -b ##bootinfo命令end ##如何查看3种小型机的核心参数 /etc/security/limits //IBM核心参数配置文件 /etc/system //SUN核心参数配置文件 kmtune //HP-UX下用kmtune>kernel.txt将内核参数信息导出到kernel.txt文件中配置文件为: /usr/conf/master.d/core-hpux ##操作系统 //操作系统版本 uname -a //操作系统补丁 instfix -i|grep ML //获取硬件信息 prtconf ****** 创建文件系统四部曲 ************************************************ mklv -y lvinformix -c 2 rootvg 64 //在卷组rootvg上创建逻辑卷lvinformix, 大小为64(LP)×16M=1G, 磁盘镜像需用-c参数指定副本数 crfs -v jfs -d lvinformix -m /opt/informix //在lvinformix上创建文件系统/opt/informix mount /dev/lvinformix /opt/informix //将设备mount到文件系统上 chfs -A yes /dev/lvinformix //-A yes|no 修改所建文件系统的自动安装属性(Auto-Mount) ********************************************************************* ## 查看SSA磁盘阵列中pdisk与hdisk的对应关系start ssaxlate -l hdisk3 //逻辑磁盘hdisk3包含4个物理磁盘pdisk4,pdisk6,pdisk5,pdisk7 pdisk4 pdisk6 pdisk5 pdisk7 ssaxlate -l pdisk0 //物理磁盘pdisk0从属于逻辑磁盘hdisk2 hdisk2 ## 查看SSA磁盘阵列中pdisk与hdisk的对应关系end //设置文件系统/tellinshare/sms的mind属性,否则当文件系统中有足够多的大文件(指32K以上的文件)时会出问题 #chfs -a options=rw,mind /tellinshare/sms mkgroup id=101 informix //创建组informix, 组编号101 mkuser id=101 pgrp=informix home=/opt/informix shell=/usr/bin/csh informix //创建用户informix,命令参数说明 //id:指定用户的id号,请根据规划设置; //pgrp:指定该用户的归属组,请根据规划设置; //home:指定该用户的home目录,请根据规划设置; //shell:指定该用户的登录shell,请根据规划设置; //informix:指定用户名称,请根据规划设置; //检查硬件错误信息 errpt -a |grep error ##交换区命令start lsps -a //显示交换区的分部信息 lsps -s //显示交换区的使用信息 slibclean //清除处理程序遗留的旧分页信息 smit mkps //建立交换区空间信息 swapon -a //启动所有的分页空间 ##交换区命令end ##查看HACMP, 外部硬盘信息: lscfg -v lscfg -v | grep -E "pdisk|hdisk" //可查看已经加入到卷组中的磁盘的大小 ## lsdev命令start 常用参数说明: C ->列出自定义设备对象类中设备的有关信息,缺省包括名称,状态,位置,描述,不可和P合用 c Class ->指定设备名 F Format ->以用户指定格式输出,Format参数为预定义或自定义设备对象类中的列名,如:name status等 H ->显示列输出前面的头部分,即输出中包括列头部分 P ->列出预定义设备对象类中设备的有关信息,即支持的设备,缺省显示信息包括class,type,subclass,description r ColumnName ->指定列名 S State ->列出指定状态的设备,3种状态可选,(1)已定义->defined,d,D,0;(2)可用->available,a,A,1;(3)停止->stopped,s,S,2; s Subclass ->指定设备的子类名称,subclass包括什么类型可用参数P显示; t Type ->指定设备类型名称; 查看系统中所有的外置物理磁盘 lsdev -Cc pdisk -s ssar -H name status location description pdisk0 Available 07-08-6931-01-P SSA160 Physical Disk Drive pdisk1 Available 07-08-6931-07-P SSA160 Physical Disk Drive pdisk2 Available 07-08-6931-04-P SSA160 Physical Disk Drive pdisk3 Available 07-08-6931-08-P SSA160 Physical Disk Drive pdisk4 Available 07-08-6931-05-P SSA160 Physical Disk Drive pdisk5 Available 07-08-6931-06-P SSA160 Physical Disk Drive pdisk6 Available 07-08-6931-03-P SSA160 Physical Disk Drive pdisk7 Available 07-08-6931-02-P SSA160 Physical Disk Drive 显示系统中SSA磁盘阵列的逻辑磁盘 lsdev -C -t hdisk -c disk -s ssar -H name status location description hdisk2 Available 07-08-L SSA Logical Disk Drive hdisk3 Available 07-08-L SSA Logical Disk Drive 列出所有支持的设备 lsdev -P 列出系统支持的所有磁盘类的设备清单 ZSSCP4-mscp2[/]# lsdev -Pc disk disk hdisk ssar SSA Logical Disk Drive disk 1000mb scsi 1.0 GB SCSI Disk Drive disk 1000mb16bit scsi 1.0 GB SCSI Disk Drive disk 1000mb16bitde scsi 1.0 GB 16 Bit Differential SCSI Disk Drive disk 1000mbde scsi 1.0 GB Differential SCSI Disk Drive disk 1100mb scsi 1.1 GB SCSI Disk Drive disk 1100mb16bit scsi 1.1 GB 16 Bit SCSI Disk Drive disk 1100mb16bitde scsi 1.1 GB 16 Bit Differential SCSI Disk Drive disk 1200mb scsi 1.2 GB SCSI Disk Drive (in 2.4 GB Disk Unit) 查看系统中的逻辑磁盘和磁盘类型(内置盘还是SSA外置盘) #lsdev -Cc disk hdisk0 Available 09-08-00-5,0 16 Bit LVD SCSI Disk Drive hdisk1 Available 09-08-00-8,0 16 Bit LVD SCSI Disk Drive hdisk2 Available 07-08-L SSA Logical Disk Drive //磁盘阵列中硬盘的逻辑名 hdisk3 Available 07-08-L SSA Logical Disk Drive 显示系统中的物理磁盘 lsdev -Cc pdisk pdisk0 Available 07-08-6931-01-P SSA160 Physical Disk Drive pdisk1 Available 07-08-6931-07-P SSA160 Physical Disk Drive 查询cpu的个数 lsdev -Cc processor proc0 Available 00-00 Processor proc1 Available 00-01 Processor 查询设备中状态为可用的适配器 lsdev -Cc adapter -S a sio0 Available 00-00 StandardI/OPlanar fda0 Available 00-00-0D StandardI/ODisketteAdapter kts0 Available 00-00-0K KeyboardTablet/Soundsystem sa0 Available 00-00-S1 StandardI/OSerialPort1 sa1 Available 00-00-S2 StandardI/OSerialPort2 scsi0 Available 00-07 SCSII/OController mous0 Available 00-00-0M Mousedevice 系统支持的设备的class lsdev -P -r class adapter bus . . . tcpip tty 列出自定义设备对象类中处于可用状态的所有设备的名称,类,子类,和类型,包括列头部分 lsdev -C -H -S a -F 'name class subclass type' sa0 adapter mca 8p232 fd0 diskette siofd fd hdisk0 disk scsi 670mb hdisk1 disk scsi 355mb 列出adapter的设备名 lsdev -CHc adapter -F name name ent0 ssa0 ent1 列出网口的设备名和class,包括列头部分 lsdev -CHc if -F 'name class' name class en0 if en1 if en2 if et0 if et1 if et2 if lo0 if 查看两台SSA7133通道状态 lsdev -C -t ssa160 -c adapter ssa0 Available 34-08 IBM SSA 160 SerialRAID Adapter (14109100) ssa1 Available 3k-08 IBM SSA 160 SerialRAID Adapter (14109100) 查看主机中所有HBA卡信息 lsdev -Cc adapter | grep fcs fcs0 Available 2V-08 FC Adapter fcs1 Available 3F-08 FC Adapter #显示连接到主机里面的HBA卡的网络地址 lscfg -vl fcs0 | grep Network Network Address.............10000000C9456CBF 列出磁盘阵列router lsdev -C | grep dar dar0 Available 1722-600 (600) Disk Array Router 列出磁盘阵列控制器 lsdev -C | grep dac dac0 Available 2V-08-01 1722-600 (600) Disk Array Controller dac1 Available 3F-08-01 1722-600 (600) Disk Array Controller //lsdev显示ibm小型机硬件设备名称, 然后使用lsattr显示该设备特性 lsdev -CH //输出内存的设备名 mem0 Available 00-00 Memory lsattr -El mem0 //使用lsattr -El mem0 可以输出该条内存的大小 size 1024 Total amount of physical memory in Mbytes False goodsize 1024 Amount of usable physical memory in Mbytes False ## lsdev命令 end crfs -v jfs -d lvtest -m /test //生成文件系统此命令将生产的文件系统mount到/test目录下 rmlv -f lvtest //要删除此文件系统, 先删除逻辑卷 rmdir /test //然后删除mount的目录即可 topas // topas执行结果的左上角, 我们看到了关于Kernel、User、Wait和Idle的显示, 这是topas关于CPU活动情况的使用报告 // Kernel: 表示在kernel模式下运行的进程所占用的CPU百分比 // User: 表示在user模式下运行的进程所占用的CPU百分比 // Wait: 表示等待I/O的CPU百分比, Idle表示空闲状态的CPU百分比 ****** 监控CPU性能start vmstat 2 kthr memory page faults cpu ----- ----------- ------------------------ ------------ ----------- r b avm fre re pi po fr sr cy in sy cs us sy id wa 1 0 22478 1677 0 0 0 0 0 0 188 1380 157 57 32 0 10 1 0 22506 1609 0 0 0 0 0 0 214 1476 186 48 37 0 16 0 0 22498 1582 0 0 0 0 0 0 248 1470 226 55 36 0 9 2 0 22534 1465 0 0 0 0 0 0 238 903 239 77 23 0 0 2 0 22534 1445 0 0 0 0 0 0 209 1142 205 72 28 0 0 2 0 22534 1426 0 0 0 0 0 0 189 1220 212 74 26 0 0 3 0 22534 1410 0 0 0 0 0 0 255 1704 268 70 30 0 0 2 1 22557 1365 0 0 0 0 0 0 383 977 216 72 28 0 0 2 0 22541 1356 0 0 0 0 0 0 237 1418 209 63 33 0 4 1 0 22524 1350 0 0 0 0 0 0 241 1348 179 52 32 0 16 1 0 22546 1293 0 0 0 0 0 0 217 1473 180 51 35 0 14 //如果要检查 CPU 是否存在性能瓶颈,那么vmstat报告中的两个kthr列和四个cpu列非常有判断价值,同时faults列也有一定的参考意义. ### kthr 列 ### 该列的数据是在采样时间段内对队列中的内核线程数进行计算得到的平均值. <> 表示可运行的内核线程平均数, 包括正在运行的线程和等待CPU的线程. 如果这个数字大于 CPU 的数目, 则至少有一个线程要等待CPU.等待CPU的线程越多, 对性能的影响就越大. <> 表示等待队列中的内核线程平均数,包括正在等待文件系统 I/O 的线程,或由于内存装入控制而被挂起的线程.如果block的值长时间连续非零,那就需要我们对CPU的运行状况做进一步的分析. ### cpu 列 ### 表示在该时间间隔内使用 CPU 时间的百分比. <> 显示了用户模式所消耗的 CPU 时间. 当在用户模式下执行时, 进程在它自己的应用程序代码中执行, 不需要内核资源来进行计算、管理内存或设置变量. <> 详细显示了CPU在系统模式下执行一个线程所花时间的百分比, 包括内核进程和其它需要访问内核资源的进程所消耗的CPU资源. 如果一个进程需要内核资源, 它必须执行一个系统调用, 并因此被切换到系统模式从而可以使用该资源. 例如, 对一个文件的读或写操作需要内核资源来打开文件、寻找指定的位置和读写数据. <> 显示了已确定本地磁盘 I/O 时 CPU 空闲或等待时间的百分比. <> 详细显示了有未决本地磁盘I/O时CPU空闲的时间百分比.wa 的值如果超过25%,就表明磁盘子系统可能没有被正确平衡,或者可能是磁盘工作负荷很重. ### faults 列 ### 关于进程控制的信息 <> 表示在该时间间隔中观测到的每秒设备中断数. <> 表示在该时间间隔中观测到的每秒系统调用次数.通过明确的系统调用,用户进程可以使用资源.通常来讲,在一个单处理器系统上当sy列增大到超过每秒钟10000 个调用,应进行进一步的深究(在一个对称多处理系统上,这个数字为每个处理器每秒钟10000 个调用) <> 在该时间间隔中观测到的每秒钟上下文切换次数. 观察上面vmstat命令的执行结果,我们看到最开始的三个报告表明系统稳定在用户模式 48-57%、系统模式 32-37% 和 I/O 等待 9-16%.从第四个报告开始,当非? 姆袰PU资源的一个恶意破坏循环程序开始运行后,所有的 CPU 周期被占用.因为循环程序不进行 I/O,所以它可以占有前面因为 I/O 等待而未用的所有周期.更糟糕的是这意味着,当一个有用进程放弃 CPU 的使用权时,这个进程总是要占用CPU.因为死循环程序的优先级与所有其它前台进程一样,所以当另一个进程变得可调度时它也没必要让出 CPU 的使用权.该程序运行大约10秒钟(5次×2秒/次=10秒), 然后由 vmstat 命令报告的活动恢复到较正常的模式. 总的来说, 如果 us + sy 时间低于 90%, 则不认为该单用户系统 CPU 受限制. 但是, 如果在一个多用户系统中 us + sy 时间超过 80%, 其中的进程将要花时间在运行队列中等待, 响应时间和吞吐量会受到损害;对于这样的系统, 我们应提高警惕. 对于CPU性能可能存在瓶颈的系统,我们可以用 tprof 命令找出占用CPU时间最多的进程, 用 nice 或 renice 命令调整用户进程的优先级, 用 schedtune 命令修改调度程序时间片的长度. 根据业务与软件产品的维护经验, 因为CPU性能存在瓶颈导致业务不能稳定运行的故障非常之少, 同时也因为CPU是系统的核心部件,对CPU进行任何调整都可能导致非常大的影响, CPU的性能调优需要非常全面深厚的理论基础, 所以在此我们不对CPU的调优操作做详细介绍. ##使用sar sar -u 3 3 AIX mscp2 3 4 005F7FDA4C00 08/15/07 11:32:55 %usr %sys %wio %idle 11:32:59 12 13 0 76 11:33:02 12 13 4 72 11:33:05 11 11 0 77 Average 12 12 1 75 ###看每个CPU地占用率,2秒为间隔之行5次 sar -P ALL -u 2 5 ****** 监控CPU性能end ****** 监控磁盘的I/O性能start ###使用iostat iostat 2 2 tty: tin tout avg-cpu: % user % sys % idle % iowait 0.1 16.7 72.5 79.4 -59.0 7.1 Disks: % tm_act Kbps tps Kb_read Kb_wrtn hdisk0 50.8 102.2 85.7 66479591 713426327 hdisk1 49.6 97.7 84.8 31785338 713426327 hdisk2 278.0 192.2 549.7 978503313 488310751 cd0 0.0 0.0 0.0 0 0 tty: tin tout avg-cpu: % user % sys % idle % iowait 0.0 239.6 10.4 9.9 79.6 0.1 Disks: % tm_act Kbps tps Kb_read Kb_wrtn hdisk0 0.5 4.0 1.0 0 8 hdisk1 0.5 4.0 1.0 0 8 hdisk2 0.5 4.0 1.0 0 8 cd0 0.0 0.0 0.0 0 0 ### iowait ### 等待本地I/O时CPU空闲时间的百分比. 如果iowait时间的百分比很高,表明该磁盘输入输出(I/O)可能是导致系统运行速度缓慢的主要原因. ### idle ### 表示未等待本地 I/O 时CPU 空闲时间的百分比. ### tm_act ### 表示硬盘繁忙程度的百分比.如果tm_act的值很高,表明硬盘存在I/O瓶颈.当%tm_act(硬盘繁忙时间)很高时,可能会感觉到系统运行速度在减慢.有些系统上某个硬盘的%tm_act值超过35%时,系统性能就会受到明显的影响. ##使用sar sar -d 2 2 AIX mscp2 3 4 005F7FDA4C00 08/15/07 11:23:40 device %busy avque r+w/s blks/s avwait avserv 11:23:42 hdisk0 -19 0.0 85 102 0.0 0.0 hdisk1 -20 0.0 84 97 0.0 0.0 hdisk2 -3 0.0 549 192 0.0 0.0 cd0 0 0.0 0 0 0.0 0.0 11:23:44 hdisk0 0 0.0 0 0 0.0 0.0 hdisk1 0 0.0 0 0 0.0 0.0 hdisk2 0 0.0 2 9 0.0 0.0 cd0 0 0.0 0 0 0.0 0.0 Average hdisk0 -9 0.0 42 51 0.0 0.0 hdisk1 -10 0.0 42 48 0.0 0.0 hdisk2 -1 0.0 275 100 0.0 0.0 cd0 0 0.0 0 0 0.0 0.0 ### device ### 块设备的逻辑名, 以下各列的数据都是针对该device而言的. ### busy ### 该块设备处于服务请求状态的百分比, 单位是%. ### Avque ### 指定时间内, 平均处理的请求个数. 正常情况下, 该值应该小于0.5, 如果很多时候都超过1甚至达到3以上, 则表示该设备现在已经不能及时响应请求服务, IO成为瓶颈. ### r+w/s ### 每秒数据访问次数 ### blks/s ### 每秒数据访问量(单位是512byte) ### avwait ### 每个请求在请求队列中的平均等待时间(单位是毫秒). 它是和avque息息相关的, 如果avque增大, 则该值也会急剧增大. 记住正常情况下它的值, 如果一旦SCP处理能力不足时, 可以用以进行比较. ### avserv ### 平均每个IO请求的服务时间(单位是毫秒) ****** 监控磁盘的输入/输出性能end ***** Hacmp双机命令start #SCP双机脚本目录 /usr/sbin/cluster/utilities/tellin/scppkg #启动双机软件 smit clstart #关闭双机软件 smit clstop #双机状态查询, 取决于clinfo进程是否拉起, 若没有该进程则无法使用该命令,执行该命令需进入目录/usr/sbin/cluster/下: /usr/sbin/cluster/clstat -a clstat - HACMP Cluster Status Monitor --------------------------------------------- Cluster: mscp_cluster_yunnan (80) Fri Aug 17 14:24:23 BEIJING 2001 State: UP Nodes: 2 Node: mscp1 State: UP Interface: mscp1_boot (0) Address: 139.124.8.21 State: UP Interface: mscp1_tty (1) Address: 0.0.0.0 State: UP Node: mscp2 State: UP Interface: mscp2_boot (0) Address: 139.124.8.22 State: UP Interface: mscp2_stty (1) Address: 0.0.0.0 State: UP //查看监控进程appspy的状态 lssrc -s appspy Subsystem Group PID Status appspy (scp监控) 20722 active (激活) smpappspy (smp监控) inoperative(未激活) //查看cluster系统的状态 lssrc -g cluster Subsystem Group PID Status clstrmgr Cluster 21504 active clsmuxpd Cluster 22450 active clinfo Cluster 22708 active //建立smpappspy子系统 mkssys -s smpappspy -p /usr/sbin/cluster/utilities/tellin/smp/smppkg/smpappspy -u 0 -S -n 15 -f 15 //停止双机appspy监控,若停监控后双机状态为stopping,则参考"双机状态为stopping解决方法2则" stopsrc -s appspy //启动双机appspy监控 startsrc -s appspy ##停止双机步骤start //查询备机spy.sh是否存在 ps -ef | grep spy.sh | grep standby //若存在则kill掉监控进程 kill //停备机应用 /usr/sbin/cluster/utilities/tellin/scppkg/spy.sh stop //停止备机群组 smit clstop //检查应用,数据库是否停止 kill_scp.sh onmode -ky //主机直接停双机 smit clstop //检查应用,数据库是否停止 kill_scp.sh onmode -ky ##停止双机步骤end ***** Hacmp双机命令end //配置设备,读取设备上的硬件信息并识别,可以同步双机的hdisk信息 cfgmgr ****** IBM内存监测方法start ##查看系统内核消耗的内存信息(pin部分是否增长),大约10分钟收集一次,需要加入date信息. svmon -G ##查看各个进程的内存消耗, 这部分信息量大, 大约4小时收集一次, 需要加入date信息. svmon -P svmon -P 进程号 //查看某个进程的内存信息 ##topas没有办法记录到日志文件中,可以手工定时执行,也可以考虑拿一个第三方的top来收集. topas ##类似top的进程信息,信息量大,建议4小时收集一次,或截取部分有用信息,而增加收集的频度,如只采集前50个进程信息, 每分钟收集一次. tprof -kes -x sleep 5 ##收集内存CPU和内存综合信息,包括fi/fo,pi/po,建议每分钟收集一次. vmstat -t -I 2 5 ##收集文件缓冲占用内存程度,建议4小时收集一次. /usr/samples/kernel/vmtune ##通过sar -f sar.out后面跟相关参数查看对应的信息,建议每分钟收集一次. sar -A -o sar.out 2 5 #间隔2秒之行5次 ##观察参数%mem:内存使用百分比;RSS:实际使用内存 ps aux ##检查系统物理内存信息: lsdev -Cc memory lsattr -El mem0 ##3种小型机如何查看核心参数 IBM核心参数配置文件为: /etc/security/limits SUN核心参数配置文件为: /etc/system HP-UX下用kmtune>kernel.txt将内核参数信息导出到kernel.txt文件中 ##当操作系统内核内存调试开关使用bosdebug -M打开的局点, 还可以收集如下信息: i=`date +"%m%e%H%M%S"` echo heap | kdb > heap.$i echo "xm -lu" | kdb > xm.$i 写成shell如下: #!/bin/ksh integer count=0 sar -A -o sar.out 60 10000000 & #60秒为间隔执行sar命令10000000次 while : do if (( $count % 600 == 0 )) then date >> svmon.total svmon -G >> svmon.total fi if (( $count % 14400 == 0 )) then date >> svmon.detail svmon -P >> svmon.detail date >> vmtune.info /usr/samples/kernel/vmtune >> vmtune.info fi if (( $count % 60 == 0 )) then date >> tprof.info tprof -kes -x sleep 5 head -50 __prof.all >> tprof.info vmstat -t -I 2 5 >> vmstat.info fi ((count+=1)) sleep 1 done ###监测内存性能start vmstat 2 10 kthr memory page faults cpu ----- ----------- ------------------------ ------------ ----------- r b avm fre re pi po fr sr cy in sy cs us sy id wa 1 3 113726 124 0 14 6 151 600 0 521 5533 816 23 13 7 57 0 3 113643 346 0 2 14 208 690 0 585 2201 866 16 9 2 73 0 3 113659 135 0 2 2 108 323 0 516 1563 797 25 7 2 66 0 2 113661 122 0 3 2 120 375 0 527 1622 871 13 7 2 79 0 3 113662 128 0 10 3 134 432 0 644 1434 948 22 7 4 67 1 5 113858 238 0 35 1 146 422 0 599 5103 903 40 16 0 44 0 3 113969 127 0 5 10 153 529 0 565 2006 823 19 8 3 70 0 3 113983 125 0 33 5 153 424 0 559 2165 921 25 8 4 63 0 3 113682 121 0 20 9 154 470 0 608 1569 1007 15 8 0 77 0 4 113701 124 0 3 29 228 635 0 674 1730 1086 18 9 0 73 ### avm ### 活动的虚拟内存, 显示目前 vmstat 样本收集的动态虚拟内存的页数, 它是已经被占用的内存页面. ### fre ### 显示空闲内存页面的平均数量.系统为内存页面建立了一个缓冲区,称为空闲列表.当 VMM(虚拟内存管理)需要空间时可以立即访问此空闲列表.VMM在空闲列表中保存最少页面的数量决定于minfree参数,该参数执行 vmtune 命令加f参数可以得到. ### re ### 表示系统回收的内存页面数.在AIX 5L当中不再支持回收,因为它只能提供有限的系统性能的信息却无法弥补跟踪回收算法对系统的负面影响 ### pi ### 表示分页空间调入数量的详细信息.分页空间是驻留在磁盘上的虚拟内存的一部分.当内存过量使用时,它用作超出部分的内存. ### po ### 显示页面调出数量的详细情况. ### fr ### 在一定时间间隔内为填充内存空闲表或分配给某进程所需要释放的内存页面. ### sr ### 为得到fr数量的空闲页面所需要检查的页面数.当fr和sr的比例(fr:sr)很高时,内存将会过量使用.fr:sr 为 1:4 的比例意味着每释放一页,有四页被检查了.当 po*SYS > fr (SYS 为一系统参数,可用命令/usr/samples/kernel/schedtune查看)时,系统自身认为已到崩溃边缘.该值在有128MB或更多内存的系统上默认值为0,表示禁止内存加载控制,否则默认值为6.系统崩溃表明此时系统使用大量时间用于内存换入/换出,而没有足够时间处理应用或正常工作.这时一些进程将被临时挂起或被kill掉,系统运行明显减慢. ### cy ### 时钟算法中当内存页面写满时每秒刷新周期的数量. ### 内存优化的工具start /usr/samples/kernel/vmtune 执行结果中,maxperm=79.9% of real memory表示文件系统占用内存的比例上限为80%,minperm=20.0% of real memory表示文件系统占用内存的比例下限为20%, strict_maxperm = 0表示使用非严格上限模式.80%的文件系统内存占用上限易导致Paging space占用过高.对于一般对文件系统使用要求不高的应用,比如智能网系统,IIN平台最新推荐值是100-200M,可以根据实际物理内存,非严格上限模式. 命令如下: cd /usr/samples/kernel ./vmtune -P 20 -p 10 ./vmtune -h vmtune中还有两个比较关键的参数: npswarn和npskill. 当pagingspace的空闲页面数低于npswarn时,操作系统开始给进程发送SIGDANGER信息量,当pagingspace的空闲页面数低于npskill值时AIX操作系统开始随机地杀进程. ##查看共享内存 ipcs -ma IPC status from /dev/mem as of Sun Nov 18 09:48:52 PAKST 2007 T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME Shared Memory: m 0 0x0d0369c6 --rw-rw-rw- root system root system 6 1440 336000 721078 9:30:28 9:30:28 9:37:46 m 1 0xffffffff --rw-rw---- root system root system 1 4096 450672 450672 9:48:00 9:48:00 9:38:01 m 1441794 0x52564801 --rw-rw---- root informix root informix 0 238092288 581846 704714 9:48:31 9:48:31 9:27:32 m 131075 0x52564802 --rw-rw---- root informix root informix 0 32768000 581846 704714 9:48:31 9:48:31 9:27:33 m 131076 0x52564803 --rw-rw-rw- root informix root informix 0 606208 581846 704714 9:48:31 9:48:31 9:27:38 ##清除共享内存 ipcrm Usage: ipcrm [-q msqid] [-m shmid] [-s semid] [-Q msgkey] [-M shmkey] [-S semkey] //example ipcrm -m 0x52564801 ******IBM内存监测方法end ***** shutdown命令使用start 1、在 10 分钟后关掉系统: # shutdown +10 2、采用没有警告的快速关机: # shutdown -F 或 # halt 3、关掉并警告用户退出: # shutdown now 4、在警告1分钟后关机并重新启动: # shutdown -r 5、快速关机并重新启动: # shutdown -Fr # reboot 6、关掉 AIX 到单用户模式: # telinit S # init s # shutdown -m ***** shutdown命令使用end ***** 创建文件系统流程start 1、用smit工具创建testvg 2、# mklv -t jfs -e x -y testlv1 testvg 512 hdisk0 3、# crfs -v jfs -d testlv1 -m /zhaop 4、# mount /dev/testlv1 /zhaop 5、# mount node mounted mounted over vfs date options -------- --------------- --------------- ------ ------------ --------------- /dev/hd4 / jfs Jan 31 08:53 rw,log=/dev/hd8 /dev/hd2 /usr jfs Jan 31 08:53 rw,log=/dev/hd8 /dev/hd9var /var jfs Jan 31 08:53 rw,log=/dev/hd8 /dev/hd3 /tmp jfs Jan 31 08:53 rw,log=/dev/hd8 /dev/hd1 /home jfs Jan 31 08:55 rw,log=/dev/hd8 /proc /proc procfs Jan 31 08:55 rw /dev/hd10opt /opt jfs Jan 31 08:55 rw,log=/dev/hd8 /dev/lv00 /oracle jfs Jan 31 08:55 rw,log=/dev/hd8 /dev/lvinformix /informix jfs Jan 31 08:55 rw,log=/dev/hd8 ***** 创建文件系统流程end ***** 为设备增加一个外接磁盘start 先将设备下电,连接硬盘,重启即可,系统会自动分配一个物理卷名给新磁盘hdisk(n),n是下一个磁盘号.如果内置磁盘的卷标是hdisk0那么新加 磁盘就会取名为hdisk1.这时硬盘只是对LVM来说可用,但尚未配置.配置磁盘可使用SMIT或者chdev命令实现. #如果用smit命令连接磁盘, 命令行输入: smit makdsk, 显示信息如下: +--------------------------------------------------------------------------+ | Disk Type | | | | Move cursor to desired item and press Enter. | | | | [TOP] | | 1000mb scsi 1.0 GB SCSI Disk Drive | | 1000mb16bit scsi 1.0 GB SCSI Disk Drive | | 1000mb16bitde scsi 1.0 GB 16 Bit Differential SCSI Disk Drive | ........... | 730mb scsi 730 MB SCSI Disk Drive | | 857mb scsi 857 MB SCSI Disk Drive | | osdisk scsi Other SCSI Disk Drive | | scsd scsi Other SCSI Disk Drive | 若安装的是非IBM的SCSI硬盘, 在列表中选择osdisk, 显示信息如下: +--------------------------------------------------------------------------+ | Parent Adapter | | | | Move cursor to desired item and press Enter. | | | | scsi0 Available 10-60 Wide/Fast-20 SCSI I/O Controller | | scsi1 Available 10-88 Wide/Ultra-2 SCSI I/O Controller | 选择正确的适配卡 ***** 为设备增加一个外接磁盘end ***** smit管理存储设备start //相当于输入smit->System Storage Management(Physical & Logical Storage),进入管理存储设备界面Logical Volume Manager smit lvm Move cursor to desired item and press Enter. Volume Groups Logical Volumes Physical Volumes Paging Space //直接进入管理卷组界面 smit vg //添加一个卷组 smit mkvg //修改一个卷组 smit vgsc Change a Volume Group Add a Physical Volume to a Volume Group ->命令为: extendvg Remove a Physical Volume from a Volume Group ->命令为: reducevg Reorganize a Volume Group ->命令为: reorgvg //导入卷组 #smit importvg //若用户要把当前系统中的卷组转移到其它系统中,以下为操作步骤: //1:必须使用exportvg或者smit工具把卷组从当前系统导出, 用importvg或者smit工具把卷组信息导入到目的设备系统中; //2:导出前必须是非激活状态, 卷组被导出, 系统将删除此卷组的所有信息; //3:不要试图导出rootvg; //直接进入逻辑卷管理界面 smit lv //添加一个LV smit mklv //修改LV属性 smit lvsc //给LV做镜像, 命令为: mklvcopy smit mklvcopy //把硬盘hdisk1上的lv00转移到hdisk2上,可以使用lslv -l命令查看LV在PV上的分布情况smit pv migratepv -l lv00 hdisk1 hdisk2 # pdisk和hdisk有何区别 pdisk物理磁盘(每个硬盘都是一个pdisk),hdisk逻辑磁盘,做完阵列后系统看到的磁盘形式.对应关系是若没有raid或者镜像,每个pdisk就是一个hdisk.如果做了raid,那么做完后的虚拟磁盘就是hdisk.例如三块pdisk做raid5 后所看到的就是hdisk一块盘. #smitty devices 依次选择: SSA Disks-----SSA Logical Disks----Show Logical to Physical SSA Disk Relationship 这里可以显示出你的hdisk2与你之前显示的四块硬盘的关系; 还有其他选项可以选择, 如下信息显示hdisk2做了raid5: Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. hdisk2 CA4F43598AC04CK system good 54.7GB raid_5 ***** smit管理存储设备end ****** 物理卷管理start 1、增加新磁盘 >>方法一: 适用于安装磁盘时可以关闭系统. 安装完磁盘之后,启动系统,cfgmgr命令在启动过程中被自动执行,新磁盘被自动配置,启动完毕后,root用户使用lspv命令可看到有新磁盘 加入系统: hdisk1 none none 或者 hdisk1 00085166b4d41888 none 如果有PVID号,则磁盘可以被LVM使用,如果没有PVID号,则需要将磁盘转化为物理卷,请参考第二步. >>方法二: 适用于安装磁盘时不能关闭系统. (1)lspv命令显示当前系统中存在的物理卷, 如: #lspv hdisk0 00085166b4d41888 rootvg (2)运行cfgmgr, 配置系统新检测到的新设备 #cfgmgr #cfgmgr -vl ssar 表示检测ssar设备中的新设备信息,l 指定设备名;v 输出详细信息 (3)再次执行lspv命令显示当前系统存在的物理卷 #lspv hdisk0 00085166b4d41888 rootvg hdisk1 0008516684c7b231 none 注意: 若新增磁盘没有PVID, 则需要将磁盘转化为物理卷, 请参考第二步. 2、将磁盘转化为物理卷 一个磁盘必须被设置为一个物理卷材可被LVM管理,以下命令可以使一个可用磁盘(hdisk1)成为一个物理卷并分配一个PVID #chdev -l hdisk1 -a pv=yes //-l: 指示磁盘的设备名;-a: 指定设备属性值 注意:该命令对于已设置为物理卷的磁盘没有作用 3、修改物理卷特性 (1) 给物理卷设置分配许可权 物理卷的分配许可权决定那些物理卷可以分配给逻辑卷,那些不可以. 以下命令关闭hdisk1的分配许可: #chpv -a n hdisk1 以下命令打开分配许可: #chpv -a y hdisk1 (2) 设置物理卷的可用性 可用性决定了是否可以处理逻辑输入/输出操作, 当一个物理卷从系统中移除或者故障导致不可用时, 应将其置为不可用: #chpv -v r pvname 该操作将会冻结该物理卷中所有的VGDA和VGSA拷贝,将来卷组激活时将不会被加入卷组,同样该卷的信息也从该卷组中其他的物理卷 的VGDA和VGSA中删除. 置为可用: #chpv -v a pvname 注意: chpv命令执行会使用tmp目录, 若执行失败则检查tmp目录是否够大, 扩展其空间后再执行. 4、显示系统中的物理卷 #列出系统中的物理卷设备 lspv #作用同上 lsdev -Cc disk #显示物理卷特性 lspv hdisk1 PHYSICAL VOLUME: hdisk2 VOLUME GROUP: vgscp PV IDENTIFIER: 0033c87d7973d945 VG IDENTIFIER 0033c87d00004c0000000104798aca36 PV STATE: active STALE PARTITIONS: 0 ALLOCATABLE: yes PP SIZE: 16 megabyte(s) LOGICAL VOLUMES: 3 TOTAL PPs: 8686 (138976 megabytes) VG DESCRIPTORS: 2 FREE PPs: 0 (0 megabytes) HOT SPARE: no USED PPs: 8686 (138976 megabytes) FREE DISTRIBUTION: 00..00..00..00..00 USED DISTRIBUTION: 1738..1737..1737..1737..1737 #显示物理卷中逻辑卷的分配信息 lspv -l hdisk1 hdisk2: LV NAME LPs PPs DISTRIBUTION MOUNT POINT tellinsharelv 7661 7661 1737..713..1737..1737..1737 /tellinshare loglv00 1 1 01..00..00..00..00 N/A tellinlv 1024 1024 00..1024..00..00..00 /tellin #显示物理卷中物理分区的分配信息 lspv -p hdisk1 hdisk2: PP RANGE STATE REGION LV NAME TYPE MOUNT POINT 1-1737 used outer edge tellinsharelv jfs /tellinshare 1738-1738 used outer edge loglv00 jfslog N/A 1739-2762 used outer middle tellinlv jfs /tellin 2763-3475 used outer middle tellinsharelv jfs /tellinshare 3476-5212 used center tellinsharelv jfs /tellinshare 5、迁移物理卷内容 (1)确认源磁盘与目标磁盘是否在同一卷组中, 源磁盘与目标磁盘必须在同一卷组中 #lsvg -p rootvg //显示卷组包含那些物理卷 (2)确认目标磁盘上是否有充足的空闲空间 #lspv hdisk0|grep "USED PPs" //确认源磁盘上已使用的PP个数 USED PPs: 537 (4296 megabytes) 根据上面信息目标磁盘必须有至少537个PP才可迁移数据 (3)使用smit migratepv命令迁移数据, 界面如下: Move Contents of a Physical Volume Type or select a value for the entry field. Press Enter AFTER making all desired changes. [Entry Fields] * SOURCE physical volume name [] + (4)从卷组中移除源磁盘, 执行: reducevg VGNAME Sourcedisk (5)删除该磁盘信息 rmdev -l Sourcedisk -d 6、lspv命令 Usage: lspv lspv [-L] [-M | -l | -p] [-n DescriptorPV] [-v VGid] PVname Lists the characteristics of a volume group's physical volume. //查看hdisk和vg的对应关系 # lspv hdisk0 00c9e7ea7056c6e0 rootvg active hdisk3 00c9e7aa712e4723 smpvg active 显示系统中的hdisk(逻辑硬盘), 中间一列表示PV的ID号, 若没有PVID表示磁盘对于LVM来说不可用 //hdisk0的详细信息 # lspv hdisk0 PHYSICAL VOLUME: hdisk0 VOLUME GROUP: rootvg PV IDENTIFIER: 00085166b4d41888 VG IDENTIFIER 0008516600004c000000010aaa9b6eb8 PV STATE: active STALE PARTITIONS: 0 ALLOCATABLE: yes PP SIZE: 8 megabyte(s) LOGICAL VOLUMES: 9 TOTAL PPs: 537 (4296 megabytes) VG DESCRIPTORS: 2 FREE PPs: 19 (152 megabytes) HOT SPARE: no USED PPs: 518 (4144 megabytes) FREE DISTRIBUTION: 00..00..00..00..19 USED DISTRIBUTION: 108..107..107..107..89 //物理卷hdisk0包含那些LV # lspv -l hdisk0 hdisk0: LV NAME LPs PPs DISTRIBUTION MOUNT POINT testlv1 512 512 108..107..107..107..83 /zhaop loglv00 1 1 00..00..00..00..01 N/A //物理卷hdisk1包含那些LV # lspv -l hdisk1 hdisk1: LV NAME LPs PPs DISTRIBUTION MOUNT POINT hd5 1 1 01..00..00..00..00 N/A hd6 4 4 00..04..00..00..00 N/A hd2 55 55 00..40..15..00..00 /usr hd8 1 1 00..00..01..00..00 N/A hd4 1 1 00..00..01..00..00 / hd9var 1 1 00..00..01..00..00 /var hd3 10 10 00..00..10..00..00 /tmp hd1 1 1 00..00..01..00..00 /home hd10opt 80 80 00..00..80..00..00 /opt //显示物理卷的信息, 其中PP RANGE列和REGION列显示了PP所在的硬盘位置 # lspv -p hdisk1 hdisk1: PP RANGE STATE REGION LV ID TYPE MOUNT POINT 1-1750 free outer edge 1751-2445 used outer middle lvinformix jfs /informix 2446-2495 used outer middle lvrootdbs jfs N/A 2496-3372 free outer middle 3373-3500 used outer middle paging00 paging N/A 3501-3555 used center hd3 jfs /tmp 3556-5250 used center lv00 jfs /oracle 5251-7000 used inner middle lv00 jfs /oracle 7001-7555 used inner edge lv00 jfs /oracle 7556-8750 free inner edge //显示物理分区分配表 #lspv -M hdisk0 hdisk0:1 hd5:1 //第一列指明磁盘的物理分区,第二列指明物理分区对应那个逻辑卷的逻辑分区 hdisk0:2 hd3:3 ****** 物理卷管理end ****** 逻辑卷管理start lslv: 查看lv详细信息 Usage: lslv [-L] [-l | -m] [-n DescriptorPV] LVname lslv: [-L] [-n DescriptorPV] -p PVname [LVname] Lists the characteristics of a logical volume. ## lslv start # lslv -l testlv1 //查看testlv1逻辑卷在各个PV上的分布情况 testlv1:/zhaop PV COPIES IN BAND DISTRIBUTION hdisk0 512:000:000 20% 108:107:107:107:083 //查看逻辑磁盘hdisk3中包含那些物理磁盘,下图中表示hdisk3中包含4个物理磁盘pdisk4,pdisk6,pdisk5,pdisk7 ssaxlate -l hdisk3 pdisk4 pdisk6 pdisk5 pdisk7 # lslv -m hd3 //查看是否镜像, 查看hd3的LP在PV上的映射关系 hd3:/tmp LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0228 hdisk0 ->第一个LP映射在hdisk0的第228个PP上 0002 0229 hdisk0 ->第二个LP映射在hdisk0的第229个PP上 # lslv -m lvinformix lvinformix:/opt/informix LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0118 hdisk1 0131 hdisk0 ->lvinformix有镜像, 1个LP对应2个PV, 第1个LP对应第1个PV的第118个PP和第2个PV的第131个PP 0002 0119 hdisk1 0132 hdisk0 ->第2个LP对应第1个PV的第119个PP和第2个PV的第132个PP # lslv -L testlv1 LOGICAL VOLUME: testlv1 VOLUME GROUP: testvg LV IDENTIFIER: 0008516600004c000000010534b4151f.1 PERMISSION: read/write VG STATE: active/complete LV STATE: opened/syncd TYPE: jfs WRITE VERIFY: off MAX LPs: 512 PP SIZE: 8 megabyte(s) COPIES: 1 SCHED POLICY: parallel LPs: 512 PPs: 512 STALE PPs: 0 BB POLICY: relocatable INTER-POLICY: maximum RELOCATABLE: yes INTRA-POLICY: middle UPPER BOUND: 32 MOUNT POINT: /zhaop LABEL: /zhaop MIRROR WRITE CONSISTENCY: on/ACTIVE EACH LP COPY ON A SEPARATE PV ?: yes #lslv hd5 //lslv查看各个lv的详细信息 LOGICAL VOLUME: hd5 VOLUME GROUP: rootvg LV IDENTIFIER: 00009856b3996546.1 PERMISSION: read/write VG STATE: active/complete LV STATE: closed/syncd TYPE: boot WRITE VERIFY: off MAX LPs: 512 PP SIZE: 8 megabyte(s) COPIES: 1 SCHED POLICY: parallel LPs: 1 PPs: 1 STALE PPs: 0 BB POLICY: relocatable INTER-POLICY: minimum RELOCATABLE: no INTRA-POLICY: edge UPPER BOUND: 32 MOUNT POINT: N/A LABEL: None MIRROR WRITE CONSISTENCY: on EACH LP COPY ON A SEPARATE PV ?: yes ## lslv end ## mklv start ##在卷组vgtest上创建逻辑卷lvtest mklv -t jfs -e x -y lvtest vgtest 512 //-t: 指定lv的文件系统类型,包括:(1)jfs;(2)jfslog;(3)paging;(4)raw //-e: 指定物理卷分配策略,后跟x和m, x:数据存储于最多几个磁盘上;m:数据存储于最少几个磁盘 //-y: 指定新逻辑卷名称 //vgtest: 新逻辑卷所在卷组名称 //512: 逻辑卷包含的LP个数 ##在卷组vg03上创建逻辑卷 mklv -c 3 -u 2 -s n vg03 9 //-c: 新LV的镜像个数 //-u: LV的数据限制在2个磁盘上 //-s: 指定分配策略, 后跟y,n,s y:严格分配策略,逻辑分区的拷贝不共享相同的物理卷,此为缺省值; n:不设置严格分配策略,逻辑分区的拷贝可共享相同的物理卷; s:超级严格分配策略,一个为镜像分配的分区不能和另一个镜像的分区共享相同的物理卷; ##创建卷组vg03, 大小为15个LP, 这15个LP分别从磁盘hdisk5、hdisk6、hdisk9上选择 mklv vg03 15 hdisk5 hdisk6 hdisk9 ##在vg05上创建LV,-u:指定磁盘个数,3个磁盘;-S:设置条带化,条带化大小为64K mklv -u 3 -S 64K vg05 12 ##在vg05上创建LV, 条带化大小为8K,大小为12个LP,存在于hdisk1,hdisk2,hdisk3 mklv -S 8K vg05 12 hdisk1 hdisk2 hdisk3 ## mklv用例end ##扩大逻辑卷空间,逻辑卷mylv增加10个LP extendlv mylv 10 ## mklvcopy start #mklvcopy-> 对指定逻辑卷进行镜像 Usage: [-a IntraPolicy] [-e InterPolicy] [-k] [-m MapFile] [-u UpperBound] [-s Strict] LVname LPcopies [PVname...] #mklvcopy hd10opt 2 hdisk1 //在hdisk1上创建1个逻辑卷hd10opt的镜像副本,前提是hdisk1上必须有足够的空闲空间 //2表示增加一个副本 //确认执行是否成功:lslv -m hd10opt #syncvg -l LogVol_name //同步新镜像副本中的分区,或者:syncg -p hdisk1 #rmlvcopy hd10opt 1 hdisk1 //删除hdisk1上的逻辑卷hd10opt的副本, 目前hdisk1上没有hd10opt的副本 #例1 start 将原始逻辑卷复制到另一物理卷,给逻辑卷做镜像 注意:要在并行卷组环境中成功完成此过程,必须在所有并行节点上安装 AIX 4.3.2 或后续版本 mklvcopy LogVol_name 2 new_PhysVol_name //使用以下命令在卷组的新物理卷上创建逻辑卷的镜像的副本 example: mklvcopy hd10opt 2 hdisk1 //在hdisk1上创建1个逻辑卷hd10opt的镜像副本,前提是hdisk1上必须有足够的空闲空间 //使用lslv -l hd10opt查看hd10opt分布在哪些物理磁盘上 # lslv -m hd10opt //使用lslv命令查看命令执行结果成功 hd10opt:/opt LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0232 hdisk0 3370 hdisk1 0002 0297 hdisk0 3371 hdisk1 0003 0298 hdisk0 3372 hdisk1 syncvg -l LogVol_name //使用以下命令同步新镜像副本中的分区 syncvg -l hd10opt rmlvcopy LogVol_name 1 old_PhysVol_name //使用以下命令从物理卷除去逻辑卷的副本 rmlvcopy hd10opt 1 hdisk1 //删除hdisk1上的逻辑卷hd10opt的副本 此时,原始逻辑卷副本可用 #例1 end #例2 start 更改逻辑卷名称 umount /FSNAME //取出逻辑卷对应的文件系统 chlv -n NewLVName OldLVName //重命名逻辑卷 mount /FSNAME //重新挂接逻辑卷对应的文件系统 #例2 end ## mklvcopy end //删除逻辑卷 rmlv -f lvtest ****** 逻辑卷管理end ****** 卷组管理start #mkvg -t 16 -s 4 -y vgdata hdisk2 //在hdisk2上创建卷组vgdata //-t 16: 指定系数factor=16, 每个PV中PP的个数限制 //-s 4: 指定物理分区大小PP SIZE=4MB //必须满足要求: factor×PP SIZE×1016≥hdisk2 //上式结果:16×4M×1016=65024M, 即hdisk2空间必须小于65024M, 若不小则需调整factor和PP SIZE #mkvg -y myvg -d 10 -s 8 hdisk1 hdisk5 //-d: 该vg最多容纳10个pv //-s: 设置pp的大小 //-y: 新vg的名称 #varyonvg vgdata //激活卷组vgdata #varyoffvg vgdata //去激活卷组vgdata #exportvg testvg //若smcp2上已经有testvg的信息, 则先删除原有信息(exportvg), 再引入新信息(importvg) #importvg -y vgsmp hdisk2 //将vgsmp信息引入hdisk2 #chvg -u rootvg //将锁定的卷组解锁 #chvg -ay VGname //使卷组可以自动激活 #chvg -an VGname //取消卷组自动激活 ###lsvg start #lsvg -p rootvg //列出卷族rootvg包含的物理卷信息和状态 rootvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk0 active 537 0 00..00..00..00..00 hdisk1 active 8750 3822 1750..877..00..00..1195 #lsvg -o //查询所有处于激活状态的卷组 #lsvg //显示存在的vg Usage: lsvg [-o] [[-L] -n PVname] Lists the characteristics of a volume group. #lsvg rootvg //显示rootvg信息 VOLUME GROUP: rootvg VG IDENTIFIER: 00009856b3996546 VG STATE: active PP SIZE: 8 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 537 (4296 megabytes) MAX LVs: 256 FREE PPs: 3 (24 megabytes) LVs: 9 USED PPs: 534 (4272 megabytes) OPEN LVs: 8 QUORUM: 2 TOTAL PVs: 1 VG DESCRIPTORS: 2 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per PV: 1016 MAX PVs: 32 //MAX PVs项有3种选择: 32表示常规;128表示大容量;1024表示可扩展卷组 # lsvg -L testvg //显示卷组testvg的详细信息 VOLUME GROUP: testvg VG IDENTIFIER: 0008516600004c000000010534b4151f VG STATE: active PP SIZE: 8 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 537 (4296 megabytes) MAX LVs: 256 FREE PPs: 24 (192 megabytes) LVs: 2 USED PPs: 513 (4104 megabytes) OPEN LVs: 2 QUORUM: 2 TOTAL PVs: 1 VG DESCRIPTORS: 2 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per PV: 1016 MAX PVs: 32 LTG size: 128 kilobyte(s) AUTO SYNC: no HOT SPARE: no #lsvg -l rootvg //查看vg中的逻辑卷的信息, 确认逻辑卷是否镜像 rootvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT hd5 boot 1 1 1 closed/syncd N/A ->此处显示1个lp对应1个pp, 说明lv没有做镜像 hd6 paging 64 64 1 open/syncd N/A hd8 jfslog 1 1 1 open/syncd N/A hd4 jfs 2 2 1 open/syncd / hd2 jfs 458 458 1 open/syncd /usr hd9var jfs 2 2 1 open/syncd /var hd3 jfs 60 60 2 open/syncd /tmp hd5 boot 1 2 2 closed/syncd N/A ->如果逻辑卷做过镜像, 则1个LP对应2个PP hd6 paging 4 8 2 open/syncd N/A hd8 jfslog 1 2 2 open/syncd N/A #lsvg -p rootvg //查看rootvg中的物理卷信息和状态 rootvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk0 active 546 463 109..65..71..109..109 hdisk1 active 546 476 109..78..71..109..109 ###lsvg end ##将名为hdisk3的pv加入datavg中 extendvg -f datavg hdisk3 ##缩小卷组大小;-d:表示在删除pv的时候先删除其中的lv及相关数据;-f 表示强行删除, 不需确认 reducevg -df 'datavg' 'hdisk3' ### mirrorvg start mirrorvg->创建卷组镜像 Usage: mirrorvg [-S | -s] [-Q] [-c Copies] [-m] VGname [PVname...]镜像卷组 例子: #mirrorvg rootvg //镜像rootvg #mirrorvg -c 3 workvg //镜像workvg, 设置3个副本 #mirrorvg -S -c 3 workvg //背景中同步创建的镜像 #mirrorvg -m datavg hdisk2 hdisk3 //创建一个精确映射的卷组 #mirrorvg -m rootvg hdisk11 //在hdisk11上创建rootvg的镜像, hdisk11属于rootvg #smit mirrorvg //卷组镜像 ##制作rootvg卷组镜像 环境:rootvg包含在hdisk01中,镜像制作到hdisk11的磁盘中,以下为具体步骤: 检查hdisk11是否可设为引导设备,若此命令返回值是1, 表示hdisk11可以由AIX引导, 其他返回值表示hdisk11不是rootvg制作镜像的候选 bootinfo -B hdisk11 扩展rootvg以包含hdisk11 extendvg rootvg hdisk11 mirrorvg -m rootvg hdisk11 //使用精确映射选项制作rootvg镜像 bosboot -a //创建固定磁盘(此该磁盘引导系统)上的缺省引导逻辑卷上的引导印象 //bosboot -ad hdisk1, 在hdisk1上创建boot image, hdisk1就可以做为引导盘 bootlist -m normal hdisk01 hdisk11 //设置主机中系统的引导顺序依次为:hdisk01,hdisk11 bootlist -m normal -o //查询系统引导顺序 ### mirrorvg end ******卷组管理end ****** 文件系统start #列示文件系统 smit fs #列示文件系统, /etc/filesystems文件中包含的文件系统和相关逻辑卷信息 lsfs name Nodename Mount Pt VFS Size Options Auto Accounting /dev/hd4 -- / jfs 32768 -- yes no /dev/hd1 -- /home jfs 16384 -- yes no /dev/hd2 -- /usr jfs 7503872 -- yes no /dev/hd9var -- /var jfs 32768 -- yes no /dev/hd3 -- /tmp jfs 950272 -- yes no /proc -- /proc procfs -- -- yes no /dev/hd10opt -- /opt jfs 49152 -- yes no /dev/lv00 -- /oracle jfs 65536000 rw yes no /dev/lvinformix -- /informix jfs 11386880 rw yes no /dev/cd0 -- /cdrom cdrfs -- ro yes no //列示已安装的文件系统 mount node mounted mounted over vfs date options -------- --------------- --------------- ------ ------------ --------------- /dev/hd4 / jfs Jan 25 10:14 rw,log=/dev/hd8 /dev/hd2 /usr jfs Jan 25 10:14 rw,log=/dev/hd8 /dev/hd9var /var jfs Jan 25 10:14 rw,log=/dev/hd8 /dev/hd3 /tmp jfs Jan 25 10:15 rw,log=/dev/hd8 /dev/hd1 /home jfs Jan 25 10:16 rw,log=/dev/hd8 /proc /proc procfs Jan 25 10:16 rw /dev/hd10opt /opt jfs Jan 25 10:16 rw,log=/dev/hd8 /dev/lv00 /oracle jfs Jan 25 10:16 rw,log=/dev/hd8 /dev/lvinformix /informix jfs Jan 25 10:16 rw,log=/dev/hd8 //文件系统参数 -g vgname //为文件系统指定卷组 -m mountpoint //文件系统挂接点的目录名 -A yes|no //系统启动时是否自动挂接 -p rw|ro //安装的文件系统以只读(ro)或读写(rw)方式安装 //使文件系统碎片连续化 defragfs //验证文件系统内容 fsck >检查日志记录 >检查inodes间接数据块空闲表 >不指定文件系统时检查/etc/filesystems文件中标记为check=true的所有文件系统 >错误记录存放在/lost+found >参数说明: -p: 验证文件系统的过程只会引起极少变动,不会影响其他用户工作 -y、-n: 选项用来指定对系统提问的回答 -y: 选项通常用来修改损坏的文件系统,允许删除一些损坏的文件 //需要控制增长的文件 /var/adm/wtmp /var/spool/*/* /smit.log /smit.script /etc/security/failedlogin /var/adm/sulog 上述文件增长很快,需要定期监看和清除,如果运行记帐系统,则可使这些文件定期清除. ******文件系统end ****** 网络管理start //主机名以及IP地址 /etc/hosts //管理域名服务器IP地址 /etc/resolv.con //管理多个基本网络服务 /etc/inetd.conf //管理服务和端口的对应关系 /etc/services ###IBM小型机无法telnet和ftp,但可ping通,通常telnet或者ftp相关进程没有启动会出现上述故障,需要启动inetd进程(包括telnetd,ftpd子进程) startsrc -s inetd ###在IBM小型机网卡上配置别名IP AIX 5.3 通过smitty tcpip里的Further Configuration来实现配置别名IP,按照如下菜单操作: smitty tcpip -->Further Configuration-->Network Interface-->Network Interface Seletion-->Configure Aliases-->Add IPV4 Network Aliases 再选择你所要增加别名IP的网卡后,输入IP地址和掩码即可 ###看本机网卡详细信息时用 entstat -d 网卡名 ###修改网卡速率或网卡模式时用 smitty chgenet ###可以查看到网卡的速率等信息,或者entstat -d ent0 netstat -v ###查看机器的数据流量 netstat -p tcp ###查看网卡ent0的MAC地址 # lscfg -vl ent1 DEVICE LOCATION DESCRIPTION ent1 10-80 IBM 10/100 Mbps Ethernet PCI Adapter (23100020) Network Address.............006094E9322D Displayable Message.........PCI Ethernet Adapter (23100020) Device Specific.(YL)........P2/E1 ****** 网络管理end ### 查看ssa硬盘阵列硬盘状态,smit方式 start #smit ssaraid SSA RAID Arrays Move cursor to desired item and press Enter. List All Defined SSA RAID Arrays List All Supported SSA RAID Arrays List All SSA RAID Arrays Connected to a RAID Manager List Status Of All Defined SSA RAID Arrays List/Identify SSA Physical Disks List/Delete Old RAID Arrays Recorded in an SSA RAID Manager List Status of Hot Spare Pools List Status of Hot Spare Protection for an SSA RAID Array List Components in a Hot Spare Pool Add a Hot Spare Pool Add an SSA RAID Array Delete an SSA RAID Array Change/Show Attributes of an SSA RAID Array Change Member Disks in an SSA RAID Array Change/Show Use of an SSA Physical Disk Change Use of Multiple SSA Physical Disks Change/Show/Delete a Hot Spare Pool Array Copy Services 选择"List 立即下载

相关推荐

aix command

aix command

HCF_SPEC-81 数据链路层规范:帧格式

通信的帧格式在数据链路层文件中定义。参考:http://yunrun.com.cn/tech/2850.html。

qq_39282826的博客 938

AIX command

AIX command 包含常用的AIX command 以及 用法 和命令解析,欢迎下载共同分享~

Aix小结

一、 Aix简介 Aix是Unix操作系统的版本之一,主要应用在IBM RISC 6000系列小型机上。其他的Unix ,如SUN的Solaris ,HP Unix以及Linux等等。目前Aix系统的版本有Aix 4.x Aix5.x等。它们之间只是版本不同,但内核都是一样的,操作命令机本上也相同。版本高的会新增一些命令,都是向下兼容的。 二、 Aix使用入门 对于大多数用户来说,对于Aix的访问

3992

用C++从零复刻Wordle:手把手教你实现命令行猜词游戏(含完整源码解析)

本文详细介绍了如何使用C++从零开始实现一个命令行版本的Wordle猜词游戏,包含完整的源码解析和核心模块设计。通过游戏逻辑控制器、单词库管理器等模块的构建,开发者可以学习C++实战技巧和性能优化方法,适合提升编程能力和游戏开发兴趣。

weixin_26763955的博客 334

别再让COGI拖慢你的SAP接口!手把手教你配置BAPI_PRODORDCONF_CREATE_TT的同步货物移动

本文深入解析SAP生产订单报工接口中的COGI问题,通过BAPI_PRODORDCONF_CREATE_TT的同步配置实战,解决异步更新导致的性能瓶颈。文章详细介绍了增强点配置和性能验证,帮助用户彻底消除COGI堆积,提升接口效率。

weixin_29214691的博客 482

设计模式-命令模式(Command)

概念:命令模式是一个高内聚模式。命令模式中,所有的请求都会包装成为一个对象,并传给调用者,调用对象寻找可以处理该命令的对象,并把命令传递给相应的对象,该对象执行命令。 类型:行为型设计模式 优劣: 优点: 类间解耦:调用者角色与接收者角色之间没有任何依赖关系(下方例子中调用者实现功能只需调用Command抽象类的execute方法就可以,不需要了解到底是哪个接收者执行的) 可扩展性好:Comm...

技术小青年一枚 214

TMP112/TMP102温度传感器驱动开发与嵌入式实战

数字温度传感器是嵌入式系统环境感知的核心器件,其通过I²C等标准总线实现高精度、低功耗测温。原理上依赖ΔΣ模数转换与二进制补码数据格式,结合寄存器配置实现模式控制、阈值报警与功耗管理。技术价值体现在±0.5°C级精度、1μA级静态电流及SOT-563超小封装带来的系统集成优势。广泛应用于工业MCU热监控、电池物联网终端、医疗电子温度补偿及汽车ECU板级测温等场景。本文围绕TMP112/TMP102展开,深入解析寄存器协议、硬件接口约束、HAL驱动分层设计、FreeRTOS任务调度及生产级校准方法,覆盖从芯片

weixin_35756690的博客 674

Altium Designer 学习中的问题

Altium Designer使用中的遇到的问题

qq_33361431的博客 8270

从智能手机到汽车电子:聊聊IPC-9702/9704A标准如何帮我们搞定不同场景下的PCB可靠性设计

本文探讨了IPC-9702/9704A标准在智能手机和汽车电子等不同场景下的PCB可靠性设计应用。通过分析消费电子、汽车电子和工业设备中的应力特征,详细解读了IPC标准在应变识别和测试方法论中的核心价值,并提供了具体的轻量化设计策略和全生命周期验证方案,帮助工程师提升PCB的长期可靠性。

weixin_30693683的博客 279

扩展卡尔曼滤波(EKF)理论讲解与实例(matlab、python和C++代码)

扩展卡尔曼滤波(EKF)理论讲解与实例(matlab、python和C++代码) 文章目录扩展卡尔曼滤波(EKF)理论讲解与实例(matlab、python和C++代码)理论讲解KF和EKF模型对比雅可比矩阵计算计算实例应用实例线性模型CV模型:CA模型非线性模型CTRV模型:CTRV实例(python)small demo抛物线demo飞机高度demoC++实例参考文献 我们上篇提到的卡尔曼滤波是用于线性系统,预测(运动)模型和观测模型是在假设高斯和线性情况下进行的。简单的卡尔曼滤波必须应用在符合高斯分布

O_MMMM_O的博客 10万+

Myeclipse——Save not be completed

!在这里插入图片描述

正在加载中...... 1360

西门子 S7-1200 G2 高速计数器的使用方法介绍

西门子 S7-1200 G2 高速计数器的使用方法介绍

Robot_PLC_HMI_Automation 1695

AIX/LINUX 如何查看单个进程在os层面的内存消耗

 --如何查看单个进程在os层面的内存消耗 AIX: $ svmon -Pt10 | perl -e 'while(<>){print if($.==2||$&&&!$s++);$.=0 if(/^-+$/)}'           ---- -用这个可以看最大的占用内存的10个进程  --------------------------------------------

Lixora's DB Home 2596

Python爬虫实战:利用Requests-HTML与异步技术高效爬取B站视频信息及弹幕数据分析

B站的弹幕,远非简单的评论功能,它是一种独特的、实时互动的社交方式,是观众情感的集体宣泄和共鸣。无论是用于内容创作者优化视频结构,还是用于社会学、传播学的研究,亦或是简单的个人兴趣分析,都具备极高的价值。stop_words = {'的', '了', '是', '我', '你', '他', '她', '它', '在', '有', '不', '吗', '吧', '啊', '这', '那'}本文不仅是代码的堆砌,更注重原理的剖析、反爬策略的应对以及工程化的思考,旨在为读者提供一份紧跟技术前沿的实战指南。

2201_76125261的博客 390

YOLOv8【第九章:模型部署篇·第2节】一文搞懂,模型剪枝与压缩技术!

🏆 本文收录于 《YOLOv8实战:从入门到深度优化》 专栏。该专栏系统复现并梳理全网各类 YOLOv8 改进与实战案例(当前已覆盖分类 / 检测 / 分割 / 追踪 / 关键点 / OBB 检测等方向),坚持持续更新 + 深度解析,质量分长期稳定在 97 分以上,可视为当前市面上 覆盖较全、更新较快、实战导向极强 的 YOLO 改进系列内容之一。

**My Coding Family** 1526

Linux系统监控、诊断工具之top命令详解

接触 linux 的人对于 top 命令可能不会陌生(不同系统名字可能不一样,如 IBM 的 aix 中叫 topas ),它的作用主要用来监控系统实时负载率、进程的资源占用率及其它各项系统状态属性是否正常。 下面我们先来看张 top 命令的截图: &lt;img class="aligncenter wp-image-4998" src="http:

Bigdark的专栏 981

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

文档操作系统:模板驱动的自动化排版与结构化内容工作流

在数字内容规模化生产时代,‘文档’已从静态交付物演变为需要持续迭代、多端适配、品牌统一的动态资产。其核心挑战在于如何将非结构化内容(如会议纪要、网页文章、Word草稿)稳定、可复现地转化为专业级PDF、在线文档或邮件嵌入内容。这背后依赖的不是AI写作能力,而是基于结构化文档模型与可编程视觉契约的规则引擎——它通过预定义的页面网格、字体栈、色彩系统和组件库,实现格式即代码、排版即法律。该技术路径显著提升市场、产品、培训等非设计岗位的内容交付效率,支撑白皮书、课件、销售方案等高频文档的批量生产。本文深入解析这一

weixin_34167819的博客 504

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

Ruby应用分发实战:用RubyGems构建可验证、可审计的CLI工具

RubyGems不仅是Ruby依赖管理工具,更是应用级可执行单元的封装与分发协议。其核心原理在于通过.gemspec元数据固化运行时契约(Ruby版本、依赖范围、执行入口),实现跨环境一致运行。技术价值体现在解决‘本地能跑、线上报错’的典型分发困境,支撑CI/CD流水线集成、多版本兼容性控制及安全卸载等工程实践。典型应用场景包括命令行工具(如logwatcher)、微服务组件和企业内部SDK分发。本文聚焦RubyGems五层物理结构、构建三角验证法及全生命周期运维,直面failed to install h

551

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

常用 doc bat 命令总结

常用doc命令总结

sun0322 1万+

Aix no command

http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp http://blog.sina.com.cn/s/blog_465311c101019g85.htmla bout AIX no command (2012-10-25 16:32:06) 转载▼ 标签: it 分类: AIX

业精于勤,荒于嬉;行成于思,毁于随。 2754

AIX 6.0 command

man command  Make File         View File      Modify File     Find File      Zip File  touch file            head           cp                   find             tar -zcvf fielmkdir file          

flexworks的专栏 729

aix ---lspv command

这是昨天留给自己的一个问题,在用prtconf 查看aix系统信息的时候,不明白free distribution是啥意思

沉淀 3万+

AD的PCB文件无法保存问题

AD的PCB文件无法保存问题: 不知道你们在使用AD17的时候,有没有遇到PCB无法保存的问题,现在将解决办法分享给大家。 在点击保存的时候,显示如下信息,文件保存失败。 然后在关闭AD软件再次打开工程的时候,会出现如下问题: 出现上面这种问题,具体原因目前还不清楚,如果哪位大佬知道,麻烦评论区支援一波,感激不尽。下面来说解决办法,就是文件->保存为,把它另存为一个文件,就可以解决了。 ...

weixin_41935674的博客 2万+
下一篇: 关系数据库查询优化分析
xyhermit
博客等级 码龄20年 3粉丝 15原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值