Aixusefulcommands
Aixusefulcommands
Aixusefulcommands
examples :-
installp -ad (device) (fileset) (level) Install apply and commit fileset
installp -pad (device) (fileset) (level) Preview install
installp -u (fileset) Remove fileset
installp -ld (device) List all software on device
example:-
--------------------------------------------------------------------------------
TERMINALS / DISPLAYS
--------------------------------------------------------------------------------
termdef reports the termtype setup in smit for the tty port
that termdef is run on.
penable tty0 adds getty line into /etc/inittab for tty0 and starts getty
pdisable tty0 disables the getty line and disables getty
for i in 0 1 2 3 4 5 6 7
do
mkdev -c tty1 -t tty -s rs232 -p sa2 -w$i -a login=enable -a term=vt100
done
--------------------------------------------------------------------------------
NETWORK
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
BACKUPS
--------------------------------------------------------------------------------
MKSYSB
------
mksysb does not save any raw data and will not backup a filesystem that
is not mounted.
SAVEVG
------
CPIO ARCHIVE
------------
CPIO RESTORE
------------
TAR ARCHIVE
-----------
TAR RESTORE
-----------
AIX ARCHIVE
-----------
AIX RESTORE
-----------
To run the backup on a local machine (cpio) and backup on the remote
machine's (remhost) tape drive (/dev/rmt0)
To restore/read the backup (cpio) on the local machine from the remote
machine's (remhost) tape drive (/dev/rmt0)
--------------------------------------------------------------------------------
Copying diskettes and tape
--------------------------------------------------------------------------------
COPYING DISKETTES
-----------------
COPYING TAPES
-------------
dd if=/dev/rmt0 of=(filename)
dd if=(filename) of=/dev/rmt0 or tcopy
--------------------------------------------------------------------------------
VI Commands
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
DEVICES
--------------------------------------------------------------------------------
mknod (device) c (major no) (minor no) Creates a /dev/ device file.
mknod /dev/null1 c 2 3
--------------------------------------------------------------------------------
TAPE DRIVES
--------------------------------------------------------------------------------
rmt0.x where x = A + B + C
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
--------------------------------------------------------------------------------
PRINTERS / PRINT QUEUES
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
FILE SYSTEMS
--------------------------------------------------------------------------------
If the PV state is "missing" but the disk is okay, use "varyonvg vg" to change
the state of the PV to "active".
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.
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.
lqueryvg -Atp (pv) Details volume group info for the hard disk.
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 )
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.
rmfs (fs) Removes the file system and will also remove the
LV if there are no onther file systems on it.
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.
--------------------------------------------------------------------------------
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.
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.
--------------------------------------------------------------------------------
SYSTEM DUMP
--------------------------------------------------------------------------------
(MCA machine can also dump if key is in service position and the reset
button is pressed)
snap -gfkD -o /dev/rmt0 Copy dump to tape to send to IBM support, uses tar.
--------------------------------------------------------------------------------
PAGING SPACE (PS's)
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
at -l
atq Lists out jobs scheduled to run via at command
--------------------------------------------------------------------------------
SECURITY
--------------------------------------------------------------------------------