Escolar Documentos
Profissional Documentos
Cultura Documentos
Display system information i.e cpu, memory, etc Information regarding the physical memory and swap area Displaying disk information, filesystems Display and configuring network parameters Configure, display and use the crash dump utiltities Displaying, modifying and tuning kernel parameters Display, start and stop services Installing and removing patches and software packages Setting up and removing user accounts Information on NFS i.e starting, stopping, etc Network Time Protocol Location to common log files Security information Other stuff i.e shutdown, timezone, run level, etc
Crash Dump Performance Monitoring and Diagnostics List, Monitor and trace processes Kernel Modules and Parameters Services Patching / Packages Accounts NFS NTP Log Files Security Misc
Sysinfo Command Description Solaris
Red Hat
cat /etc/release
cat /etc/enterprise-release
/usr/platform/`uname i`/sbin/prtdiag -v
dmidecode
Hardware Info
Disk Drives
/boot/initrd.?????.img
uname -a
Kernel 32 or 64
Display Firmware
Display IRQ, IO ports and DMA GUI admin tool Memory and Swap Command Description Solaris /usr/platform/`uname i`/sbin/prtdiag -v prtconf | grep -i mem Red Hat cat /proc/meminfo (detailed) free -om admintool linuxconf
Memory /usr/bin/pagesize page size (memory) swap -l swap -s cat /proc/swaps (detailed) swapon -s /usr/bin/getconf -a| egrep -i 'pagesize|page_size'
swap -a /var/swapfile
create partition with fdisk (type 82) file(create 50MB swap file): dd if=/dev/zero of=/var/swapfile bs=1024 count=50000 mkswap <device>|<file>
update /etc/vfstab
swapon <device>|<file>
update /etc/fstab
adding swap update /etc/vfstab swap -d Remove device or file as normal swapoff <device>|<file>
removing swap Disks, Filesystems and Devices Command Description Solaris format prtvtoc <device> Red Hat fdisk -l sfdisk -l (advanced server) parted <device> print
format -e (to convert EFI (zfs) to SMI) Note: EFI - Extensible Firmware Interface Disk Drives SMI - Sun Microsystems Inc format
partprobe <device>
hdparm -i /dev/hda
iostat -En
luxadm inq <disk> (A5x00 disk arrays) hdparm -Tt /dev/hda (speed test)
sdparm -i /dev/sdb
Disk serial Number, type, etc prtvtoc <device> fdisk -l sfdisk -l (advanced server) cat /etc/vfstab cat /proc/partitions (very high level) cat /etc/fstab
Disk disk partitions use format to partition the disk then just use the slice as a raw partition, remember to use the character device ## Old way
## New way, Edit below file /etc/udev/rules.d/60-raw.rules udevinfo -d or udevadm ## Display raw partitions raw -qa df -k df -h
Filesystem (create|remove)
Filesystem (create|remove) tunefs fstyp -v <device> |grep -i minfree tune2fs tune2fs -l /dev/sda1
Force fsck ufsdump|ufsrestore tar dd cpio backup filesystem eeprom |grep boot-device prtconf -pv |grep bootpath cat /boot/grub/grub.conf cat /etc/lilo.conf dump/restore tar dd cpio
prtpicl -v|grep ':bootpath' grub = grand unified boot loader lilo = linux loader /boot/grub/grub.conf /etc/lilo.conf
Display the boot device setenv boot-device [<device>|<alias>] eeprom boot-device [<device>|<alias>]
Setting the boot device installboot /usr/platform/`uname i`/lib/fs/ufs/bootblk <raw-device> grub-install <raw-device> lilo -v
Creating boot device (MBR) fdformat -v -U volcheck -v newfs -v /vol/disk/aliases/floppy0 Format floppy drive volrmmount -l floppy0 mount/unmount floppy eject floppy mount -F hsfs -o ro <device path> /cdrom/cdrom0 umount /cdrom/cdrom0 floppy --probe (use device obtained below ) floppy --createrc > /etc/fd0 floppy --format /dev/fd0 mkfs /dev/fd0 mount /dev/fd0 /mnt/floppy umount /mnt/floppy mount -rt iso9660 /dev/cdrom /mnt/cdrom umount /mnt/cdrom eject cdrom
mount/unmount CDROM
mount -o remount,rw /
create boot disk or recovery tape ok> boot cdrom -s using the grub window append the word singleto the kernel line
using the grub window append the word singleto the kernel line
boot into maintenace mode floppy: disk: /dev/dsk/c0t0d0s0 tape: /dev/rmt/0ucb cdrom: /dev/dsk/c0t6d0s0 floppy: /dev/fd0 disk: /dev/hda or /dev/sda /dev/hdb or /dev/sdb tape: cdrom:
Device paths
list device drivers Networking Solaris /etc/hostname.hme0 Red Hat /etc/sysconfig/network /etc/sysconfig/networkscripts/ifcfg-eth0 ifconfig system-config-network (GUI)
prtdiag -v ifconfig -a
Configure network interface ifconfig qfe0 up ifconfig qfe0 down /sbin/ifup eth0 /sbin/ifdown eth0
Starting and stopping a network interface ndd -set <device> <parm> <value> (dynamically) /etc/system (edit and update then reboot - permanent) mii-tool -F 100baseTx-FD eth0 ethtool -s eth1 speed 100 duplex full
Setting NIC speed ndd -get <device> <parm> mii-tool -v ethtool eth1 ethtool -t eth0 online
# List parameters ndd -get /dev/hme \? ndd -get /dev/e1000g0 \? ndd -get /dev/ip \? ndd -get /dev/tcp \?
Display NIC statistics ifconfig -a (as user root) display MAC address snoop -d <interface> tcpdump -i <interface> ifconfig system-config-network (GUI)
display routing table if_mpadm -d (detach) ifenslave -d bond0 eth1 (detach) ifenslave bond0 eth1 (reattach) cat /proc/net/bonding/bond0 /etc/sysconfig/network
if_mpadm -r
(reattach)
/etc/hosts
/etc/nodename /etc/hostname.<interface> /etc/inet/hosts /etc/inet/ipnodes /etc/net - few files in here as well change the hostname setup DNS /etc/resolv.conf /etc/nsswitch.conf /etc/resolv.conf /etc/resolv.conf /etc/nsswitch.conf /etc/host.conf /etc/resolv.conf sysctl -a |grep hostname
Name service switch file (DNS client) Flush DNS cache svcadm restart system/nameservice-cache:default /etc/defaultdomain ## if installed service nscd restart /etc/sysconfig/network (HOSTNAME option) /etc/resolv.conf Note: for NIS use the NISDOMAIN option ip route get <IP address> traceroute Boot (jumpstart) servers: rpcinfo -b bootparam 1
Domain Name Obtain IP Address routing route -n get <hostname> traceroute Boot (jumpstart) servers: rpcinfo -b bootparam 1
NFS servers: rpcinfo -b mountd 1 NIS servers/slaves: rpcinfo -b ypserv 1 Find Services on the network Crash Dump Solaris dumpadm -d <device>
NFS servers: rpcinfo -b mountd 1 NIS servers/slaves: rpcinfo -u <yp server> ypserv
crash (used to analyse crash kdump (part of kexec rpm) dumps) adb (used to analyse crash dumps) /etc/kdump.conf (select where you want the dump to go) service kdump start chkconfig kdump on
Performance Monitoring and Diagnostics Solaris top (sunfreeware) prstat sar mpstat w (load average) uptime (load average) ps vmstat Red Hat top sar mpstat w (load average)
uptime (load average) ps vmstat procinfo oprofile cat /proc/cpuinfo free vmstat top procinfo slabtop sar cat /proc/meminfo ethtool mii-tool
nfsstat
nfsstat
Solaris modinfo
Red Hat cat /proc/modules (more detailed) lsmod Location: /lib/modules/`uname r`/kernel/drivers Config: /etc/modprobe.conf /etc/modprobe.d
display loaded modules modload -p drv/<module name> load modules modunload -i <module number> modprobe <module> insmod modprobe -r <module>
unload modules
modunload -i <module number> rmmod unload modules /etc/system (edit and reboot) /etc/sysctl.conf (edit and update then reboot) sysctl -p <filename>
sysctl -w param=value
No reboot (dynamically):
echo "250 32000 100 28" > /proc/sys/kernel/sem echo "536870912" > /proc/sys/kernel/shmmax echo "4096" > /proc/sys/kernel/shmmni echo "2097152" > /proc/sys/kernel/shmall etc................................... ..........
set kernel parameters (tuning) cat /etc/system sysdef -i sysctl -a cat /etc/sysctl.conf
etc................................... cd /usr/src/linux-2.5
/etc/system
make modules
ipcs -a
move new kernel make modules_install change lilo/grub config file reboot ipcs -a
Solaris 10 svcs -a
inetadm -l
display services svcadm enable nfs start services svcadm disable nfs stop services reload service restart service service status service dependencies svcadm refresh nfs svcadm restart nfs svcs nfs svcs -d network service nfs stop service nfs reload service nfs restart service nfs staus n/a service nfs start
service dependants
n/a n/a
chkconfig --levels 2345 nfs on # Create your stop/start # script in /etc/init.d chkconfig --add <script>
Add a new service Patching / Software Solaris showrev -p patchadd -p display installed patches
Red Hat
patchadd patch -p1 <patch> patchadd -M <dir> (multiple patches) zcat patch46.gz | patch -p1
patchrm pkginfo (all packages) pkginfo -l (single package) pkgchk -l -p <file> (file belongs)
patch -R -p1 <patch> rpm -qa (all packages) rpm -q (single package) rpm -qf (file belongs) rpm -qi <package> (very detailed)
display installed packages pkgadd rpm -Uhv (updates/installs if not already) rpm -ihv (install)
removing packages pkginfo -l pkginfo -p verify package pkgchk -l <package> | grep -i pathname List files in package /var/sadm Package directory List libraries required for binary program Accounts Solaris cat /etc/passwd display users create a user remove a user logins -x useradd useradd userdel system-config-users (GUI) userdel system-config-users (GUI) usermod system-config-users (GUI) Red Hat cat /etc/passwd system-config-users (GUI) /var/lib/rpm rpm -ql <package> rpm -V <package>
ldd <file>
ldd <file>
modify a user
usermod
modify a user
usermod
modify a goup
groupmod /etc/passwd
password files
useful user commands groups setpgrp useful group commands NFS Solaris server: mountd, nfsd client: statd, lockd NFS Daemons /etc/dfs/dfstab /etc/dfs/sharetab /etc/rmtab /etc/exports /var/lib/nfs/etab /var/lib/nfs/xtab Red Hat server: rpc.mountd,nfsd client: rpc.statd, lockd newgrp groups
NFS files
List nfs clients that have a remote mount display nfs shares
/etc/rmtab
/var/lib/nfs/rmtab
dfshares showmount -e localhost showmount -e localhost /etc/dfs/dfstab (edit and add share) redhat-config-nfs (GUI) share <path> /etc/exports (edit and add share) ## dfstab example share -F nfs -d "jumpstart" /export/jumpstart /sbin/service nfs reload ## /etc/exports example /export *(rw,fsid=0,insecure,no_root_s quash,sync)
create nfs share unshare <path> /etc/exports (edit and remove share) /sbin/service nfs reload
uncreate nfs share /etc/init.d/nfs.server start /etc/init.d/nfs.client start /sbin/service nfs start
svcadm enable nfs/server svcadm disable nfs/server /etc/init.d/nfs.server stop /etc/init.d/nfs.client stop
stop nfs daemons ps -ef|grep < nfs daemons> nfs status nfs reload shareall /sbin/service nfs reload /sbin/service nfs status
nfs performanace
nfsstat n/a
nfs Options solaris/redhat mount problems (nfs v3 to v4) NTP Solaris Time daemons xntpd # Solaris 8 ntpd /etc/ntp.conf (edit with ntp servers) dateconfig (GUI) chkconfig --list ntpd chkconfig --level 2345 ntpd on /sbin/service ntpd start Red Hat ## Make sure you use NFS version 3 mount -F nfs -o vers=3 <mount> <mountpoint> n/a
/etc/rc2.d/xntpd [start|stop] # Solaris 10 /etc/inet/ntp.server /etc/inet/ntp.client ntp setup svcadm enable ntpd /lib/svc/method/xntp
/etc/sysconfig/ntpd
ntp daemon options ntpq -p ntptrace NTP Trace commands Log Files Solaris messages syslog mail cron /var/cron/log /var/adm/messages /var/log/syslog Red Hat /var/log/messages /var/log/syslog /var/log/mail /var/log/cron ntpq -p ntptrace
/var/adm/messages dmesg
/var/log/boot dmesg
boot
logger
logger
Solaris Checking the passwd file checking the group file pwck grpck # No reboot required /etc/default/login pwck grpck
Red Hat
Red Hat
lilo (text based) setenv boot-device startup shutdown -i5 -g0 -y (power down) shutdown -i6 -g0 -y (reboot) shutdown -i0 -g0 -y (OK prompt) shutdown -h (halt) shutdown -r (reboot) shutdown -f (fast reboot no fsck) shutdown -F (force fsck) reboot -- -r (reboot/reconfigure) touch /reconfigure shutdown halt init poweroff reboot shutdown telinit uadmin 0 0 - shutdown 1 1 - single user 2 2 - n/a 3 3 - Multi-user halt init poweroff reboot shutdown telinit
4 4 - n/a
4 - unused
5 - GUI 6 - reboot
# change default
# change default
vi /etc/inittab -s single user -a interactive -x no device drivers (used in clustering) -r reconfigure devices -m milestone
vi /etc/inittab single - use grub to edit kernel line emergency - use grub to edit kernel line linux rescue - use at the boot prompt single: runlevel1, local fs mounted, no network emergency: root fs read-only, no init files run rescue: use cd-rom/network, root mounted as /mnt/sysimage
/etc/rc0.d - /etc/rc6.d
/etc/rc0.d - /etc/rc6.d
startup scripts boot printenv setenv banner devalias show-devs F10 or F12
show-pci-devs-all
probe-scsi-all probe-fcal-all probe-pci watch-net-all reset-all Phases: Boot PROM: displays system information, run POST, load bootblk, locate ufsboot
2. POST
Kernel Initialization: ufsboot loads and executes the core kernel, initializes core kernel data structures, loads other kernel modules based on the/etc/system file, starts/sbin/init program init: starts other processes based on the /etc/inittab file
5. GRUB (stage 1_5) - deals with specific filesystem types look at /boot/grub/*1_5 files 6. GRUB (stage 2) reads /etc/grub.conf and displays the grub menu, it specifies the kernel and the initrd files
7. KERNEL - control given to the kernel 8. INIT - reads /etc/inittab and runs /etc/rc.d/rc.sysinit script Boot process who -r determine the run level obtain default run level list locale start xwindows sys-unconfig cat /etc/inittab locale -a n/a runlevel who -r cat /etc/inittab locale -a startx (shorthand of below) initx (lots of parms)
Ubuntu/Debian
HP-UX
AIX
cat /etc/lsb-release
/stand/kernrel
dmidecode
model
free -om
/boot/initrd.img-?????-server
/stand/vmunix
/unix
uname -a
prtconf -k
getconf HW_CPU_SUPP_BIT S
enter PDC
invscout
invscout smit
HP-UX AIX dmesg | grep -i prtconf -m physical /usr/sam/lbin/getmem prtconf |grep -i memory /opt/ignite/bin/print_ manifest cat /var/opt/ignite/local/m anifest/manifest.info lsattr -El sys0 -a realmem bootinfo -r
device:
swapinfo (displayed in KB) swapinfo -m (display lsps -s in Mb) swapinfo -tm (total / Mb) Create logical mkps -a -s 4 -n <volume volume or filesystem group>
create partition with fdisk (type 82) file(create 50MB swap file): dd if=/dev/zero of=/var/swapfile bs=1024 count=50000 swapon <device> | -f # change the attributes <logical device> swapon -p 3 chps -a n paging00 (don't <device> | -f <logical use after restart) device> update /etc/fstab # change the logical volume attributes (name in this case) chlv -n <new name> <old old> (chang page space name)
mkswap <device>|<file>
swapon <device>|<file>
Note: -p = priority swap number . The nswapdev tunabl e system parameter controls the maximum number of swap devices. update /etc/fstab Note: -a reconfigure paging space after restart -s size of the page space (logical partitions) -n activiates the paging space (use swapoff to deactivate) also see /etc/swapspaces file swapoff /dev/paging00 rmps paging00
swapoff <device>|<file>
Remove device or file as normal Note: paging space must be deactiviated before removing
AIX lsdev -Cc disk lsdev -Cc disk -p scsi0 (specific controller) lsdev -Cc disk -S [a|d|s] (available, defined,stopped)
hdparm -i /dev/hda
diskinfo -v /dev/rdsk/c0t4d0 (detailed but no serial number) /opt/ignite/bin/print_ manifest (no serial number)
## Insure that the online diagnostic support tools have been installed swlist -l bundle | grep 'Support Tools'
sdparm -i /dev/sdb ## Command-Line Support Tools Manager (cstm) ## The run cstm cstm cstm> map cstm> sel dev 4 (select the disk of you choice) cstm> info cstm> il (obtain the serial number) cstm> quit lvlnboot -v /dev/vg00 lsvg -l rootvg lifls -Clv <device> lchangelv
fdisk -l sfdisk -l (advanced server) cat /proc/partitions (very high level) cat /etc/fstab
# Display the LIF cat /etc/filesystems contents lifcp /dev/dsk/c0t6d0:AUT Ocat /etc/fstab Note: Boot programs are stored in the boot area in Logical Interchange Format (LIF), which is similar to a file system. For a device to be bootable, the LIF volume on that device must contain at least the ISL
(the initial system loader) and HPUX (the HP-UX bootstrap utility) LIF files. ISL is like GRUB. mknod /dev/rawctl c 162 0 Just create a new LVOL without a filesystem - that's it. Just create a new LVOL without a filesystem
## display raw devices raw -qa df -k df -h bdf df [-egiklnvfb] df -k lsfs [<filesystem>] lsfs -q <filesystem> (detailed) crfs -v jfs2 -d data02lv -m /data02 -A yes
-v filesystem type
-A mount after restart [yes|no] rmfs -ri /data02 -r remove the mountpoint -i display warning before removing chfs -a size=+1G /var (grow by additional 1GB)
tunefs -v <filesystem> vxtunefs -v <filesystem> fstyp -v <filesystem> Note: you can perform the following resize # Disk fragmentation freeze fsadm -F vxfs -E / (report) fsadm -F vxfs -e / (defrag) change mountpoint permissions lots more..............................
n/a
# Look at the second line to see if a filesystem # needs checking tunefs -v <filesystem>
# edit /etc/default/rcS change below so # you dont have to hang around FSCKFIX=yes dump/restore tar dd cpio
cat /boot/grub/menu.lst
bootinfo -b (display last boot device) bootlist -m [normal|service] -o (display bootable devices)
/boot/grub/menu.lst
setboot -p <primary bootlist -m normal hdisk0 path> hdisk1 setboot -a <alternate path>
/boot/grub/menu.lst
grub-install <raw-device>
n/a
Note: we are treating the disk as a LVM device n/a format -d /dev/rfd0 format -d /dev/fd0.18 (high format)
n/a
n/a
mount -rF cdfs /dev/dsk/c1t6d0 /cdrom start: /usr/sbin/pps_mount d pps_mount mount_vxfs -o remount,ro <filesystem>
mount -o remount,rw /
mount -o remount,rw <filesystem> Note:I did find a note that it should be possible to remount a jfs2 filesystem, but it did not work on my system
n/a
using the grub window append the word singleto the kernel line
recovery tape mksysb (preview) make_tape_recovery v -l -x inc_entire=vg00 /opt/ignite/bin/make_ recovery -ACv enter PDC based on a 9114-275 workstation > search >boot p1 (cdrom) 1. Restart the machine.
using the grub window append the word singleto the kernel line
2. Wait the the AIX splash screen to come up. Devices begin to initialize here. 3. When you see the [keyboard] word on screen hit the F5 button or the 5 key depending on your console. 4. Choose default boot list when the maintenance screen comes up.
f10 or f12
1. Restart the machine. 2. Wait the the AIX splash screen to come up. Devices begin to initialize here. 3. When you see the [keyboard] word on screen hit the F5 button or the 5 key depending on your console. 4. Choose select boot options when the maintenance screen comes up, then option 1, then option 1 for scsi, then option 3 service mode boot
/dev/dsk/c1t6d0
/dev/cd0
/dev/MAKEDEV <device>
mkdev # remove all devices rmdev from a hardward path rmsf -k -H 52.6.0 rmdev -l cd0 chdev chdev -l rmt0 -a ret=no lsdev lsdev -Cc disk lsdev -Cc disk -p scsi0 lsslot -c pci -l ent0 lscfg lscfg -l ent0 lscfg -vl fcs0 (find the WWN of HBA adapter) lspath -l hdisk0 getconf DISK_SIZE hdisk1 (detailed)
cat /proc/devices
lsdev
Ubuntu/Debian /etc/network/interfaces
ifconfig
HP AIX /etc/rc.config.d/netco stores information in the nf ODM (Object Database Manager) ioscan -funC lan (list ifconfig -a hardware) lanscan -v (list configured) ifconfig lan0 entstat -d <interface> (individual) lsdev -Cc if lsdev -Cc tcpip
odmget -q "name=en0" CuAt lsattr -EHl en0 ifconfig ifconfig <interface> mktcpip (completely setup a network interface) rmtcpip (remove all network interfaces) # configure an interface mktcpip -h aix1 -a 192.168.1.200 -m 255.255.255.0 -i en1 -g 192.168.0.10 -h - hostname assigned to interface -a - ip address -m - netmask -i - interface name -g - gateway ip address # remove an interface ifconfig en1 detach ifconfig (configures IP address) chdev (add aliases to network interface) ifconfig en0 up ifconfig en0 down ifconfig en0 detach (remove)
note: there is no "ifconfig -a" in hpux use lanscan then "ifconfig <interface>" ethtool -s eth1 speed 100 duplex full ndd -set <device> <parm> <value> chdev -l ent0 -a media_speed=1000_Full_ Duplex -P lanadmin -X <option> chdev -l ent0 -a lan0 media_speed=Auto_Nego tiation -P Note: entX - physical device
ethtool eth0
lanadmin -> lan -> display ## options supported ndd -get /dev/ip ? ndd -get /dev/tcp ? ndd -get /dev/arp ? ndd -get /dev/udp ? netstat -i [-I interface] netstat -s lanscan
no -a no -o "ipforwarding=1"
ifconfig
tcpdump -i <interface>
nettl -start nettl -status all nettl -tn pduin pduout -e ns_ls_driver -file /var/adm/LAN nettl -stop
tcpdump -i <interface> iptrace -i <interface> <output file> ipreport (used with iptrace to view reports)
Note: you must stop the iptrace by using "kill -15" use netfmt to display the trace file edit /etc/network/interfaces /etc/rc.config.d/netco route add 0 <gateway IP nf address> Note: there is no file that holds the default router netstat -rn netstat -rn netstat -r -f inet lsattr -EHl inet0 -a route ifenslave -d bond0 eth1 (detach) You buy an optional smitty etherchannel product called Auto- (creates, deletes and Port Aggragation. tests)
cat /proc/net/bonding/bond0 /etc/hostname set_parms hostname hostname <new (requires reboot) hostname>
/etc/resolv.conf /etc/netsvc.conf /etc/resolv.conf /etc/irs.conf (may not be there) chnamsv (change name service) rmnamsv (remove a name service) lsnamsv -C (list name services) netcdctrl -t dns -e hosts -f
ip route get <IP address> traceroute Boot (jumpstart) servers: rpcinfo -b bootparam 1
n/a
Boot (jumpstart) Boot (jumpstart) servers: servers: rpcinfo -b bootparam rpcinfo -b bootparam 1 1 NFS servers: rpcinfo -b mountd 1 NIS servers/slaves: rpcinfo -b ypserv 1 NFS servers: rpcinfo -b mountd 1 NIS servers/slaves: rpcinfo -b ypserv 1
NFS servers: rpcinfo -b mountd 1 NIS servers/slaves: rpcinfo -u <yp server> ypserv
HP edit /stand/system
sysdumpdev -L (info)
/etc/kdump.conf (select where you want the dump to go) service kdump start chkconfig kdump on
dump lvol
dump none
# crash config file ## to crash the system echo "c" > /proc/sysrq-trigger
# set the dump device permanently /etc/rc.config.d/savec sysdumpdev -p <dump rash device> -P
HP
AIX topas -P topas -L (logical partitions) mpstat sar -c w (load average) uptime (load average) lparstat ps iostat -tT 1 tprof curt topas vmstat sar -b svmon ps ipcs -a lockstat (version 4) rmss [ent|tok|fddi|atm]stat netstat
free vmstat top procinfo slabtop sar cat /proc/meminfo ethtool mii-tool
netstat lanadmin
sam glance
topas -D (disk) topas -F (filesystem) iostat sar -D fcstat (fibre) lvmstat filemon (trcstop to stop) fileplace # disk stat history chdev -l sys0 -a iostat=true lsattr -HEl sys0 -a iostat topas truss sar probevue tprof svmon -P <pid> nfsstat
strace -p <pid>
nfsstat
nfsstat
HP kmadmin -k genkex
AIX
Config: /etc/modprobe.d/options /etc/modprobe.d modprobe <module> insmod modprobe -r <module> kmadmin -L <module name> kmadmin -U <module name> n/a n/a
n/a rmmod /etc/sysctl.conf (edit and update then reboot) sysctl -p <filename> kmadmin -u <module id> kcweb (11i) kctune (11i only) rebuild kernel (< 11i see below) chdev -l sys0 -a <parameter>=<value> no -a vmo -a memory) nfso -a ioo -a (network) (virtual (NFS) (Input/Ouput)
sysctl -w param=value
No reboot (dynamically):
echo "250 32000 100 28" > /proc/sys/kernel/sem echo "536870912" > /proc/sys/kernel/shmmax echo "4096" > /proc/sys/kernel/shmmni echo "2097152" > /proc/sys/kernel/shmall etc.............................................
vi /etc/security/limits cd /etc/tunables
tunchange, tundefault, tunsave, tunrestore, tuncheck Note: most parameters are dynamically changed in AIX , for example memory segments are dynamically adjusted sysctl -a cat /etc/sysctl.conf kctune (11i only) sysdef kmtune lsattr -EHl sys0 Note: only a few kernel parameters can be changed
/usr/lbin/sysadm/syst em_prep -v -s system edit system file Note: most parameters are dynamically changed in AIX , for example memory segments are dynamically adjusted
/usr/sbin/mk_kernel s ./system mv /stand/system /stand/system.old mv /stand/vmunix /stand/vmunix.old mv /stand/build/system /stand mv /stand/build/vmunix_ test /stand/vmunix reboot
ipcs -a
ipcs -a
ipcs -a
Ubuntu/Debian There is no services or chkconfig command use the old fashioned way /etc/init.d/<service>
HP There is no services or lssrc -a chkconfig command use the old fashioned way /sbin/init.d/<service>
AIX
startsrc -s <subsystem> startsrc -g <group> stopsrc -s <subsystem> stopsrc -g <group> refresh -s <subsystem> stopsrc -s <subsystem> startsrc -s <subsystem> lssrc -a n/a
Ubuntu/Debian
HP swlist -l bundle swlist -l product swlist -l patch swcopy (install patch into depot) swinstall (install patch from depot) Note: the swagentd daemon must be running swremove installp -r instfix -ia
AIX
instfix -k
dpkg -l dpkg -S <search string> (search) dpkg -S <filename> (file belongs) dpkg -s <package> (status) dpkg -p <package> (detailed)
lslpp -L all (all filesets) lslpp -L <package> (single fileset) lslpp -w <file> (file belongs)
rpm -qa (all packages) rpm -q (single package) rpm -qf (file belongs) rpm -qi <package> (very detailed) oslevel -g (install packkages above os level)
dpkg -i <package>
whereis <filename> which_fileset <filename> installp -a installp -c (cleanup after failed install) rpm -i geninstall (generic installer: installp, RPM, etc)
dpkg -r <package> (do not remove config files) dpkg -P <package> (remove config files)
swremove
n/a
geninstall -u <package> swverity <fileset> (see lppchk -v /var/adm/sw/swagent .log) rpm -V <package> swlist -l file <product> lslpp -f <fileset> rpm -ql <package> /usr/lpp /var/lib/rpm ldd <file>
/var/lib/dpkg/info
/var/adm/sw
ldd <file>
chatr <file>
Ubuntu/Debian cat /etc/passwd logins -x useradd useradd userdel sam userdel sam usermod sam
HP cat /etc/passwd
AIX cat /etc/passwd lsuser -f ALL (detailed) mkuser useradd rmuser userdel chuser -a usermod passwd -f
usermod
passwd -s chfn <username> usermod chfn <username><shell> passwd pwdadm passwd groupadd groupdel passwd groupadd groupdel pwdck -t ALL mkgroup <group name> rmgroup <group name> chgroup <attribute><group name>
groupmod /etc/passwd
/tcb/files/auth/r/root (trusted system) /etc/security/passwd id id whoami who w uptime (displays # of users logged in) finger whoami who w uptime (displays # of users logged in) finger # License information lslicense chlicense # Maximum number of processes for a user lsattr -D -l sys0 -a maxuproc chdev -l sys0 -a maxuproc=<number>
groups
groups setprivgrp
/var/lib/nfs/rmtab showmount -e localhost /etc/exports (edit and add share, see below example) exportfs -rav (export the shares)
/etc/xtab
exportfs showmount -e localhost /etc/rc.config.d/nfsco mknfsexp -d <directory> nf (edit) /etc/exports (edit and mknfsmnt add share) exportfs -a
shareall
/export *(rw,fsid=0,insecure,no_root_squash,sync) /etc/exports (edit and remove share) /etc/rc.config.d/nfsco rmnfsexp -d <directory> nf (edit) (unshares and removes from file) exportfs -au (unshare all) exportfs -u /home/vallep exportfs -u <filesystem>
/etc/exports (edit and unshareall remove share) /etc/init.d/portmap start /etc/init.d/nfs-kernel-server start /sbin/init.d/nfs.core start mknfs
/sbin/init.d/nfs.server chnfs start /sbin/init.d/nfs.client start startsrc -s nfsd startsrc -s rpc.mountd /sbin/init.d/nfs.client rmnfs stop /sbin/init.d/nfs.server stop /sbin/init.d/nfs.core stop stopsrc -s nfsd stopsrc -s rpc.mountd lssrc -a |grep -i nfs exportfs -av
nfsstat n/a
n/a
n/a
HP xntpd
AIX
/etc/rc.config.d/netd /etc/ntp.conf aemons (set XNTPD to 1) /etc/ntp.conf startsrc -s xntpd stopsrc -s xntpd
/etc/default/ntp
/etc/rc.config.d/netd startsrc -s xntpd -a "-x" aemons /etc/rc.tcpip ntpq -p ntpq -p ntpdate (set the date) ntptrace ntpdate
ntpq -p ntptrace
HP
AIX
/var/adm/syslog/syslo g.log /var/adm/ras /var/adm/syslog/syslo g.log /var/adm/ras /var/adm/syslog/mail .log /usr/spool/mqueue/syslog /var/adm/cron/log /var/adm/cron/log
/var/log/boot dmesg
/var/adm/syslog/syslo g.log /var/adm/ras dmesg alog -o -t boot alog -o -t console alog -L (list all the logs available) /usr/lib/errdemon -l (display attributes) /usr/lib/errdemon (start error logging) /usr/lib/errstop (stop error logging) # use with above errorlog file errpt (summary errorlog report) errpt -a (detailed errorlog report) errpt -j <identifier> (single errorlog report) errclear (clears errorlog) errclear -d <class><days> (clears class errors) errlogger "message upto 230 chars"
logger
logger
/etc/securetty
Note: you may need to chsec -f /etc/security/user -s root create this file if it does not exist
HP setboot -p <primary path> setboot -a <alternate path> # autoboot sequnce setboot -b [on|off] shutdown -h now (halt) shutdown -r now(reboot)
touch /forcefsck # edit /etc/default/rcS change below so # you dont have to hang around FSCKFIX=yes halt init poweroff reboot shutdown telinit
3 - multiuser 3 - user defined (networking, NFS, and CDE GUI) (default) 4 - multiuser (netwrking, NFS, and VUE GUI) 5 - n/a 6 - n/a 4 - user defined
4 - same as 2
5 - same as 2 6 - reboot
5 - user defined 6 - user defined 7-9 - user defined # change default - change the initdefault line
# change default change the initdefault line vi /etc/inittab interact with IPL? Y
vi /etc/inittab
vi /etc/event.d/rc-default single - use grub to edit kernel line emergency - use grub to edit kernel line linux rescue - use at the boot prompt
single: runlevel1, local fs mounted, no network emergency: root fs read-only, no init files run rescue: use cd-rom/network, root mounted as /mnt/sysimage # Logical volume maintanence mode ISL> hpux -lm
Note: to enter the SMS menu press numeric 1 after the word keyboard but before the word speaker
/etc/init.d
# No quroum check ISL> hpux -lq /sbin/init.d /etc/rc.config.d (startup config files)
/etc/rc.d /etc/rc.d/init.d
/etc/rc.* (config files for auto-starting) also uses the System Resource Controller F10 or F12 interact with IPL? Y Based on a 9114-275 workstation 1. switch off the machine 2. power on and enter the SMS menu
Note: to enter the SMS menu press numeric 1 after the word keyboard but before the word speaker
Phases: Read Only Storage (ROS): check the system board, perform POST, locate and load boot image, begin system initialization and execute phase 1 of the /etc/rc.boot script Base Device Configuration: start configuration manager to configue base devices System Boot: start init process phase 2, switch to hard-disk root filesystem, start other processes defined by /etc/inittab and execute phase 3 of the /etc/rc.boot script
2. POST
2. ISL - initial system loader; loads the secondary system loader hpux 3. HPUX - is the secondary system loader and loads the kernel /stand/vmunix, then hands over to the kernel 4. KERNEL - swapper processes are started by the kernel then starts the init process 5. INIT - reads /etc/inittab
5. GRUB (stage 1_5) - deals with specific filesystem types look at /boot/grub/*1_5 files
6. GRUB (stage 2) reads /boot/grub/menu.lst and displays the grub menu, it specifies the kernel and the initrd files
7. KERNEL - control given to the kernel 8. INIT - runs the /etc/event.d/rc-default script
set_parms install_assist [initial|hostname|ip_a ddress|timezone] Note: set_parms is in /sbin /etc/timezone /usr/share/zoneinfo/zone.tab /etc/TIMEZONE /etc/environment /etc/profile