UNIXguide.net ( AIX, HP−UX, LINUX & SOLARIS )
© Copyrighted by Hermelito Go (Last Update: Friday, 07−Jul−2000 15:28:00 PDT)
Directory Mappings
AIX
HP−UX
LINUX
SOLARIS
Root filesystem Home Directory
/ /home /tmp /usr /var
{/dev/hd4} {/dev/hd1} {/dev/hd3} {/dev/hd2} {/dev/hd9var}
/ {/dev/vg00/lvol1} /home {/dev/vg00/lvol4} /tmp /usr /var {/dev/vg00/lvol6} {/dev/vg00/lvol7} {/dev/vg00/lvol8}
/ {/dev/sda1}
/ {/dev/vx/dsk/rootvol} /export/home /dev/vx/dsk/home} /tmp /dev/vx/dsk/swapvol} /usr /var
Sample configuration files
−
/usr/newconfig
User Accounts
AIX
HP−UX
LINUX
Solaris
Password files Groups file Maximum # of user ID Allow/Deny remote login User nobody's id # Group nobody's id #
/etc/passwd /etc/security/passwd /etc/group /etc/security/group 4294967295 /etc/security/user {rlogin=true} 4294967294 4294967294 boot from CD/Tape Installation/Maintenance Start Limited Shell getrootfs hdisk0 vi /etc/security/passwd mkuser rmuser lsuser −f ALL chuser −a
/etc/passwd /tcb/files/auth/r/root /etc/group /etc/logingroup 2147483647 /etc/securetty {console} −2 −2(nogroup) ISL>hpux −is vi /tcb/files/auth/r/root vi /etc/shadow useradd userdel logins usermod
/etc/passwd /etc/shadow /etc/group 65535 /etc/securetty {/dev/console} 99 99
/etc/passwd /etc/shadow /etc/group 2147483647 /etc/default/login {CONSOLE=/dev/console} 60001 & 65534(nobody4) 60002 & 65534(nogroup) boot cdrom −s mount /dev/c0t0d0s0 /mnt vi /mnt/etc/shadow useradd userdel logins usermod
Recover root password
linux S vi /etc/shadow
Create new user Delete user List users Modify user account
useradd userdel logins usermod
General Commands
AIX
HP−UX
LINUX
Solaris
Unique host ID Administrator Performance monitor System activity reporter Virtual Memory statistics I/O statistics
hostid smit top monitor sar vmstat iostat
uname −i sam top glance sar vmstat iostat vmstat linuxconf top
hostid admintool top sar vmstat iostat
1
UNIXguide.net ( AIX, HP−UX, LINUX & SOLARIS )
Error logs Physical RAM Shared Memory Process Data Space Swap device Swap file type Display swap size Activate Swap
alog −o −t boot errpt 1M TB 64K TB 384K TB /dev/hd6 /etc/swapspaces lsps −a swapon −a
dmesg 4TB 8TB 4TB /dev/vg00/lvol2 swap swapinfo −a swapon −a
dmesg 64 GB {>2.3.24}
dmesg 16TB
900 MB /dev/sda2 partition type 82 free swapon −a /dev/vx/dsk/swapvol swap swap −l swap −a
Printers
AIX
HP−UX
LINUX
Solaris
Printer Queues Stop LP Start LP
/etc/qconfig stopsrc −s lpd startsrc −s lpd enq lp lpr qprt enq −A lpq lpstat qchk cancel lprm qcan enq −x smit mkpq smit rmpq export LPDEST="pq"
/etc/lp/interface/* lpshut lpsched
/var/spool/lpd/lp/* /etc/init.d/lpd stop /etc/init.d/lpd start
/etc/lp/interfaces/* /usr/lib/lp/lpshut /usr/lib/lp/lpsched lp lpr
Submit print jobs
lp
lpr
LP statistics
lpstat
lpq
lpstat
Remove print jobs
cancel
lprm
cancel lprm lpadmin −p pq lpadmin −x pq lpadmin −d pq
Add printer queue Remove Printer queue Make default printer
lpadmin −p pq lpadmin −x pq lpadmin −d pq
printtool
TCP/IP
AIX
HP−UX
LINUX
Solaris
Network IP configuration Hosts IP addresses Name service switch Network parameters Routing daemon NIC Configurations Secondary IP Address Login prompt Increase the # of pseudo−terminals
lsattr −E −l inet0 /etc/hosts /etc/netsvc.conf no −a gated ifconfig −a ifconfig en0 alias IP HERALD @ /etc/security/login.cfg odmget −q "attribute=num and uniquetype=pty/pty/pty" PdAt | sed "s/0−64/0−512/" | odmchange −q "attribute=num and uniquetype=pty/pty/pty"
/etc/rc.config.d/netconf /etc/hosts /etc/nsswitch.conf ndd −h gated lanscan −v ifconfig lan0:1 IP telnetd −b /etc/issue rebuild your kernel with these new values NPTY=# NSTRPY=# reboot
/etc/sysconfig/network−scripts/ /etc/hosts /etc/nsswitch.conf
/etc/hostname.* /etc/inet/* /etc/defaultrouter /etc/inet/hosts /etc/nsswitch.conf ndd /dev/[tcp|ip] ?
routed ifconfig −a modprobe ip_alias ifconfig eth0:1 IP /etc/issue cd /dev ./MAKEDEV −v pty
in.routed ifconfig −a ifconfig hme0:1 IP up BANNER @ /etc/default/telnetd {/etc/system} set pt_cnt = # {SYSV} set npty = # {BSD} {/etc/iu.ap}
2
UNIXguide.net ( AIX, HP−UX, LINUX & SOLARIS )
−o PdAt chdev −l pty0 −anum=256 −P reboot insf −d ptys −n # insf −d ptym −n # insf −d pts −s # −e −v ptsl 0 # ldterm ttcompat halt boot −r 176 {BSD} 3000 {SYSV} rsh /usr/lib/netsvc/yp/ypbind
Maximum # of ptys
512
{MAXUSERS}
256
Remote Shell YP/NIS service binder
remsh rsh /usr/lib/netsvc/yp/ypbind
remsh /usr/lib/netsvc/yp/ypbind
rsh /sbin/ypbind
System Files
AIX
HP−UX
LINUX
Solaris
NFS exported NFS Client mounted directories File System File Size # File Descriptors
/etc/exports /etc/xtab 128 GB 64 GB 64 K
/etc/exports /etc/xtab 128 GB 128 GB 60~ K
/etc/exports /var/lib/nfs/xtab 2 TB 2 GB {512B block size} 8192 GB {8KB block size}
/etc/dfs/dfstab /etc/dfs/sharetab /etc/rmtab 1 TB 1 TB 64 K
DISK/LVM Commands
AIX
HP−UX:Disk &Filesystem
LINUX
SOLARIS
Filesystem table Free disk blocks Device listing Disk information Disk Label LVM Concepts
/etc/filesystems df −k lsdev −C bootinfo −s hdisk# lspv −l hdisk# Partition Volume
/etc/fstab bdf /sbin/ioscan diskinfo /dev/rdsk/c#t#d# pvdisplay −v /dev/dsk/C#t#d# logical extents logical volume
/etc/fstab df −k cat /proc/devices
/etc/vfstab df −k sysdef format −d c#t#d# format>current format>inquiry
fdisk −l logical extents logical volume
prtvtoc sub disk Volume Plex
Volume group Journal Filesystem type Default volume group Display volume group Modify physical volume Prepare physical disk List physical volume Remove disk from volume group Move logical volumes to another physical volumes Create volume group Remove volume group jfs /dev/rootvg lsvg −l rootvg chpv mkdev −c disk −l hdisk# lspv reducevg migratepv mkvg
volume group vxfs /dev/vg00 vgdisplay −v vg00 pvchange pvcreate pvdisplay vgreduce pvmove vgcreate vgremove
volume group ext2
disk group vxfs /dev/vx/dsk/rootdg
vgdisplay −v pvchange pvcreate pvdisplay vgreduce pvmove vgcreate vgremove
vxprint −l −g rootdg
vxdiskadd vxprint −dl vxdg rmdisk vxassist move vxdg init
3
UNIXguide.net ( AIX, HP−UX, LINUX & SOLARIS )
Volume group availability chvg varyonvg varyoffvg Restore volume group Exports volume group Imports volume group Volume group listing Change logical volume characteristics List logical volume Make logical volume Extend logical volume Reduce logical volume Remove logical volume Prepare boot volumes Remove boot volumes Extend File system Reduce/Split mirrors Merge mirrors Create mirrors Add mirrors Create striped volumes System recovery tape Backup Restore mklv −c 2 mklvcopy lv 2 mklv −u 3 −S 64K mksysb −i /dev/rmt0 savevg −i rootvg restvg chfs −a size=# rmlvcopy exportvg importvg lsvg chlv lslv mklv extendlv AIX reduce LV rmlv bootlist −m normal vgchange vgcfgrestore vgexport vgimport vgscan lvchange lvdisplay lvcreate lvextend lvreduce lvremove lvlnboot lvrmboot extendfs −F vxfs −s # fsadm −F vxfs −b {LE * 1024} lvsplit lvmerge lvcreate −m 1 lvextend −m 1 lvcreate −i 3 −I 64 /opt/ignite/bin/make_recovery fbackup frecover tar cvf /dev/rst0 / tar xvf /dev/rst0 ufsdump ufsrestore lvcreate −i 3 −I 64 vxassist make * * layout=raid5 resize2fs lvsplit lvmerge vxassist mirror vxva mkfs −M vgchange vgcfgrestore vgexport vgimport vgscan lvchange lvdisplay lvcreate lvextend lvreduce lvremove lilo vxedit set vxprint −vl vxassist make vxassist growto vxassist shrinkto vxedit rm vxbootsetup vxdg deport vxdg import
MISC
AIX
HP−UX
LINUX
SOLARIS
Startup script Kernel Kernel Parameters
/etc/rc /usr/lib/boot/unix_up lsattr −E −l sys0
/sbin/rc /stand/vmunix kmtune kmsystem cd /stand/build /usr/lbin/sysadm/system_prep −v −s system vi system mk_kernel −s system cd /stand mv system system.prev mv vmunix vmunix.prev mv dlkm dlkm.prev mv ./build/system system kmupdate /stand/build kmadmin −s kmadmin −L kmadmin −U
/etc/rc.d/rc /boot/vmlinuz /boot/vmlinuz cd /usr/src/linux make mrproper make menuconfig make dep make clean make bzimage make install make modules make modules_install lsmod insmod rmmod
/sbin/rc#run−level /kernel/genunix sysdef− i
Reconfigure the kernel
chdev −l sys0 −a
vi /etc/system
List modules Load module Unload module Initialize system install_assist
modinfo modload modunload sys−unconfig
set_parms initial
4
UNIXguide.net ( AIX, HP−UX, LINUX & SOLARIS )
Physical RAM bootinfo −r Kernel Bits Crash utility Machine model OS Level Run Level Core dump files getconf WORD_BIT crash uname −m bootinfo −m oslevel who −r /var/adm/ras Key on service mode/F4 Boot from CD/Tape Select Maintenance Limited function Shell
grep −i Physical /var/adm/syslog/syslog.log getconf KERNEL_BITS crashutil model uname −m uname −r who −r /var/adm/crash
cat /proc/meminfo
prtconf isainfo −kv crash
uname −m uname −r runlevel
uname −imp uname −r who −r /var/crash/`uname −n`
Boot single user
ISL>hpux −iS
linux S
ok boot −s
Maintenance mode Interrupt Key Return to console
ISL>hpux −lm control−B co
ok boot −as Stop−A ok go
Software
AIX
HP−UX
LINUX
SOLARIS
Install Software Uninstall software List installed software Verify installed software List all files List installed patches Package owner SW Directory
installp −a installp −u lslpp −L all lppchk −v lslpp −f fileset instfix −i lslpp −w path /usr/lpp
swinstall swremove swlist swlist −l fileset −a state swlist −l file fileset swlist −l patch what /stand/vmunix swlist −l file | grep path /var/adm/sw/
rpm −i package rpm −e package rpm −qa
pkgadd pkgrm pkginfo pkginfo −i pkginfo −p
rpm −ql package
pkgchk −l package patchadd −p
rpm −−query −−file file /var/lib/rpm
pkgchk −l −p path /var/sadm
Devices
AIX
HP−UX
LINUX
SOLARIS
Devices
/dev
/dev
/dev
/devices drvconfig devlinks disks tapes ports rem_drv prtconf −D psrinfo −v pmadm −l /usr/platform/`uname −m`/ sbin/prtdiag ok test−all /opt/SUNWvts/bin/sunvts
Install devices for attached peripherals
cfgmgr −v
insf −e
/dev/MAKEDEV
Remove device Device drivers CPU List Terminal
rmdev −l lscfg lsdev −Cc processor lsdev −Cc tty
rmsf lsdev ioscan −fnC processor ioscan −fnC tty
Diagnostics
diag
stm
Whole Disk CDROM
/dev/hdisk# /dev/cd0
/dev/dsk/c#t#d0 /dev/dsk/c#t2d0
/dev/sda /dev/cdrom
/dev/c#t#d0s2 /dev/dsk/c#t6d0s2
5
UNIXguide.net ( AIX, HP−UX, LINUX & SOLARIS )
CDROM file type Rewinding tape drive Non−rewinding tape drive Floppy drive cdrfs /dev/rmt0 /dev/rmt0.1 /dev/rfd0 cdfs /dev/rmt/0m /dev/rmt/0mn − iso9660 /dev/rst0 c 9 0} /dev/nrst0 128 } /dev/fd0 { {c9 hsfs /dev/rmt/0 /dev/rmt/0n /dev/diskette
Links
AIX
HP−UX
LINUX
SOLARIS
FAQ Online Manual Technical Support Phone Number Free Software Certification
AIX−FAQ AIX 4.3 Books RS/6000 TechSupport 1−800−CALL−AIX Bull www.ibm.com
HP−UX FAQ HP−UX 11.00 Collection IT Resource Center 1−800−633−3600 HP−UX Ports education.hp.com
LINUX FAQ Linux Documentation Project Red Hat support 1−888−REDHAT1 Linux Software Map RHCE
Solaris 2 FAQ Solaris 7 Documentation SunSolve 1−800−USA−4SUN Sun Freeware suned.sun.com
6