第 30 楼:DEVICES
lscfg lists all installed devices
lscfg -v lists all installed devices in detail
lscfg -vl (device name) lists device details
bootinfo -b reports last device the system booted from
bootinfo -k reports keyswitch position
1=secure, 2=service, 3=normal
bootinfo -r reports amount of memory (/ by 1024)
bootinfo -s (disk device) reports size of disk drive
bootinfo -T reports type of machine
ie rspc,rs6ksmp,rspc or chrp
lsattr -El sys0 -a realmem reports amount of useable memory
mknod (device) c (major no) (minor no) Creates a /dev/ device file.
mknod /dev/null1 c 2 3
lsdev -C lists all customised devices ie installed
lsdev -P lists all pre-defined devices ie supported
lsdev -(C or P) -c (class) -t (type) -s (subtype)
chdev -l (device) -a (attribute)=(new value) Change a device attribute
chdev -l sys0 -a maxuproc=80
lsattr -EH -l (device) -D Lists the defaults in the pre-defined db
lsattr -EH -l sys0 -a modelname
rmdev -l (device) Change device state from available to defined
rmdev -l (device) -d Delete the device
rmdev -l (device) -SR S stops device, R unconfigures child devices
lsresource -l (device) Displays bus resource attributes of a device.
cfgmgr Configures devices
cfgmgr -i /dev/cd0 Configure devices and install drivers from /dev/cd0
if required
cfgmgr -S Run in serial, used with a larger number of disks
cfgmgr -l scsi0 Configure devices on adapter scsi0 only
diag Run hardware diagnostic menu
smitty diag Run hardware diagnostic menu
( 7020-40P and 7248-43P machines cannot run diagnostics, use diagnostics
in the SMS menus instead
diag -d (device) Run diagnostics against a device.
lsslot Displays all hot swap slots
lsslot -c pci Lists all pci hot swap slots
lsslot -c pci -a Lists all available pci hot swap slots
drslot Reconfgiures PCI hot-plug slots
drslot -i -c pci -s U0.1-P1-I3 Display a slot, flashes the LED next to
the slot so that it can be identified.
Power Management (PCI machines)
-------------------------------
pmctrl -a Displays the Power Management state
rmdev -l pmc0 Unconfigure Power Management
mkdev -l pmc0 Configure Power Management
--------------------------------------------------------------------------------
TAPE DRIVES
--------------------------------------------------------------------------------
rmt0.x where x = A + B + C
A = density 0 = high 4 = low
B = retension 0 = no 2 = yes
C = rewind 0 = yes 1 = no
tctl -f (tape device) fsf (No) Skips forward (No) tape markers
tctl -f (tape device) bsf (No) Skips back (No) tape markers
tctl -f (tape device) rewind Rewind the tape
tctl -f (tape device) offline Eject the tape
tctl -f (tape device) status Show status of tape drive
chdev -l rmt0 -a block_size=512 changes block size to 512 bytes
(4mm = 1024, 8mm = variable but
1024 recommended)
dd if=/dev/rmt0 bs=128k count=1 | wc -c
Displays the block size of an unknow tape. Set block size to 0 first.
bootinfo -e answer of 1 = machine can boot from a tape drive
answer of 0 = machine CANNOT boot from tape drive
diag -c -d (tape device) Hardware reset a tape drive.
diag -c -d rmt0
tapechk (No of files) Checks Number of files on tape.
--------------------------------------------------------------------------------
PRINTERS / PRINT QUEUES
--------------------------------------------------------------------------------
splp (device) Displays/changes printer driver settings
splp /dev/lp0
export $LPDEST="pqname" Set default printer queue for login session
lsvirprt Lists/changes virtual printer attributes.
lsallq Displays all queues
rmvirprt -q queuename -d queuedevice Removes a virtual printer
qpri -#(job No) -a(new priority) Change a queue job priority.
qhld -#(job No) Put a hold on hold
qhld -r #(job No) Release a held job
qchk -A Status of jobs in queues
lpstat
lpstat -p(queue) Status of jobs in a named queue
qcan -x (job No) Cancel a job from a queue
cancel (job No)
enq -U -P(queue) Enable a queue
enable (queue)
enq -D -P(queue) Disable a queue
disable (queue)
qmov -m(new queue) -#(job No) Move a job to another queue
startsrc -s qdaemon Start qdaemon sub-system
l***c -s qdaemon List status of qdaemon sub-system
stop -s qdaemon Stop qdaemon sub-system
我的主页:
http://tlcshxd.3322.org/index.html
第 31 楼:FILE SYSTEMS
Physical Volumes (PV's)
-----------------------
lspv Lists all physical volumes (hard disks)
lspv (pv) Lists the physical volume details
lspv -l (pv) Lists the logical volumes on the physical volume
lspv -p (pv) Lists the physical partition usage for that PV
lspv -M (pv) Lists the PP allocation table for that PV.
If the PV state is "missing" but the disk is okay, use "varyonvg vg" to change
the state of the PV to "active".
chdev -l (pv) -a pv=yes Makes a new hdisk a pysical volume.
chpv -v r (pv) Removes a disk from the system.
chpv -v a (pv) Adds the removed disk back into the system.
chpv -a y (pv) Changes pv allocatable state to YES
chpv -a n (pv) Changes pv allocatable state to NO
migratepv (old pv) (new pv) Moves all LV's from one PV to another PV, both
PV's must be in the same volume group.
Migratepv cannot migrate striped logical volumes, use cplv and rmlv.
replacepv (old pv) (new pv) (4.3.3 onwards)
Volume Groups (VG's)
--------------------
lsvg Lists all volume groups
lsvg (vg) Lists the volume group details
lsvg -l (vg) Lists all logical volumes in the volume group
lsvg -p (vg) Lists all physical volumes in the volume group
lsvg -o Lists all varied on volume groups
varyonvg (vg) Vary On a volume group
varyonvg -f (vg) Forces the varyon process
varyonvg -s (vg) Vary on a VG in maintenance mode. LV commands can be
used on VG, but LV,s cannot be opened for I/O.
varyoffvg (vg) Vary Off a volume group
synclvodm (vg) Tries to resync VGDA, LV control blocks and ODM.
synclvodm -v (vg) Rebuilds the LVCB.
(the vg needs to be varied on before running synclvodm)
mkvg -y(vg) -s(PP size) (pv) Create a volume group
mkvg -y datavg -s 4 hdisk1
reducevg (vg) (pv) Removes a volume group
reducevg -d (vg) (pv) Removes a volume group and delete all LV's on the PV
reducevg (vg) (PVID) Removes the PVID disk reference from the VGDA when a
disk has vanished without the reducevg (vg) (pv)
command being run first.
reducevg -df (vg) (pv) Deletes all LV's from the VG and removes the VG
from the disk. If the last disk in the VG then
the VG is deleted.
extendvg (vg) (new pv) Adds another PV into a VG.
exportvg (vg) Exports the volume group, removes the VG entries and
removes all FS entries from /etc/filesystems but
leaves the mount points.
Note : Cannot export a VG if it has active paging space, turn off paging,
reboot before exporting VG. Exporting removes entries from filesystems
file but does not remove the mount points.
chvg -a y (vg) Auto Vary On a volume group at system start.
chvg -u (vg) Unlocks a locked volume group.
lqueryvg -Atp (pv) Details volume group info for the hard disk.
importvg -y (vg name) (pv) Import a volume group from a disk.
importvg (pv) Same as above but VG will be called vg00 etc.
4.3 onwards, importvg will automatically varyon the VG.
chvg -Q (y/n) (vg name) Turns on/off Quorum checking on a VG.
reorgvg (vg) (lv) Reorganised a fragmented LV, must state an LV at the
command line else the first LV in the VG is picked.
Does not reorg the PP's of striped LV's.
Logical Volumes (LV's)
----------------------
lslv (lv) Lists the logical volume details
lslv -l (lv) Lists the physical volume which the LV is on
lsattr -EHl (lv) Displays more logical volume details
mklv (vg) (No of PP's) (pv Name optional) Create a logical volume
mklv -y (lv) (PP's) (pv name optional) Creates a named logical volume
( use -t jfs2 when creating an LV for a JFS2 filesystem
chlv -n (new lv) (old lv) Rename a logical volume
chlv -x (number) (lv) Change max no of PP's
chlv -s n (lv) Turns of strickness on the LV
extendlv (lv) (extra No of PP's) Increase the size of an LV
rmlv (lv) Remove a logical volume
cplv -v (vg to copy to) -y (new lv) (lv) Copy an LV to a new LV
If copying a filesystem LV, umount the filesystem before copying, otherwise you
will have to fsck the the new LV before the filesystem can be mounted.
If copying a striped LV to an LV that is already created, and the stripe
size is different ( or not even striped , then these new parameters are
maintained when the data is copied to the new LV.
cplv -e (new lv) (old lv) Copy to an existing LV
( new lv must have type as copy use chlv -t copy (new lv) to change
mklv/extendlv -a = PP alocation policy
-am = middle -ac = center -ae = edge
-aie = inner edge -aim = inner middle
migratepv -l (lv) (old pv) (new pv)
Move a logical volume between physical volumes. Both physical volumes
must be in the same volume group !
mklv -y (lv) -t jfslog (vg) (No of PP's) (pv Name optional)
Creates a JFSlog logical volume.
logform (/dev/lv) Initialises an LV for use as an JFSlog
getlvcb -AT (lv) Displays Logical Volume Control Block information
File Systems (FS's)
-------------------
lsfs Lists all filesystems
lsfs -q (fs) Lists the file system details
lsjfs Displays data about all filesystems in CSV style format
mount Lists all the mounted filesystems
mount (fs or lv) Mounts a named filesystem
mount -a Mounts all filesystems
mount all
mount -r -v cdrfs /dev/cd0 /cdrom mounts cd0 drive over /cdrom
crfs -v jfs -d(lv) -m(mount point) -A yes
Will create a file system on the whole of the logical volume, adds entry into
/etc/filesystems and will create mount point directory if it does not exist.
( use -v jfs2 for JFS2 filesystems
crfs -v jfs -g(vg) -m(mount point) -a size=(size of fs) -A yes
Will create a logical volume on the volume group and create the file system on
the logical volume. All at the size stated. Will add entry into
/etc/filesystems and will create the mount point directory if it does not exist.
Use attribute "-a log=/dev/log01" to specify a jfslog devices
Use attrubute "-a bf=true" for a large file enabled filesystem
chfs -A yes (fs) Change file system to Auto mount in
/etc/filesystems
chfs -a size=(new fs size)(fs) Change file system size
chfs -m (new-mount-point) (fs) Change the file system mount point.
rmfs (fs) Removes the file system and will also remove the
LV if there are no onther file systems on it.
defrag -q (fs) Reports the fragment status of the file system.
defragfs -r (fs) Runs in report only defrag mode (no action).
defragfs (fs) Defragments a file system.
fsck (fs) Verify a file system, the file system must be unmounted!
fsck (-y or -n) (fs) Pre-answer questions either yes or no !
fsck -p (fs) Will restore primary superblock from backup copy if the
superblock is corrupt.
( or dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00
Mirroring
---------
mklv -y (lv) -c(copies 2 or 3) (vg) (No of PP's) (PV Name optional)
Creates a mirrored named logical volume.
mklvcopy -s n (lv) (copies 2 or 3) (pv)
Creates a copy of a logical volume onto another physical volume. The physical
volume MUST be in the same volume group as the orginal logical volume !
rmlvcopy (lv) (copies 1 or 2) Removes logical volume copies.
rmlvcopy (lv) (copies 1 or 2) (pv) From this pv only!
syncvg -p (pv) Synchronize logical partion copies
syncvg -l (lv)
syncvg -v (vg)
mirrorvg (vg) (pv)
Mirrors the all the logical volumes in a volume group onto a new physical
volume. New physical volume must already be part of the volume group.
chfs -a splitcopy=/backup -a copy=2 /data1
Splits off a copy of a 3 way mirror and mount read only for use as an
offline backup.
--------------------------------------------------------------------------------
BOOT LOGICAL VOLUME (BLV) / PROCESSORS / KERNEL
--------------------------------------------------------------------------------
Mirroring does not work with the BLV as it is not a true logical volume,
bosboot must be run against the other disk after mirroring the rootvg.
bootlist -m (normal or service) -o displays bootlist
bootlist -m (normal or service) (list of devices) change bootlist
bootinfo -b Identifies the bootable disk
bootinfo -t Specifies type of boot
bosboot -a -d (/dev/pv) Creates a complete boot p_w_picpath on a physical volume.
mkboot -c -d (/dev/pv) Zero's out the boot records on the physical volume.
savebase -d (/dev/pv) Saves customised ODM info onto the boot device.
lslv -m hd5 &nbs, p; Find out which disk the BLV is on.
bootinfo -y Displays which kernel can be used, 32 or 64 bit
genkex Reports all loaded kernel extensions.
lsdev -Cc processor Lists all processors
lsattr -EHl proc0 Displays attributes of processor 0. AIX 5.1L will
display processor clock frequency.
--------------------------------------------------------------------------------
SYSTEM DUMP
--------------------------------------------------------------------------------
1, AIX 4.2.1 and greater supports system dump to paging space.
2, AIX 4.3.3 and greater supports system dump to mirrored paging space.
3, Primary dump device must be in the rootvg
4, Secondary dump device can be outside rootvg unless it is a paging device.
sysdumpdev -l Lists current dump destination.
sysdumpdev -e Estimates dumpsize of the current system in bytes.
sysdumpdev -L Displays information about the previous dump.
sysdumpstart -p Starts a dump and writes to the primary dump device.
sysdumpstart -s Starts a dump and writes to the secondary dump device.
(MCA machine can also dump if key is in service position and the reset
button is pressed)
sysdumpdev -p (dump device) -P Sets the default dump device, permanently
Analyse dump file :-
echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0
snap -gfkD -o /dev/rmt0 Copy dump to tape to send to IBM support, uses tar.
--------------------------------------------------------------------------------
PAGING SPACE (PS's)
--------------------------------------------------------------------------------
lsps -a Lists out all paging space
lsps -s Displays total paging and total useage
lsps (ps)
swappon /dev/ps Activates a paging device eg /dev/paging00
swappoff /dev/ps Deactivates a paging device ( AIX 5.x only
mkps -s(No of PP's) -n -a (vg)
mkps -s(No of PP's) -n -a (vg) (pv)
-n = don't activate/swapon now -a = activate/swapon at reboot
mklv -b n -t paging -y hd6 (vg) (No of PP's) (pv)
Creates paging space using the mklv command.
chps -a n (ps) Turns off paging space.
chps -s(No of PP's) (ps) Increases paging space.
chps -d(No of PP's) (ps) Decreases paging space ( AIX 5.x only
chlv -n (new name) (old name) Change paging space name
rmps (ps) Remove paging space. PS must have been turned off
and then the system rebooted before it can be removed.
Note : Need to change the swapon entry in /sbin/rc.boot script if you are
changing the default paging space from /dev/hd6. You also need to
do a "bosboot -a -d /dev/hdiskx" before the reboot.
/etc/swapspaces File that lists all paging space devices that are
activated/swapon during reboot.
--------------------------------------------------------------------------------
SCHEDULING
--------------------------------------------------------------------------------
crontab -l List out crontab entrys
crontab -e Edit crontab entrys
crontab -l > (filename) Output crontab entrys to a file
crontab (filename) Enter a crontab from a file
crontab -r Removes all crontab entrys
crontab -v Displays crontab submission time.
/var/adm/cron/cron.allow File containing users allowed crontab use.
/var/adm/cron/cron.deny File containing users denied crontab use.
/var/adm/cron/crontab Directory containing users crontab entries.
/var/adm/cron/log Cron log file.
at (now + 2 minutes, 13:05, etc) {return} Schedule a job using at
Command or schell script {return}
{CTRL D}
echo "shutdown -Fr" | at now + 1 minute
at -l
atq Lists out jobs scheduled to run via at command
at -r (at job No)
atrm (at job No) Removes an at job scheduled to run.
/var/adm/cron/at.allow File containing users allowed at use.
/var/adm/cron/at.deny File containing users denied at use.
/var/adm/cron/atjobs Directory containing users at entries.
--------------------------------------------------------------------------------
SECURITY
--------------------------------------------------------------------------------
nulladm /var/adm/wtmp To recreate/clear down the wtmp file.
groups Lists out the groups that the user is a member of
我的主页:
http://tlcshxd.3322.org/index.html
第 32 楼:AIX经验搜集
如何建立第二个root用户
AIX V3, V4
建立第二个root用户
步骤如下:
1. 添加一个用户
2. 手工修改/etc/passwd文件中的 user ID 和 group ID
3. 将user ID改为0.
如下,可对用户russ做改动:
将 russ:!:206:1::/u/russ:/bin/ksh
改为:russ:!:0:0::/u/russ:/bin/ksh
具有root权限的用户可执行一条命令,完成特定的任务。如下你可以建立一个用户(shutdown)负责系统的重启动.
在AIX 3.2.5中:
shutdown:!:0:0::/u/shutdown:/etc/shutdown -Fr
在AIX 4:
shutdown:!:0:0::/u/shutdown:/usr/sbin/shutdown -Fr
这个用户一注册,操作系统就会重起。
AIX 的许可权限
说明
如何查看许可权限
许可权限字母的意义
当产生文件或目录时, 如何决定性权限
如何改变文件或目录的所有者或组
如何改变文件或目录的权限
ACL
文件系统和目录安装点权限
NFS安装文件系统许可
本文介绍了AIX 如何控制文件和目录的权限 。所有文件和目录对以下对象都有权限控制 : 所有者(通常是创造文件的人)
用户组(将该组作为组集之一部分或主组的任何人)
其他人(不是所有者或不属于这个群的用户以外的任何用户)
AIX 4.3版本和RS/6000产品资料可在以下网址获得 :
http://www.rs6000.ibm.com/resource/aix_resource/pubs/index/index
html.
1.如何查看许可权限
执行命令" Is -l file_name " 或" Is -ld directory-name" 会显示不同的数据, 左侧的一个 有10个字符的字串:
—rwxrwxrwx
该字符串可分解为3个许可权限集:
—rwx rwx rwx
| | |其他用户许可 。
| |
| |
| 把该组作为主组或作为他们组集之一部分的用户许可。
|
文件或目录所有者许可
这些命令同时也显示文件或目录的所有者和用户组 。
—rwxrwxrwx joe joegroup
许可 所有者 用户组
所显示的所有者名称来自 /etc/passwd。文件的inode 存储用户的Id 。如果你看到的是一个数字而不 是名称,这就是说/etc/passwd文件无法读取,或该文件不存在此用户id 。同样,用户组的名称来自/etc/group 文件.
系统首先检查你是否是所有者;如果是,你会得到所有者的许可权限 ,即使这个许可比 “用户群”或“其他人”许可权限集严格。
然后系统会检查你是否将该组列为主组或组集的一部分。如果是,你会得到组许可,尽管这些 许可限制比“其他人”许可权限集更严格。
如果你既不是所有者也不是组集的一部分,你会得到“其他人”的许可。
2. 许可权限的字母的意义
许可权限字母的意思因文件或目录的不同而有区别。读/写目录的权限与读/写目录所指文件的权限无关。
对于目录,许可权限字母的含义如下:
r --- 指读目录中文件列表的能力,如"ls"命令。
注 :如果只有读目录列表的许可,则不可以在目录内部执行命令。
x ---目录搜索能力。可以在已知文件名时在目录中执行此文件。一般来说,大多数目录操作都要求读®和搜索(x)权限。
w---同搜索(x)权限共同使用时,在目录中产生或删除文件的能力。如果目录具有写的权限,而没有在文件写的权限,你仍可以删除文件,但不可以修改文件.
t ---指链接权限。设置链接权限可防止除文件所有者、根用户和目录所有者之外的所有用户删除文件,虽然目录中的权限可能允许删除这个文件。在这种情况下,可为“其他人”设置搜索(x)位。
T---同t相同,但不为其他用户设置搜索(x)位。
s---不适用于所有者。用于用户组 ,它成为组的继承位(sgid,亦称set groupid) 。这个目录中创建的所有文件都与此目录有同样的组。
S---与s相同,但不为用户组设置搜索(x) 。
对于文件,许可字母有下列含义:
r--- 指阅读文件的能力。
w--- 指修改文件的能力。只有在目录中有写权限时才可以创建或删除文件。
x--- 指执行文件的能力。
3. 当产生文件或目录时,如何决定性权限?
用户id(uid)用来设置文件所有者。主组用来设置用户组(除非创建文件的目录有Sgid位设置)。
"umask "可设置初始权限。在命令行中键入"umask "命令,查看当前设置 ,如要修改" umask"设置,输入umask号码,如:
umask 022。
"umask" 命令不设置文本文件和脚本文件而只在目录中设置执行位。
如果你创建一个目录或文本文件,可按以下例子设置权限 :
以umask 022为例 :
777-022=755
666-022=644
执行"ls -l",会显示以下权限,(r=4, w=2, x=1)
目录:rwxr-xr-x
文本文件:rw-r--r--
4.如何改变文件或目录的所有者或组?
"chown "和 "chgrp" 命令用于改变所有者和组。只有"根 "用户才能改变文件的所有者。" 根"用户或文件的拥有者可以改变这个文件的组。
使用Chgrp命令:chgrp (New_group_name) (file_name)
使用Chown命令: Chown (new_owner) (file_name) 或 chown (new_owner) (file_name)
5.如何改变文件或目录的权限?
使用"chmod "命令来改变文件或目录的权限.权限可以用字母或数字表示。读 ® = 4 ,写(w) = 2 ,执行(或搜索)(x) = 1
这些数字加到一起就得到用于chmod命令的数字.(注意:如果您正在文件或目录中使用ACL,使用数字模式chmod命令会使ACL无效) 。
如 :所有者权限:读+写+执行= 4+2+1=7
组 许 可 权 限 : 读 + 写 = 4+2 =6
其他用户许可权限:阅读=4
chmod 764 file_name。
如要设置特殊位如suid(设置用户ID)、sgid和链接数位,chmod命令需要第四个数字。
suid=4
sgid=2
link=1
如要在前面的例子中加入suid许可,它的命令是:
chmod 4764 file_name
如果采用符号模式,首先确定要改变哪个位置所有者 、组[g] ,其他[o] 或所有[a])和要加(+)或减(- )哪些符号。要为所有者增加读和写的权限,可采用以下两种方式:
chmod u+r u+w (file_name) 或 chmod u+rw (file_name)
6. ACL
ACL是对标准权限位的扩展。通过修改分配给个人或组的标准权限,对每个文件或目录进行更精细的控制。对每个组或用户,有3种权限分配情况:
PERMIT : 准许对文件或目录的特定权限。
DEMY : 限制对文件或目录的特定权限。
SPECIFY : 明确地定义文件或目录权限。
"acledit "命令用于建立ACL。首先必须设置文本编辑器.如:export EDITOR=/usr/bin/vi。
然后使用:acledit file_name
屏幕上将会显示:
attributes:
base permissions
owner (rcunning): rwx
group (staff): r—
others: ---
extended permissions
disabled
要设置扩展的权限,将“disabled ”设置改为“enabled”:
extend permissions
enabled
使用permit、deny 或specify关键字来定义扩展权限。前面的例子表明只有所有者能对这个文件写操作。组成员能读此文件而其他用户则没有任何许可权限。如果要使用户" joe"能够读写这个文件,用以下命令:
extended permissions
enabled
permit rw- u: joe.
要允许组用户joegroup读这个文件,用以下命令:
rermit r-- g: joegroup
你能够通过在同一行中合并多个条目来对权限进行微调。如果只想为pete提供读写权,而他是系统组的一部分,则用以下命令:
permit rw- u: pete, g: system
要为几个用户或组增加许可权限,则使用分行命令 :
permit rw- u: joe
permit rw- u: pete
使用" ls -el"命令,查看ACL是否已在文件中设置。如"ls -el profile"命令显示:
— rwxw--------+
最后的+表示文件已具 有有效的ACL 。
注意:使用有数字争议的chmod 命令将使文件或目录的ACL无效。
7.文件系统和目录安装点权限
文件系统安装在目录安装点上。安装点和文件系统都有权限。安装点的权限由文件系统创建时所采用的umask设置来决定。
虽然已安装文件系统的权限优先于安装点的权限,但安装点必须尽可能限制每个人的搜索权限(也就是111)来避免不可预测的结果。记住,安装文件系统后,不能看到安装点上的权限。在检查或改变安装点权限之前,必须卸载(umount )文件系统。
在创建文件系统时,缺省权限来自基本文件,同时sgid (组 继 承)位被设置。用户的umask不用于文件系统中而只用于基础安装点。
8.NFS安装文件系统许可
网络文件系统(NFS)安装在当地目录中。目录安装点在创建网络安装文件系统时建立。安装点在建立时使用当前的umask设置来决定许可权限。
NFS 安装文件系统使用一个叫作nobody的特殊用户id。这个uid一般都是很大的数字,以便使它不会和真实用户id发生冲突。除非NFS服务器在 /etc/passwd中有您的用户id(不是文本名) ,否则你在远程安装文件系统时所享有的权限只使用该假用户nobody。如果你的用户id碰巧与远程系统的某个有效id相吻合,你就会成为是由那个所有者创建的所有文件的所有者。这有可能导致无法预见的严重后果。如果你希望能够在远程系统中创建和拥有文件,你的本地系统和服务器系统必须具有与 /etc/passwd文件中相匹配的用户(用户名称和相同的id号码)。而且文件系统必须以能够读和写的形式输出。
"根"用户是一个特殊情况。由于“根”用户id在所有系统中都是0,如果没有特殊保护,任何安装该文件系统的系统都将成为该服务器系统的根。因此,NFS文件系统的输出必须带有一些主机名称的" 根"接入,以便使您可以从这些主机名称中要求特殊的"根"接入。如果文件系统不以这种方式输出,"根"就成为用户nobody.
如何限制用户改变密码
RS6000,AIX V4
如何限制用户改变密码?
可以用命令pwdadm -f ADMIN username来实现,如果想让用户恢复更改密码的权利,运行pwdadm -f ADMCHG username 来重置.
非root用户的登录问题
本文档描述了非root用户的登录及权限问题, 以及这些问题如何通过检查目录和文件的权限, 属主及属组来解决.
问题的症状
. 用户得到下面的错误信息, 可能指明组文件丢失或被破坏:
3004-010 设置终端属主和模式失败
/etc/passwd 文件中对应该用户的主组不能在/etc/group文件中被找到.
如 tps:!:215:1::/u/tps:/bin/ksh
在上例中, 组号为1. 检查/etc/group文件确认组号1存在.
. 只有root用户可以登录, 一般用户得到下面的错误信息:
3004-009 运行登录初始程序失败
或
系统不可用
. 执行命令 su - [user_name] 时返回如下错误:
3004-505 不能设置进程环境
. 用户登录后得到如下错误信息:
0653-345 权限被拒绝
(当登录后进行任何操作时)
或
ksh: pwd: 不能访问父目录
(当登录后执行pwd命令时)
这些现象是由于用户不能执行登录初始程序或由于用户主目录的权限问题造成的.
检查问题文件和目录的步骤
下述步骤说明如何检查有权限问题的文件或目录.
如果任何文件或目录的权限有问题, 使用命令 chmod, chown 或 chgrp 更改相应的权限, 属主或属组.
如果符号链接丢失, 使用ln命令重建它.
例如, 要创建/bin链接到/usr/bin, 执行下面的命令:
ln -s /usr/bin /bin
步骤
1. 以root身份登录
2. 如果非root用户登录时得到的是系统不可用的错误, 则继续本步骤. 否则, 跳到下一步.
用命令 ls -l /etc/nologin 命令检查文件/etc/nologin.
如果文件/etc/nologin存在, 用命令 rm /etc/nologin 删除它.
对于AIX 4.x, 执行:
cd /
ls -al
输出举例:
drwxr-xr-x 19 bin bin 1024 Dec 12 21:14 .
drwxr-xr-x 19 bin bin 1024 Dec 12 21:14 ..
lrwxrwxrwx 1 bin bin 8 Nov 22 09:37 bin -> /usr/bin
drwxrwxr-x 4 root system 2048 Dec 12 21:12 dev
drwxr-xr-x 12 root system 2048 Dec 12 21:11 etc
drwxr-xr-x 5 bin bin 512 Nov 22 14:51 home
lrwxrwxrwx 1 bin bin 8 Nov 22 09:37 lib -> /usr/lib
drwxr-xr-x 20 bin bin 512 Nov 22 13:33 lpp
drwxr-xr-x 3 bin bin 512 Nov 22 09:37 sbin
lrwxrwxrwx 1 bin bin 5 Nov 22 09:37 u -> /home
drwxr-xr-x 20 bin bin 512 Nov 22 14:24 usr
drwxr-xr-x 12 bin bin 512 Nov 22 12:59 var
3. 执行:
ls -ld /usr/bin /usr/lib /tmp
输出举例:
drwxr-xr-x 3 bin bin 10752 Nov 22 12:53 /usr/bin
drwxr-xr-x 28 bin bin 4096 Dec 15 17:08 /usr/lib/
drwxrwxrwt 8 bin bin 2560 Jan 22 14:46 /tmp/
4. 执行:
ls -l /usr/bin/csh /usr/bin/ksh /usr/bin/bsh
输出举例:
-r-xr-xr-x 2 bin bin 341020 Nov 22 09:37 /usr/bin/bsh
-r-xr-xr-x 1 bin bin 154412 Nov 22 09:37 /usr/bin/csh
-r-xr-xr-x 4 bin bin 230148 Nov 22 09:37 /usr/bin/ksh
确定用户的主目录. 在这些步骤中, 假定用户的ID和目录为"user_one".
5. 执行:
ls -ld u/user_one (use path of user's directory)
输出举例:
-drwxr-xr-x 9 user_one system 7680 Dec 24 15:00 /u/user_one
该目录应被此用户所有, 并且此用户应对它有rwx权限.
6. 执行:
cd /u/user_one
ls -al | pg
输出举例:
drwxr-xr-x 9 user_one system 7680 Dec 24 15:00 .
drwxr-xr-x 71 bin bin 1536 Dec 14 09:37 ..
"."目录的所有者应为该用户. ".."目录的权限对于组和其它用户至少应为r-x.
7. 如果用户仍然有权限被拒绝的问题, 但没有登录的问题, 则可能是由于文件系统mount点的权限造成的.
为了检查mount点的权限, 文件系统必须首先被unmount. 一些文件系统的mount点则只能在进入系统维护模式的情况下进行检查.
如何屏蔽某一用户的ftp访问?
产品: AIX
平台: RS
机型: RS6000
如何屏蔽某一用户的ftp访问?
将被拒绝的用户名加入到/etc/ftpusersw文件中
var/adm/wtmp档案太大怎么办
产品:RS/6000
软件:AIX
/var/adm/wtmp文件保存所有用户登录的讯息,随著时间会增长到很大,/var/adm/wtmp档案太大时怎么办?
/var/adm/wtmp档案太大时,有时需要清理或编辑整理。
要清理它,执行cp /dev/null /var/adm/wtmp.
要编辑整理部分清理,用fwtmp命令先将文件wtmp变成ASCII格式的档案dummy.file:
/usr/sbin/acct/fwtmp dummy.file,
编辑之後用
/usr/sbin/acct/fwtmp -ic /var/adm/wtmp
再将ASCII文件转变成二进位文件.
JESMSG显示屏幕,进行类似于上述2中的操作即可.
AIX 用户的系统资源使用限制
说明
适用操作系统
网络配置步骤
本文介绍的是AIX用户的系统资源使用限制,以及修改方法。
适用操作系统
AIX V4
网络配置步骤
AIX 用户使用的系统资源限制包括两个概念 --- 硬限制(hard limits) 和软限制(soft limits)。
hard limits自AIX 4.1版本开始引入。hard limits 应由AIX系统管理员设置,只有security组的成员可以将此值增大,
用户本身可以减小此限定值,但是其更改将随着该用户从系统退出而失效。使用下列命令可以查看hard limits的限定值:
ulimit -Ha
soft limits 是AIX核心使用的限制进程对系统资源的使用的上限值。此值可由任何人更改,但不能超出
hard limits值。这里要注意的是只有security组的成员可使更改永久生效,普通用户的更改在其退出系统
后将失效。使用以下命令可以查看soft limits的设置:
ulimit -a
下面为系统的soft limits的默认值:
3.2
4.1-4.3
===============
=================
fsize = 2097151
fsize = 2097151
core = 2048
core = 2048
cpu = 3600
cpu = -1
data = 131072
data = 262144
rss = 65536
rss = 65536
stack = 8192
stack = 65536
nofiles = 2000*
nofiles=2000 *
* 该值(nofiles)只能在AIX 4.3.1 或以后的版本中更改。
上述定义作为默认值存放在文件 /etc/security/limits 中,在新用户被加进系统后生效。直接更改此文件中的定义值
需要将系统重新启动以便使更改生效。将相应值该为"-1" 表示不受 soft limits的限制(unlimited)。
下面我们将就各字段逐一进行介绍:
fsize 用户创建的文件大小限制。此定义值(512字节为单位)为该用户可以生成的最大文件的大小。
core 生成的core文件大小的限制(512字节为单位)。
cpu 用户进程可用cpu的限定值(以秒为单位)。普通用户只能将此值减小,root可以将此值增大。这里要注意的
是进程使用CPU的时间取决于AIX Kernel(核心程序)进程调度算法,该值在此仅做参考。
data 进程数据段大小的限定值(以字节为单位)。
stack 进程堆栈段大小的限定值(以字节为单位)。
rss 进程常驻内存段的限定值(以字节为单位)。AIX核心并不参考此限定。
nofiles 进程中打开文件的最大数量。此限定在AIX 4.3.1之前的版本中固定为2000。在AIX 4.3.1及其之后的版本中
可将此值增大至32767。
下面介绍三种修改上述限定值的方法:
1. 编辑文件/etc/security/limits,直接修改各定义值。此更改在系统重新启动后生效。
2. 使用命令ulimit修改默认值。例如:
ulimit -f value
ulimit -c
ulimit -t
ulimit -d
ulimit -s
ulimit -m
ulimit -n
将修改fsize, core, cpu,data, stack, rss和nofiles的soft limit值。
3. 使用命令chuser修改某用户的限定值。例如:
chuser fsize=
chuser core=
chuser data=
chuser limit=
chuser rss=
chuser nofiles=
将用户“username”的soft limits改为值“value”。
chuser hard_fsize=
chuser hard_core=
chuser hard_cpu=
chuser hard_data=
chuser hard_limit=
chuser hard_rss=
chuser hard_nofiles=
将用户“username”的hard limits改为值“value”。
[技术文档]目录:
[技术文档]说明/内容摘要:
[技术文档]详述:
更改HACMP环境里网卡的ip地址
AIX,HACMP
如何更改HACMP环境里网卡的ip地址?
更改HACMP环境里网卡的ip地址的步骤如下:
1.运行命令:
/usr/sbin/cluster/utilities/cllsif > /tmp/cllsif.orig ,
/tmp/cllsif.orig文件里就包含您的HACMP网卡当前的ip地址;
2.停止您系统上正在运行的与当前ip地址有关所有应用;
3. 停止所有有关节点系统的HACMP服务:
smitty hacmp
Cluster Services
Stop Cluster Services
4.停止所有有关节点系统的TCPIP服务 :
stopsrc -g tcpip
5.更改各个节点的HACMP网卡的boot和standby地址:
smitty tcpip
Minimum Configuration and Startup
6.在各个节点上编辑/etc/hosts文件,更改成要求的ip地址:
boot,service和standy的ip地址;
7. 在各个节点上启动TCPIP服务:
startsrc -g tcpip
8. 用ping或者telnet命令来测试并确保各个节点在网络中是可访问的;
9.在HACMP的配置里更改ip地址:
smitty hacmp
Cluster Configuration
Cluster Topology
Configure Adapters
Change/Show and Adapter
10. 同步cluster的拓扑结构:
smitty hacmp
Cluster Configuration
Cluster Topology
Synchronize Cluster Topology
11.检验环境:
smitty hacmp
Cluster Configuration
Cluster Verification
12. 运行命令:
/usr/sbin/cluster/utilities/cllsif > /tmp/cllsif.new ,
比较/tmp/cllsif.new文件和先前的/tmp/cllsif.orig文件,所有ip地址的改变都将反映出来;
13.把各个节点上除了rootvg外的所有卷组都置为不可用状态:
varyoffvg vgname ;
14.启动 HACMP服务:
smitty hacmp
Cluster Services
Start Cluster Services
15. 如果用了DNS服务,对DNS服务器做必要的更改;
16. 用新的ip地址进行HACMP的资源接管测试。
如何搜集TCP/IP问题的相关资料
在TCP/IP发生问题时,可搜集相关信息,寄给IBM来诊断
这篇文章主要描述了如何搜集TCP/IP问题的相关资料,然后可以把这些资料传给IBM做技术分析,通过本方法搜集的信息资料比较完全,以避免来回搜集资料的烦琐。这些搜集的资料既可以用来诊断比较简单明显的问题,也可以用来诊断比较复杂的问题甚至是系统bug。
步骤如下:
一、
df命令检查/tmp空间,因为snap将在/tmp下产生ibmsupt目录,并将搜集的所有资料放到该目录下,所以该目录必须有较大空间存放资料,如果/tmp不够,请扩充之,如果不愿在该目录下存放资料,可在snap命令后用 -d 参数指定新的目录。
二、
运行snap -r删除上次所做的snap资料,将出现
The following directories and files will be deleted:
----------------------------------------------------
/tmp/ibmsupt/filesys (directory)
/tmp/ibmsupt/general (directory)
/tmp/ibmsupt/kernel (directory)
/tmp/ibmsupt/nfs (directory)
/tmp/ibmsupt/other (directory)
/tmp/ibmsupt/tcpip (directory)
/tmp/ibmsupt/testcase (directory)
Do you want me to remove these directories (y/n)?
选择y,删除上次所做的snap资料
运行snap -gGtkfn 命令搜集资料,将出现
Checking space requirement for general information..............................
........................................ done.
..Checking space requirement for tcpip information..................... done.
Checking space requirement for nfs information.............. done.
Checking space requirement for kernel information............. done.
Checking space requirement for filesys information..................... done.
Checking for enough free space in filesystem... done.
********Checking and initializing directory structure
Creating /tmp/ibmsupt/filesys directory tree... done.
Creating /tmp/ibmsupt/kernel directory tree... done.
Creating /tmp/ibmsupt/nfs directory tree... done.
Creating /tmp/ibmsupt/tcpip directory tree... done.
Creating /tmp/ibmsupt/general directory tree... done.
Creating /tmp/ibmsupt/general/diagnostics directory tree... done.
Creating /tmp/ibmsupt/testcase directory tree... done.
Creating /tmp/ibmsupt/other directory tree... done.
********Finished setting up directory /tmp/ibmsupt
Gathering general system information......... done.
Including Pd* ODM files in general information.......... done.
Gathering scanout information..done.
Gathering tcpip system information...................... done.
Gathering nfs system information............... done.
Gathering kernel system information.............. done.
Gathering filesys system information.................................. done.
该命令将搜集文件系统、内核、NFS、TCPIP等等方面的信息。
三、
用vi编辑器,生成readme文件如下
/tmp/ibmsupt/testcase/readme
在该文件中回答下列问题:
1、发生问题的程序名或设备名
2、如果发生问题的是一个网络设备,请描述网络适配器的种类
3、尽可能地描述问题,包括:
a、如果问题是关于网络性能,请说明目前的网络吞吐量和期望值,避免用“慢”这种词来描述,请指名速度比如20Kbytes/sec。
b、如果该问题是关于某程序的,请说明仅针对于该程序还是多个程序,如果多个程序,请指明之。
c、如果问题比较易于重现,请说明重现方法以及错误输出。
d、如果问题是关于一个non-AIX程序,请说明其和AIX的关联关系,以及AIX所产生的错误
e、这么问题是否是第一次产生,如果是,请说明其发生前系统或网络所发生的变动
4、填入任何其它你以为相关的信息
四、
以下步骤仅用于问题比较易于重现的情况
1、在有问题的机器上运行iptrace
startsrc -s iptrace -a "-b -d /tmp/ibmsupt/testcase/iptrace.bin"
2、重现问题
3、运行命令
stopsrc -s iptrace
4、运行netstat命令
netstat -v > /tmp/ibmsupt/testcase/netstat-v.out
netstat -in > /tmp/ibmsupt/testcase/netstat-in.out
netstat -rn > /tmp/ibmsupt/testcase/netstat-rn.out
netstat -D > /tmp/ibmsupt/testcase/netsat-D.out
netstat -s > /tmp/ibmsupt/testcase/netsat-s.out
netstat -an > /tmp/ibmsupt/testcase/netsat-an.out
netstat -m > /tmp/ibmsupt/testcase/netsat-m.out
5、运行命令
arp -an > /tmp/ibmsupt/testcase/arp-an.out
no -a > /tmp/ibmsupt/testcase/no-a.out
五、
遵循以下步骤将文档发给IBM
1、snap -c 将所搜集的文件归档,该命令将产生
/tmp/ibmsupt/snap.pax.Z或/tmp/ibmsupt/snap.tar.Z,如例:
#snap -c
Creating compressed pax file...
Starting pax/compress process... Please wait... done.
-rw------- ----1 0 ----0 ------717829 Sep 17 11:34 snap.pax.Z
2、将该文件发送给IBM
在AIX中如何对用户卷组进行卷组备份
在AIX中可以使用mksysb对系统rootvg进行备份,对于其他用户卷组该如何备份?在本文将着重介绍在AIX中如何创建、验证和恢复用户卷组的备份。
由于在AIX中 mksysb命令只能备份rootvg中文件系统的内容,所以还需要有其他途径来备份用户卷组上的内容。使用系统中的savevg 命令就可为用户卷组 创建一卷组备份,使用restvg 命令恢复savevg 所做的备份映像 ,包括重新创建用户卷组、逻辑卷和文件系统等操作。
需要注意的是,所有用户卷组上的逻辑卷的定义会写到备份设备上并在重建卷组时创建,但只有已mount的文件系统中的内容才会在执行savevg命令 时备份到备份介质上。Savevg命令不能备份裸设备上的内容。
附加下载文件:savevg.doc
AIX中如何解决不能释放光驱的问题
产品: RS6000
平台: AIX
在AIX上由于异常终止或其它原因经常会遇到不能正常释放光驱的问题
#fuser -kxuc /dev/cd#
或#fuser /dev/cd# 列出当前访问此设备的进程,然后使用kill -9 pid终止所有进程。
"Volume Group Locked" 恢复步骤
产品:AIX
平台:RS/6000
遇到错误消息 “ 0516-366 putlvodm: volume group rootvg is locked, try again”,可按下列步骤进行恢复。
本文所述方法针对AIX V4.2 或更新的版本。
逻辑卷操作的异常终止有时会造成卷组(VG)被锁定,这时需用命令
chvg -u [vgname]
将被锁定的卷组解锁。“vgname”为被锁定的卷组 。
查看SSA磁盘中pdisk与hdisk的对应关系
AIX V4
怎样查看SSA磁盘中pdisk与hdisk的对应关系?
ssaxlate命令显示pdisk与hdisk的对应关系.
#ssaxlate -l LogicalDiskName
#ssaxlate -l PhysicalDiskName
无法删除文件系统
产品:RS6000
平台:RS
软件版本:AIX 4.3
可以mount或unmount一个文件系统,但却无法删除该文件系统,在删除时,系统报错:0516-306:get lvodm: unable to find in the device confgiguration data.
发生此错误的原因可能是ODM数据库中的定义与实际不一致。可以用命令 lsvg -l rootvg 检查该文件系统的类型,若类型显示为???,则用命令 synclvodm -P rootvg 和 syncvg -v rootvg 进行同步,之后再用命令 lsvg -l rootvg 显示出正确的文件类型。此时可以成功删除该文件系统。
AIX 5.1文件系统类型简介
本文简单介绍AIX 5.1支持的文件系统类型。包括:
JFS(Journaled File System)
JFS2(Enhanced Journal File System)
GPFS(General Parallel File System)
RAM File System
Journaled File System
JFS 是AIX 4.3.3及其以前版本以及AIX 5.1 32位核心环境中的默认文件系统类型。JFS可以根据所记录的文件系统中的文件元数据(metadata)修复被损坏的文件系统。通过文件系统日志,系统可以将文件元数据的更改信息记录到文件系统的预留区域中,而对文件的写操作则在此日志更新完成之后进行。这样的文件系统结构有利于最大限度地对文件系统进行修复。
Enhanced Journal File System
Enhanced JFS (也称为 JFS2) 提供了比JFS 更优的扩展性能(如文件系统的大小等)。另外,在64位AIX核心中JFS2是系统默认的文件系统类型。当然,用户无论在32位还是在64位环境中都可以选择是使用JFS2还是JFS。在这里我们建议在32位核心中使用JFS文件系统,在64位核心中使用JFS2。
JFS2的创建和使用方法与JFS相同,即通过smit完成。
General Parallel File System (GPFS)
GPFS 是高性能,共享磁盘式文件系统,可以快速访问共存于一个群集(Cluster)中所有节点的数据。 GPFS通过多个磁盘条带化IO可以提供高性能IO服务,同时通过提供日志管理,文件复制以及服务器和磁盘的相互接管功能,提供了高可用性。
有关GPFS的使用,请参见IBM Redbook: GPFS on AIX Cluster: High Performance File System Administration Simplified。IBM Redbook站点为:
http://www.redbooks.ibm.com/
Network File System
NFS 属于分布式文件系统,允许用户从远程访问文件及目录,并且视这些文件及目录为本地资源一样。例如,用户可以使用操作系统提供的命令创建,删除或修改远程文件及目录。
RAM File System
RAM 盘是将内存中的一块空间仿真为磁盘。相对于物理磁盘,使用RAM盘可以极大地提高IO性能,但是建议在针对不需要永久保存的文件IO操作环境中使用 RAM盘,因为在系统宕机或重启后RAM盘中的所有数据会丢失。
使用系统命令 mkramdisk可以创建RAM盘。下面的例子说明如何创建一个20MB的RAM盘,并在其上创建文件系统:
mkramdisk 40000
ls -l /dev | grep ram
mkfs -V jfs /dev/ramdiskx
mkdir /ramdisk0
mount -V jfs -o nointegrity /dev/ramdiskx /ramdiskx
其中x 是RAM盘的逻辑设备号。删除RAM盘时,使用命令rmramdisk。此外,RAM 盘在系统重启后被自动删除。
如何替换镜像的卷组中故障的物理卷
rs6000,pSeries
如何替换镜像的卷组中故障的物理卷
以下情形替换镜像卷组中与物理卷相关的故障或正在发生故障的磁盘。
在指示信息中,使用配置管理器配置新的磁盘(名为 hdisk10),然后使用replacepv命令替换镜像卷组中的物理卷而不丢失物理卷的内容,
该镜像卷组至少部分地驻留在故障的磁盘驱动器(名为 hdisk02)上。完成以下过程无需重新引导或调度停机时间。
1. 选择一个至少与故障的磁盘一样大容量的新磁盘驱动器。
2. 利用超级权限,运行配置管理器配置新的磁盘。在命令行输入以下命令:
cfgmgr -l hdisk10
-l 标志允许仅配置指定的设备以及任何“子”设备。如果没有该标志,则 cfgmgr 命令对整个系统运行配置管理器。
3. 使用以下命令替换物理卷,使它可以开始使用新磁盘。
注:如果逻辑卷的镜像是旧的,则 replacepv 命令无法正确工作。
replacepv hdisk02 hdisk10
4. 如果相关的镜像卷组为 rootvg,必须再运行以下命令将故障磁盘从引导映象清除并向引导映象添加新的磁盘。
5. chpv -c hdisk02
6. bootlist hdisk10
bosboot -a
chpv -c 命令将 hdisk02 从引导映象清除。
bootlist 命令将 hdisk10 添加到系统可能从其引导的引导设备列表。
bosboot -a 命令在缺省的引导逻辑卷上创建完整的引导映象。
此时,物理卷 hdisk02 现在映射到新配置的 hdisk10。
pSeries
重新设置未知的 root 用户密码
以下步骤描述了当系统的 root 用户密码不可用或未知时如何恢复对 root 用户特权的访问。
以下步骤需要一些系统停机时间。可能的话,请调度好停机时间,使其尽可能少地影响作业量,从而防止可能的数据或功能的丢失。
1. 请将与当前安装程序同样的版本和级别的产品介质插入相应驱动器。
2. 打开机器电源。
3. 当图标屏幕出现或听到蜂鸣声的时候,重复按下 F1 键直到出现系统管理服务菜单。
4. 选择多引导。
5. 选择从何处安装。
6. 选择放有产品介质的设备,然后选择安装。
7. 选择 AIX 版本图标。
8. 通过按 F1 键然后按 Enter 键将您的当前系统定义为系统控制台。
9. 选择首选语言的号码,然后按 Enter 键。
10. 通过输入 3 并按 Enter 键选择启动维护方式以进行系统恢复。
11. 选择访问根卷组。系统会显示一条消息,说明如果在此处更改了根卷组,则不重新启动将无法返回“安装”菜单。
12. 输入 0 并按 Enter 键。
13. 从列表中输入相应的卷组号码并按 Enter 键。
14. 通过输入 1 并按 Enter 键选择访问该卷组并启动 shell。
15. 在 #(数字符号)提示状态下,在命令行提示符后输入 passwd 命令以重新设置 root 用户密码。例如:
16. # passwd
17. 更改 root 用户密码
18. root 用户新密码:
请再次输入新的密码:
19. 要将缓冲区中的任何东西写入硬盘并重新引导系统,请输入以下命令:
sync;sync;sync;reboot
当登录屏幕出现的时候,在步骤15中设置的密码现在允许访问 root 用户特权。
AIX系统级命令简介
在AIX操作系统上有很多的命令。这里介绍一些系统级的命令,它将有助于回答一些常见问题。大家以此做参考,并补充修改。
以下命令在AIX 5.1上测试通过。
以下命令在AIX 5.1上测试通过。
· 关于内核
显示AIX系统内核是32位还是64位:
bootinfo -K
如何改变内核模式(32位或64位)
/unix文件连接到一个可引导的映像。通过命令ls -l /unix查看:
/unix -> /usr/lib/boot/unix_up # 32 bit uniprocessor kernel
/unix -> /usr/lib/boot/unix_mp # 32 bit multiprocessor kernel
/unix -> /usr/lib/boot/unix_64 # 64 bit multiprocessor kernel
在AIX系统安装时,缺省安装的内核是32位。可以用如下命令更改内核模式:
ln -sf /usr/lib/boot/unix_64 /unixln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unixbosboot -ad /dev/hdiskxxshutdown -r
注意:/dev/hdiskxx是指引导逻辑卷/dev/hd5所在的硬盘。可通过下面命令来查看xx是几:
lslv -m hd5
· 关于硬件
显示机器硬件是32位还是64位:
bootinfo -y
查看机器的物理内存是多少:
bootinfo -r
或
lsattr -El sys0 -a realmem
查看机器是否支持64位内核(是否64位硬件)
/usr/sbin/bootinfo -p
如果返回32,则表示硬件是32位的;如果返回的是chrp,则表示硬件是64位的机器。
显示当前磁带设备rmt0的属性:
lsattr -l rmt0 -E
显示缺省的磁带设备rmt0的属性:
lsattr -l rmt0 -D
显示终端设备tty0的登录属性:
lsattr -l tty0 -a login -R
显示系统级属性:
lsattr -E -l sys0
查看当前系统有多少CPU:
lscfg | grep proc
查看当前系统有多少硬盘而且是否被使用:
Lspv
查看当前系统的详细配置:
lscfg -pv
也可以显示某一设备的配置:
lscfg -vl rmt0
查看当前系统的芯片名称、系统名、节点名、型号等:
uname -p # 显示芯片名称,例如:powerpc
uname -r # 显示操作系统的发行号
uname -s # 显示系统名,例如:AIX
uname -n # 显示节点名
uname -a # 显示系统名、节点名、版本、机器ID
uname -M # 显示型号,例如:IBM,7046-B50
uname -v # 显示操作系统版本
uname -m # 显示机器ID
· 关于AIX
查看AIX的版本、发行号、ML(Maintenance Level)级别:
oslevel -r
或
lslpp -h bos.rte
如何改变文件系统大小,例如:将/usr文件系统增加1000000字节:
chfs -a size=+1000000 /usr
如何使用CD:
mount -V cdrfs -o ro /dev/cd0 /cdrom
查看本机的IP地址:
Ifconfig -a
或
host Fully_Qualified_Host_Name
例如:host cyclop.austin.ibm.com
查找哪一个文件集(fileset)包含特定的文件,例如:查找/usr/bin/vmstat属于哪一个文件集。
lslpp -w /usr/bin/vmstat
显示哪一个文件集包含/usr/bin/svmon:
Which_fileset svmon
查看某一级别的ML中所有文件是否都已经安装:
instfix -i | grep ML
如何确定某一补丁(fix)是否安装,例如:查看IY24043是否安装
instfix -ik IY24043
显示哪些文件集需要安装或修改:
lppchk -v
查看交换区(paging space)的分配和使用:
lsps -a
· 关于卷组和逻辑卷
创建卷组:
mkvg -y name_of_volume_group -s partition_size list_of_hard_disks
partition_size单位是MB,它是1到1024之间的一个数。(2的次幂,例如:1, 2, 4, 8, 16, 32等,缺省是4MB。)
创建逻辑卷:
mklv -y name_of_logical_volume name_of_volume_group number_of_partition
显示当前系统的所有卷组:
Lsvg
显示卷组rootvg的详细信息:
lsvg rootvg
显示属于rootvg的所有硬盘:
lsvg -p rootvg
如何添加一个硬盘到卷组中:
extendvg Volume_Group_Name hdisk0 hdisk1 ... hdiskn
如何替换一个硬盘:
1. extendvg Volume_Group_Name hdisk_new
2. migratepv hdisk_bad hdisk_new
3. reducevg -d Volume_Group_Name hdisk_bad
如何做一个逻辑卷镜像:
1. mklvcopy Logical_Volume_Name Number_of_copies
2. Syncvg Volume_Group_Name
在AIX上,有一个很方便的系统管理命令smit。上面提到的命令中,如逻辑卷操作部分就可以smit轻松的完成。
这里介绍的命令只是AIX中的一小部分。更多更详细的内容请参考AIX系统手册和技术红皮书。
数据急救(1): 如何恢复误删除的文件
当我们在目录中为了方便使用#rm -rf * 删除文件时,有时会发现自己今天真是倒霉,在执行后发现#pwd竟然不是自己想要删除文件的目录,这时才发现备份是多么重要啊。(可惜呀,没做,:- (), (这就是系统超级管理员常犯的错误,手太快),没办法,以头戕地吧。但你在遭遇了巨痛后,如果还没有完全丧失斗志,那么下面这篇文章也许能帮你找会你的文件和自信。希望和成功往往也只是一念之间*_*\和DOS,winX,以及众多unix系统一样,当文件被删除时,其所占据的物理空间并没有真正从系统中移除,但他们的状态确是未分配空间,所以这时只要没有新的文件产生或者文件变化发生在同一个文件系统中,那么我们完全有可能用系统提供的fsdb (filesystem debugger)来恢复我们的数据特别感谢此文的英文原文作者,他们还有收费的恢复工具,需要时请访问
备注: 其中包含图片和网页链接,如果看不到,请下载附件中的word文档。
(1) 如何恢复误删除的文件?
(2) 举例说明(红色为我们应输入的)
(3) 相关知识介绍
MAKE A BACKUP OF THE ENTIRE FILESYSTEM BEFORE PERFORMING THESE STEPS!!!
ELSE ( BANG !!!!! ).
Steps to recover a deleted file
-------------------------------
1) "ls -id {dir}"
(where dir is directory where file resided)
Record INODE number for next step.
36872
2) Unmount the filesystem.
3) "fsdb /{Mountpoint}" or "fsdb /dev/{LVname}"
(where Mountpoint is the filesystem mount point, and LVname is
the logical volume name of the filesystem)
4) "{INODE}i"
(where INODE is the inode number recorded in step 1)
This will display the inode information for the directory. The
field a0 contains the block number of the directory.
The following steps assume only field a0 is used. If a value
appears in a1, etc, it may be necessary to repeat steps #5 and
#6 for each block until the file to be recovered is found.
5) "a0b"
(moves to block pointed to by field "a0" of this inode)
6) "p128c"
(prints 128 bytes of directory in character format)
Look for missing filename. If not seen, repeat this step until
filename is found. Record address where filename begins. Also
record address where PRIOR filename begins. If filename does
not appear, return to step #5, and selecting a1b, a2b, etc.
Note that the address of the first field is shown to the far left.
Increment the address by one for each position to the right,
counting in octal.
7) "a0b"
(moves to block pointed to by field "a0" of this inode)
If the filename was found in block 1, use a1b instead, etc.
8) "p128e"
(prints first 128 bytes in decimal word format)
Find the address of the file to recover (as recorded in step 6)
in the far left column. If address is not shown, repeat until found.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11287/showart_1665521.html
转载于:https://blog.51cto.com/daniang/850577