Você está na página 1de 112

Sheet1

Common Unix Commands


Sysinfo
Memory and Swap
Disks, Filesystems and Devices
Networking
Crash Dump
Performance Monitoring and Diagnostics
Kernel Modules and Parameters
Services
Patching / Packages
Accounts
NFS
NTP
Log Files
Security
Misc
sysinfo

Server Release info


Server type

Hardware Info
Operating System

Memory

CPU (type, number, etc)

Page 1

Sheet1
CPU (type, number, etc)

Disk Drives

Kernel File and associated directories

Kernel 32 or 64

Display Firmware

Display IRQ, IO ports and DMA


GUI admin tool

Memory and Swap

Memory
page size (memory)

display swap

Page 2

Sheet1

adding swap

removing swap
Disks, Filesystems and Devices

Disk Drives

Disk serial Number, type, etc

Disk disk partitions


Page 3

Sheet1

List Raw Partitions

Filesystem commands

Filesystem (create|remove)

Tune Filesystems

Force fsck

backup filesystem

Page 4
Display the boot device

Sheet1

Display the boot device

Setting the boot device

Creating boot device (MBR)

Format floppy drive


mount/unmount floppy

mount/unmount CDROM

remount a filesystem

create boot disk or recovery tape

boot cdrom/diskette (single user)

boot into maintenace mode

Device paths

Page 5

Sheet1
Device paths

update /dev directory

remove or change a device

list device drivers


Networking

Basic network information


(hostname, ip address)

displaying network interfaces

Page 6

Configure network interface

Sheet1

Configure network interface

Starting and stopping a network interface

Setting NIC speed

Change NIC parameters

Display NIC statistics


display MAC address

Displaying network packets

default router

display routing table

Test IPMP, Bonding

change the hostname


setup DNS
Page 7

Name service switch file (DNS client)

Sheet1

Name service switch file (DNS client)


Flush DNS cache

Domain Name
Obtain IP Address routing

Find Services on the network


Crash Dump

Crash Dump
Performance Monitoring and Diagnostics

CPU
Page 8

Sheet1

Memory

Network I/O

Disk I/O

Application
NFS
Kernel Modules and Parameters

display loaded modules


load modules
unload modules

Page 9

Sheet1

set kernel parameters (tuning)

display kernel parameters

build kernel
interprocess communication
Services

display services
start services
stop services
reload service
restart service
service status
service dependencies
service dependants

service logging, etc


change service startup

Add a new service

Page 10

Sheet1
Add a new service
Patching / Software

display installed patches

adding patch
removing patch

display installed packages

adding package

removing packages

verify package

List files in package

Package directory
List libraries required for binary program
Accounts
Page 11

Sheet1

display users
create a user
remove a user

modify a user

change user password


create a group
remove a group
modify a goup
password files

useful user commands

useful group commands


NFS

NFS Daemons

NFS files
List nfs clients that have a remote mount
display nfs shares
Page 12

Sheet1

create nfs share

uncreate nfs share

start/change nfs daemons

stop nfs daemons


nfs status
nfs reload
nfs performanace

nfs Options
solaris/redhat mount problems (nfs v3 to v4)
NTP

Time daemons

ntp setup

ntp daemon options

NTP Trace commands


Page 13

Sheet1
Log Files

messages
syslog
mail
cron

boot

Error logging
Security

Checking the passwd file


checking the group file

console login (allow/deny)


Misc

startup

Page 14
shutdown

Sheet1

shutdown

Change run level


init status
0
1
2
3
4
5
6

Startup options

startup scripts

boot prompt commands


Page 15

Sheet1

Boot process
determine the run level
obtain default run level
list locale
start xwindows

initialize system
Timezone

Page 16

Sheet1

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
List, Monitor and trace processes
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

Solaris
cat /etc/release

/usr/platform/`uname -i`/sbin/prtdiag -v
prtdiag -v
prtpicl -v [-c <class>]
prtconf -D

uname -a
/usr/platform/`uname -i`/sbin/prtdiag -v
prtconf | grep -i mem

/usr/platform/`uname -i`/sbin/prtdiag -v
## display,offline,online
psrinfo
Page 17

Sheet1
psradm -f 0 (offline)
psradm -n 0 (online)
format
prtvtoc <device>
format -e (to convert EFI (zfs) to SMI)
Note:
EFI - Extensible Firmware Interface
SMI - Sun Microsystems Inc
/kernel/genunix
/platform/sparc/kernel
/platform/i86pc/kernel
/kernel
/usr/kernel
isainfo -kv (solaris 9+)
isalist (sparc v9 will be listed first)
isainfo -b

At the OK prompt type banner

n/a

admintool

Solaris
/usr/platform/`uname -i`/sbin/prtdiag -v
prtconf | grep -i mem

/usr/bin/pagesize
swap -l
swap -s
mkfile 5m /var/swapfile
swap -a /var/swapfile
Page 18

Sheet1
update /etc/vfstab

update /etc/vfstab
swap -d

Solaris
format
prtvtoc <device>
format -e (to convert EFI (zfs) to SMI)
Note:
EFI - Extensible Firmware Interface
SMI - Sun Microsystems Inc
format
iostat -En
luxadm inq <disk> (A5x00 disk arrays)

prtvtoc <device>
cat /etc/vfstab

Page 19

Sheet1
use format to partition the disk then just use the slice as a raw partition, remember to use the character device

df -k
df -h
newfs -v <raw device>
# Display how the filesystem was created
newfs -Nv <filesystem>

tunefs
fstyp -v <device> |grep -i minfree

# Check to see filesystem needs checking


fstyp -v <filesystem> | grep fsclean

ufsdump|ufsrestore
tar
dd
cpio

eeprom |grep boot-device


prtconf -pv |grep bootpath
Page 20

Sheet1
prtpicl -v|grep ':bootpath'

setenv boot-device [<device>|<alias>]


eeprom boot-device [<device>|<alias>]

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk <raw-device>

fdformat -v -U
volcheck -v
newfs -v /vol/disk/aliases/floppy0
volrmmount -l floppy0
eject floppy
mount -F hsfs -o ro <device path> /cdrom/cdrom0
umount /cdrom/cdrom0
/etc/init.d/volmgr start
eject cdrom
n/a

n/a

ok> boot cdrom -s

ok> boot -as

floppy:
disk:
/dev/dsk/c0t0d0s0
tape:
/dev/rmt/0ucb
cdrom:
Page 21

Sheet1
/dev/dsk/c0t6d0s0
/dev/scd0 (external usb cd)
drvconfig
devlinks
disks|tapes|ports
devfsadm ( solaris 8, 9, 10)
rem_drv

prtconf -D
sysdef

Solaris
/etc/hostname.hme0
prtdiag -v
ifconfig -a
kstat hme:0
kstat e1000g:0

ifconfig

Page 22

Sheet1

ifconfig qfe0 up
ifconfig qfe0 down

ndd -set <device> <parm> <value> (dynamically)


/etc/system (edit and update then reboot - permanent)

ndd -get <device> <parm>


# List parameters
ndd -get /dev/hme \?
ndd -get /dev/e1000g0 \?
ndd -get /dev/ip \?
ndd -get /dev/tcp \?

ifconfig -a (as user root)


snoop -d <interface>

/etc/defaultrouter
route add default <gteway>
netstat -rn

if_mpadm -d
if_mpadm -r

(detach)
(reattach)

tail /var/adm/messages
change the following files:
/etc/nodename
/etc/hostname.<interface>
/etc/inet/hosts
/etc/inet/ipnodes
/etc/net - few files in here as well
/etc/resolv.conf
/etc/nsswitch.conf
Page 23

Sheet1
/etc/resolv.conf

svcadm restart system/name-service-cache:default


/etc/defaultdomain

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

Solaris
dumpadm -d <device>
crash (used to analyse crash dumps)
adb (used to analyse crash dumps)

Solaris
top (sunfreeware)
prstat
sar
mpstat
w
(load average)
uptime (load average)
ps
vmstat

Page 24

Sheet1
prstat
vmstat
top
sar

ndd
netstat
lsof
snoop
route

sar -d
iostat
vmstat
lsof

truss -p <pid>

nfsstat

Solaris
modinfo

modload -p drv/<module name>


modunload -i <module number>
/etc/system (edit and reboot)
Page 25

/etc/system (edit and reboot)

Sheet1

cat /etc/system
sysdef -i

edit and update file then reboot:


/etc/system

ipcs -a

Solaris 10
svcs -a
inetadm -l
svcadm enable nfs
svcadm disable nfs
svcadm refresh nfs
svcadm restart nfs
svcs nfs
svcs -d network
svcs -D network
/var/svc/log
/var/svc/manifest
/lib/svc/method
n/a
n/a
Page 26

n/a

Sheet1

Solaris
showrev -p
patchadd -p
patchadd
patchadd -M <dir> (multiple patches)

patchrm
pkginfo (all packages)
pkginfo -l (single package)
pkgchk -l -p <file> (file belongs)

pkgadd

pkgrm

pkginfo -l
pkginfo -p
pkgchk -l <package> | grep -i pathname

/var/sadm

ldd <file>

Page 27

Sheet1
Solaris
cat /etc/passwd
logins -x
useradd
userdel

usermod

passwd
groupadd
groupdel
groupmod
/etc/passwd
/etc/shadow
id -a
whoami
who
w
finger

groups
setpgrp
newgrp

Solaris
server: mountd, nfsd
client: statd, lockd
/etc/dfs/dfstab
/etc/dfs/sharetab
/etc/rmtab
/etc/rmtab
dfshares
showmount -e localhost
/etc/dfs/dfstab (edit and add share)
Page 28

Sheet1
share <path>
## dfstab example
share -F nfs -d "jumpstart" /export/jumpstart

unshare <path>
/etc/dfs/dfstab (edit and remove share)

/etc/init.d/nfs.server start
/etc/init.d/nfs.client start
svcadm enable nfs/server
svcadm disable nfs/server
/etc/init.d/nfs.server stop
/etc/init.d/nfs.client stop

ps -ef|grep < nfs daemons>


shareall
nfsstat
n/a

## Make sure you use NFS version 3


mount -F nfs -o vers=3 <mount> <mountpoint>

Solaris
xntpd
# Solaris 8
/etc/ntp.conf
/etc/ntp.server
/etc/ntp.client
/etc/rc2.d/xntpd [start|stop]
# Solaris 10
/etc/inet/ntp.server
/etc/inet/ntp.client
svcadm enable ntpd
/lib/svc/method/xntp

ntpq -p
ntptrace
Page 29

Sheet1

Solaris
/var/adm/messages
/var/log/syslog
/var/cron/log
/var/adm/messages
dmesg

logger

Solaris
pwck
grpck
# No reboot required
/etc/default/login

Solaris
eeprom
setenv boot-device

shutdown -i5 -g0 -y (power down)


shutdown -i6 -g0 -y (reboot)
shutdown -i0 -g0 -y (OK prompt)
reboot -- -r (reboot/reconfigure)
Page 30

Sheet1
touch /reconfigure

halt
init
poweroff
reboot
shutdown
telinit
uadmin
0 - shutdown
1 - single user
2 - n/a
3 - Multi-user
4 - n/a
5 - power off
6 - reboot

# change default
vi /etc/inittab
-s single user
-a interactive
-x no device drivers (used in clustering)
-r reconfigure devices
-m milestone

/etc/init.d
/etc/rc0.d - /etc/rc6.d

boot
printenv
setenv
banner
devalias
show-devs
show-pci-devs-all
probe-scsi-all
probe-fcal-all
probe-pci
watch-net-all
reset-all
Page 31

Sheet1
Phases:
Boot PROM: displays system information, run POST, load bootblk, locate ufsboot
Boot Programs: bootblk loads and executes the ufsboot

Kernel Initialization: ufsboot loads and executes the core kernel, initializes core kernel data structures, loads other kernel modules base
init: starts other processes based on the /etc/inittab file

who -r
cat /etc/inittab
locale -a
n/a
sys-unconfig

/etc/TIMEZONE
/etc/default/init

Page 32

Sheet1

Red Hat
cat /etc/enterprise-release
cat /etc/redhat-release
lsb_release -a
cat /proc/version
dmidecode
lspci
lsusb
lshal
Note: hal = hardware abstraction layer

uname -a
cat /proc/meminfo (detailed)
free -om
cat /proc/slabinfo
cat /proc/cpuinfo (detailed)

Page 33

cat /proc/cpuinfo (detailed)


Sheet1

fdisk -l
sfdisk -l (advanced server)
parted <device> print
partprobe -s <device>

/boot/initrd.?????.img
/boot/vmlinuz

uname -a
uname -m
getconf -a |grep -i 'long_bit'

boot into the BIOS (normally F2 or F12)

/proc/interrupts
/proc/ioports
/proc/dma
linuxconf

Red Hat
cat /proc/meminfo (detailed)
free -om

/usr/bin/getconf -a| egrep -i 'pagesize|page_size'


cat /proc/swaps (detailed)
swapon -s
device:
create partition with fdisk (type 82)
Page 34

Sheet1
file(create 50MB swap file):
dd if=/dev/zero of=/var/swapfile bs=1024 count=50000
mkswap <device>|<file>
swapon <device>|<file>
update /etc/fstab

swapoff <device>|<file>
Remove device or file as normal

Red Hat
fdisk -l
sfdisk -l (advanced server)
parted <device> print
partprobe <device>

hdparm -i /dev/hda
hdparm -I /dev/hda (detailed)
hdparm -Tt /dev/hda (speed test)
sdparm -i /dev/sdb
cat /proc/ide/ide0/hda/model
cat /proc/scsi/scsi

fdisk -l
sfdisk -l (advanced server)
cat /proc/partitions (very high level)
cat /etc/fstab

Page 35

Sheet1
## Old way
/etc/sysconfig/rawdevices
service rawdevices start
chkconfig rawdevices on
## 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
mkfs -t ext3 /dev/sdb1

tune2fs
tune2fs -l /dev/sda1
# change reserved blocks percentage to 1%
tune2fs -m 1 /dev/sda1

touch /forcefsck
shutdown -Fr now

tune2fs -l /dev/sdb<?> |grep -i 'filesystem state'

dump/restore
tar
dd
cpio

cat /boot/grub/grub.conf
cat /etc/lilo.conf
Page 36

Sheet1
grub = grand unified boot loader
lilo = linux loader
/boot/grub/grub.conf
/etc/lilo.conf

grub-install <raw-device>
lilo -v
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 -o remount,rw /

mkbootdisk `uname -r` (boot diskette)

using the grub window append the word single to the kernel line

f10 or f12

floppy:
/dev/fd0
disk:
/dev/hda or /dev/sda
/dev/hdb or /dev/sdb
tape:
Page 37

Sheet1
cdrom:
/dev/hda (depends on number of IDE disks)
/dev/MAKEDEV <device>

cat /proc/devices

Red Hat
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
ifconfig
system-config-network (GUI)

ifconfig

Page 38

Sheet1

/sbin/ifup eth0
/sbin/ifdown eth0

mii-tool -F 100baseTx-FD eth0


ethtool -s eth1 speed 100 duplex full

mii-tool -v
ethtool eth1
ethtool -t eth0 online
sysctl -a | grep net*

ifconfig
system-config-network (GUI)
tcpdump -i <interface>
ethereal (needs to be installed)

edit /etc/sysconfig/network
add: GATEWAY=<IP address>
netstat -rn
route -n
ifenslave -d bond0 eth1 (detach)
ifenslave bond0 eth1
(reattach)
cat /proc/net/bonding/bond0
/etc/sysconfig/network
/etc/hosts
sysctl -a |grep hostname

/etc/resolv.conf
/etc/nsswitch.conf
Page 39

Sheet1
/etc/host.conf
/etc/resolv.conf

## 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
NFS servers:
rpcinfo -b mountd 1
NIS servers/slaves:
rpcinfo -u <yp server> ypserv

Red Hat
diskdump
netdump
kdump (part of kexec rpm)
/etc/kdump.conf (select where you want the dump to go)
service kdump start
chkconfig kdump on
## to crash the system
echo "c" > /proc/sysrq-trigger
crash (used to analyse crash dumps)

Red Hat
top
sar
mpstat
w
(load average)
uptime (load average)
ps
vmstat
procinfo
oprofile
cat /proc/cpuinfo
Page 40

Sheet1
free
vmstat
top
procinfo
slabtop
sar
cat /proc/meminfo
ethtool
mii-tool
netstat
lsof
tcpdump
ip
iptraf
sar -d
iostat
vmstat
lsof

strace -p <pid>

nfsstat

Red Hat
cat /proc/modules (more detailed)
lsmod
Location:
/lib/modules/`uname -r`/kernel/drivers
Config:
/etc/modprobe.conf
/etc/modprobe.d
modprobe <module>
insmod
modprobe -r <module>
rmmod
/etc/sysctl.conf (edit and update then reboot)
sysctl -p <filename>
Page 41

Sheet1
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.............................................

sysctl -a
cat /etc/sysctl.conf
cat /proc/sys/kernel/sem
cat /proc/sys/kernel/shmmax
etc...................................
cd /usr/src/linux-2.5
edit Makefile (change EXTRAVERSION)
make mrproper
backup .config
make xconfig
make dep
make bzImage
make modules
move new kernel
make modules_install
change lilo/grub config file
reboot
ipcs -a

Red Hat
service --status-all
service nfs start
service nfs stop
service nfs reload
service nfs restart
service nfs staus
n/a
n/a
n/a

chkconfig --levels 2345 nfs on


# Create your stop/start
# script in /etc/init.d
Page 42

Sheet1
chkconfig --add <script>

Red Hat

patch -p1 <patch>


zcat patch46.gz | patch -p1
Note: -p = # of path stripping
patch -R -p1 <patch>
rpm -qa (all packages)
rpm -q (single package)
rpm -qf (file belongs)
rpm -qi <package> (very detailed)

rpm -Uhv (updates/installs if not already)


rpm -ihv (install)

rpm -e <package>

rpm -V <package>

rpm -ql <package>

/var/lib/rpm

ldd <file>

Page 43

Sheet1
Red Hat
cat /etc/passwd
system-config-users (GUI)
useradd
system-config-users (GUI)
userdel
system-config-users (GUI)
usermod
system-config-users (GUI)

passwd
groupadd
groupdel
groupmod
/etc/passwd
/etc/shadow
id -a
whoami
who
w
finger

groups

Red Hat
server: rpc.mountd,nfsd
client: rpc.statd, lockd
/etc/exports
/var/lib/nfs/etab
/var/lib/nfs/xtab
/var/lib/nfs/rmtab
showmount -e localhost
redhat-config-nfs (GUI)
Page 44

Sheet1
/etc/exports (edit and add share)
/sbin/service nfs reload
## /etc/exports example
/export *(rw,fsid=0,insecure,no_root_squash,sync)
/etc/exports (edit and remove share)
/sbin/service nfs reload

/sbin/service nfs start

/sbin/service nfs stop

/sbin/service nfs status


/sbin/service nfs reload
nfsstat
cat /var/lib/nfs/etab

n/a

Red Hat
ntpd
/etc/ntp.conf (edit with ntp servers)
dateconfig (GUI)
chkconfig --list ntpd
chkconfig --level 2345 ntpd on
/sbin/service ntpd start

/etc/sysconfig/ntpd

ntpq -p
ntptrace
Page 45

Sheet1

Red Hat
/var/log/messages
/var/log/syslog
/var/log/mail
/var/log/cron
/var/log/boot
dmesg

logger

Red Hat
pwck
grpck
# No reboot required
/etc/securetty

Red Hat
grub (GUI)
lilo (text based)

shutdown -h (halt)
shutdown -r (reboot)
shutdown -f (fast reboot no fsck)
shutdown -F (force fsck)

Page 46

Sheet1

halt
init
poweroff
reboot
shutdown
telinit

0 - halt
1 - single user
2 - multiuser (no networking)
3 - multiuser (networking)
4 - unused
5 - GUI
6 - reboot

# change default
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/init.d
/etc/rc0.d - /etc/rc6.d

F10 or F12

Page 47

Sheet1
Boot sequence
BIOS
POST
Master Boot Record (MBR) - point to the bootloader GRUB or LILO
GRUB (stage 1) - point to GRUB stage 1_5
GRUB (stage 1_5) - deals with specific filesystem types look at /boot/grub/*1_5 files
GRUB (stage 2) reads /etc/grub.conf and displays the grub menu, it specifies the kernel and the initrd files
KERNEL - control given to the kernel
INIT - reads /etc/inittab and runs /etc/rc.d/rc.sysinit script
runlevel
who -r
cat /etc/inittab
locale -a
startx (shorthand of below)
initx (lots of parms)

/etc/sysconfig/clock
/usr/share/zoneinfo/zone.tab

Page 48

Sheet1

Ubuntu/Debian
cat /etc/lsb-release
lsb_release -a

dmidecode
lspci
lsusb
lshal

uname -a
cat /proc/meminfo (detailed)
free -om
cat /proc/slabinfo
cat /proc/cpuinfo (detailed)

Page 49

cat /proc/cpuinfo (detailed)


Sheet1

fdisk -l
sfdisk -l (advanced server)
parted <device> print
partprobe <device>

/boot/initrd.img-?????-server
/boot/vmlinuz-????-server

uname -a
uname -m
getconf -a |grep -i 'long_bit'

boot into the BIOS (normally F2 or F12)

/proc/interrupts
/proc/ioports
/proc/dma
linuxconf

Ubuntu/Debian
cat /proc/meminfo (detailed)
free -om

/usr/bin/getconf -a| egrep -i 'pagesize|page_size'


cat /proc/swaps (detailed)
swapon -s
device:
create partition with fdisk (type 82)
Page 50

Sheet1
file(create 50MB swap file):
dd if=/dev/zero of=/var/swapfile bs=1024 count=50000
mkswap <device>|<file>
swapon <device>|<file>
update /etc/fstab

swapoff <device>|<file>
Remove device or file as normal

Ubuntu/Debian
fdisk -l
sfdisk -l (advanced server)
parted <device> print
partprobe <device>

hdparm -i /dev/hda
hdparm -I /dev/hda (detailed)
haparm -Tt /dev/hda (speed test)
sdparm -i /dev/sdb
cat /proc/ide/ide0/hda/model
cat /proc/scsi/scsi

fdisk -l
sfdisk -l (advanced server)
cat /proc/partitions (very high level)
cat /etc/fstab

Page 51

Sheet1
mknod /dev/rawctl c 162 0
mknod /dev/raw/raw0 c 162 1
mknod /dev/raw/raw1 c 162 2
ln -s /dev/rawctl /dev/raw/rawctl
## map raw devices to the disk
raw /dev/raw/raw1 /dev/sdb1
## display raw devices
raw -qa
df -k
df -h
mkfs -t ext3 /dev/sdb1

tune2fs
tune2fs -l /dev/sda1
# change reserved blocks percentage to 1%
tune2fs -m 1 /dev/sda1

touch /forcefsck
shutdown -r now

tune2fs -l /dev/sdb<?> |grep -i 'filesystem state'


# 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
Page 52

cat /boot/grub/menu.lst

Sheet1

/boot/grub/menu.lst

grub-install <raw-device>

n/a

n/a
mount -rt iso9660 /dev/cdrom /mnt/cdrom
umount /mnt/cdrom
eject cdrom

mount -o remount,rw /

n/a

using the grub window append the word single to the kernel line

f10 or f12

floppy:
/dev/fd0
disk:
/dev/hda or /dev/sda
/dev/hdb or /dev/sdb
tape:
Page 53

Sheet1
cdrom:
/dev/hda (depends on number of IDE disks)
/dev/MAKEDEV <device>

cat /proc/devices

Ubuntu/Debian
/etc/network/interfaces
ifconfig

ifconfig

Page 54

Sheet1

/sbin/ifup eth0
/sbin/ifdown eth0

ethtool -s eth1 speed 100 duplex full

ethtool eth0
sysctl -a |grep net*

ifconfig
tcpdump -i <interface>
ethereal (needs to be installed)

edit /etc/network/interfaces
add: gateway <IP address>
netstat -rn
route -n
ifenslave -d bond0 eth1 (detach)
ifenslave bond0 eth1
(reattach)
cat /proc/net/bonding/bond0
/etc/hostname
/etc/hosts
sysctl -a |grep hostname

/etc/resolv.conf
/etc/nsswitch.conf
Page 55

Sheet1
/etc/host.conf
/etc/resolv.conf

/etc/host
/etc/resolv.conf

ip route get <IP address>


traceroute
Boot (jumpstart) servers:
rpcinfo -b bootparam 1
NFS servers:
rpcinfo -b mountd 1
NIS servers/slaves:
rpcinfo -u <yp server> ypserv

Ubuntu/Debian
diskdump
netdump
kdump (part of kexec rpm)
/etc/kdump.conf (select where you want the dump to go)
service kdump start
chkconfig kdump on
## to crash the system
echo "c" > /proc/sysrq-trigger
crash (used to analyse crash dumps)

Ubuntu/Debian
top
sar
mpstat
w
(load average)
uptime (load average)
ps
vmstat
procinfo
cat /proc/cpuinfo

Page 56

Sheet1
free
vmstat
top
procinfo
slabtop
sar
cat /proc/meminfo
ethtool
mii-tool
netstat
lsof
tcpdump
ip
iptraf
sar -d
iostat
vmstat
lsof

strace -p <pid>

nfsstat

Ubuntu/Debian
cat /proc/modules (more detailed)
lsmod
Location:
/lib/modules/`uname -r`/kernel/drivers
Config:
/etc/modprobe.d/options
/etc/modprobe.d
modprobe <module>
insmod
modprobe -r <module>
rmmod
/etc/sysctl.conf (edit and update then reboot)
sysctl -p <filename>
Page 57

Sheet1
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.............................................

sysctl -a
cat /etc/sysctl.conf
cat /proc/sys/kernel/sem
cat /proc/sys/kernel/shmmax
etc...................................

ipcs -a

Ubuntu/Debian
There is no services or chkconfig command use the old fashioned way /etc/init.d/<service>

Page 58

Sheet1

Ubuntu/Debian

dpkg -l
dpkg -S <search string> (search)
dpkg -S <filename> (file belongs)
dpkg -s <package> (status)
dpkg -p <package> (detailed)

dpkg -i <package>

dpkg -r <package> (do not remove config files)


dpkg -P <package> (remove config files)

n/a

dpkg -L <package> (list files)

/var/lib/dpkg/info

ldd <file>

Page 59

Sheet1
Ubuntu/Debian
cat /etc/passwd

useradd
userdel

usermod

passwd
groupadd
groupdel
groupmod
/etc/passwd
/etc/shadow
id -a
whoami
who
w
finger

groups

Ubuntu/Debian
server: rpc.mountd,nfsd
client: rpc.statd, lockd
/etc/exports
/var/lib/nfs/etab
/var/lib/nfs/xtab
/var/lib/nfs/rmtab
showmount -e localhost
/etc/exports (edit and add share, see below example)
Page 60

Sheet1
exportfs -rav (export the shares)
/etc/init.d/portmap restart
/etc/init.d/nfs-kernel-server restart
## /etc/exports example
/export *(rw,fsid=0,insecure,no_root_squash,sync)
/etc/exports (edit and remove share)
exportfs -rav (export the shares)

/etc/init.d/portmap start
/etc/init.d/nfs-kernel-server start

/etc/init.d/portmap stop
/etc/init.d/nfs-kernel-server stop

/etc/init.d/nfs-kernel-server status
exportfs -rav (export the shares)
nfsstat
cat /var/lib/nfs/etab

n/a

Ubuntu/Debian
ntpd
/etc/default/ntp
/etc/ntp.conf
/etc/init.d/ntp [start|stop|restart]

/etc/default/ntp

ntpq -p
ntptrace
Page 61

Sheet1

Ubuntu/Debian
/var/log/messages
/var/log/syslog
/var/log/mail.*
/var/log/cron.log
/var/log/boot
dmesg

logger

Ubuntu/Debian
pwck
grpck
# No reboot required
/etc/securetty

Ubuntu/Debian
grub (GUI)

shutdown -h (halt)
shutdown -r (reboot)
shutdown -P (power off)
touch /forcefsck
Page 62

Sheet1
# edit /etc/default/rcS change below so
# you dont have to hang around
FSCKFIX=yes
halt
init
poweroff
reboot
shutdown
telinit

0 - halt
1 - single user
2 - multiuser (default)
3 - same as 2
4 - same as 2
5 - same as 2
6 - reboot

# change default - change all the telinit


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

/etc/init.d
/etc/rc0.d - /etc/rc6.d

F10 or F12

Page 63

Sheet1
Boot sequence
BIOS
POST
Master Boot Record (MBR) - point to the bootloader GRUB or LILO
GRUB (stage 1) - point to GRUB stage 1_5
GRUB (stage 1_5) - deals with specific filesystem types look at /boot/grub/*1_5 files
GRUB (stage 2) reads /boot/grub/menu.lst and displays the grub menu, it specifies the kernel and the initrd files
KERNEL - control given to the kernel
INIT - runs the /etc/event.d/rc-default script
runlevel
who -r
/etc/event.d/rc-default
locale -a

/etc/timezone
/usr/share/zoneinfo/zone.tab

Page 64

Sheet1

HP-UX
/stand/kernrel

model
uname -a
ioscan
ioscan -fun [disk|tape|lan]
/opt/ignite/bin/print_manifest
cat /var/opt/ignite/local/manifest/manifest.info

uname -a
dmesg | grep -i physical
/usr/sam/lbin/getmem
/opt/ignite/bin/print_manifest
cat /var/opt/ignite/local/manifest/manifest.info
/opt/ignite/bin/print_manifest
sam -> performance monitors -> system properties
cat /var/opt/ignite/local/manifest/manifest.info
Page 65

Sheet1

ioscan -funC disk

/stand/vmunix

getconf KERNEL_BITS ( version 11)


/opt/ignite/bin/print_manifest |grep -i 'os mode'
HPUX < version 11 all 32 bit
Note: determine if system supports 64 bit
getconf HW_CPU_SUPP_BITS
/opt/ignite/bin/print_manifest |grep -i 'hw capability'

workstations:
reboot
enter PDC
type: IN (information menu)
type: FV (Firmware Version)
n/a

sam

HP
dmesg | grep -i physical
/usr/sam/lbin/getmem
/opt/ignite/bin/print_manifest
cat /var/opt/ignite/local/manifest/manifest.info
dmesg |grep -i physical
swapinfo (displayed in KB)
swapinfo -m (display in Mb)
swapinfo -tm (total / Mb)
Create logical volume or filesystem
Page 66

Sheet1
swapon <device> | -f <logical device>
swapon -p 3 <device> | -f <logical device>
update /etc/fstab
Note: -p = priority swap number . The nswapdev tunable system parameter controls the maximum number of swap devices.

remove entry from /etc/fstab


reboot

HP
ioscan -funC disk

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'
## 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
lifls -Clv <device>
# Display the LIF contents
lifcp /dev/dsk/c0t6d0:AUTO cat /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 b
(the initial system loader) and HPUX (the HP-UX bootstrap utility) LIF files. ISL is like GRUB.
Page 67

Sheet1
Just create a new LVOL without a filesystem - that's it.

bdf
df [-egiklnvfb]
newfs -F vxfs -o largefiles /dev/vg01/rlvol1
mkfs -F vxfs -o largefiles /dev/vg01/rlvol1
Note: mkfs and newfs are a pointer to /sbin/fs_wrapper

tunefs -v <filesystem>
vxtunefs -v <filesystem>
fstyp -v <filesystem>
# Disk fragmentation
fsadm -F vxfs -E / (report)
fsadm -F vxfs -e / (defrag)

# Look at the second line to see if a filesystem


# needs checking
tunefs -v <filesystem>

fbackup/frecover
dump/restore
ftio
tar
dd
cpio
setboot
Page 68

setboot

Sheet1

setboot -p <primary path>


setboot -a <alternate path>
# autoboot sequnce
setboot -b [on|off]
mkboot -l <device>
Note: we are treating the disk as a LVM device
n/a

n/a
mount -rF cdfs /dev/dsk/c1t6d0 /cdrom
start: /usr/sbin/pps_mountd
pps_mount
mount_vxfs -o remount,ro <filesystem>

recovery tape (preview)


make_tape_recovery -v -l -x inc_entire=vg00
/opt/ignite/bin/make_recovery -ACv
enter PDC
> search
>boot p1 (cdrom)
interact with IPL? Y
ISL> hpux -is

>boot pri
interact with IPL? Y
ISL> hpux -lm

floppy:
n/a
disk:
/dev/dsk/c0t6d0
tape:
/dev/dsk/rmt/0
Page 69

Sheet1
cdrom:
/dev/dsk/c1t6d0
insf -C tape (Class)
insf -H 0.1.0 -e (recreate deleted link)

# remove all devices from a hardward path


rmsf -k -H 52.6.0

lsdev

HP
/etc/rc.config.d/netconf
ioscan -funC lan (list hardware)
lanscan -v (list configured)
ifconfig lan0 (individual)

ifconfig <interface>

Page 70

Sheet1

ifconfig lan0 up
ifconfig lan0 down
note: there is no "ifconfig -a" in hpux use lanscan then "ifconfig <interface>"
ndd -set <device> <parm> <value>
lanadmin -X <option> lan0

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
nettl -start
nettl -status all
nettl -tn pduin pduout -e ns_ls_driver -file /var/adm/LAN
nettl -stop
use netfmt to display the trace file
/etc/rc.config.d/netconf

netstat -rn

You buy an optional product called Auto-Port Aggragation.

set_parms hostname (requires reboot)

/etc/resolv.conf
/etc/nsswitch.conf
Page 71

Sheet1
/etc/resolv.conf

n/a
/etc/rc.config.d/netconf

n/a
Boot (jumpstart) servers:
rpcinfo -b bootparam 1
NFS servers:
rpcinfo -b mountd 1
NIS servers/slaves:
rpcinfo -b ypserv 1

HP
edit /stand/system
add either:
dump 2/0/1.5.0
dump lvol
dump none
# crash config file
/etc/rc.config.d/savecrash

HP
top
sar
w
(load average)
uptime (load average)
ps
vmstat
glance
sam

Page 72

Sheet1
top
vmstat
sar
sam
glance

netstat
lanadmin
sam
glance

iostat
sar
sam
glance

download and install tusc


tusc -p <pid>

nfsstat

HP
kmadmin -k

kmadmin -L <module name>


kmadmin -U <module name>
kmadmin -u <module id>
kcweb (11i)
kctune (11i only)
Page 73

Sheet1
rebuild kernel (< 11i see below)

kctune (11i only)


sysdef
kmtune
kmsystem
/usr/sam/lbin/getkinfo -f /stand/vmunix -o /tmp/kernel.data
cd /stand/build
/usr/lbin/sysadm/system_prep -v -s system
edit system file
/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

HP
There is no services or chkconfig command
use the old fashioned way /sbin/init.d/<service>

Page 74

Sheet1

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
swlist -l bundle <bundle>
swlist -l product <product>
## check a package
swlist -s <full_path/software>

swinstall
swinstall -s <full_path/software>

swremove

swverity <fileset> (see /var/adm/sw/swagent.log)

swlist -l file <product>

/var/adm/sw

chatr <file>

Page 75

Sheet1
HP
cat /etc/passwd
logins -x
useradd
sam
userdel
sam
usermod
sam

passwd
groupadd
groupdel
groupmod
/etc/passwd
/tcb/files/auth/r/root (trusted system)
id
whoami
who
w
uptime (displays # of users logged in)
finger

groups
setprivgrp

HP
server: rpc.mountd, nfsd
client: rpc.statd, lockd
/etc/exports
/etc/xtab
/etc/rmtab
showmount -e localhost
/etc/rc.config.d/nfsconf (edit)
Page 76

Sheet1
/etc/exports (edit and add share)
exportfs -a

/etc/rc.config.d/nfsconf (edit)
exportfs -au (unshare all)
exportfs -u /home/vallep
/etc/exports (edit and remove share)
/sbin/init.d/nfs.core start
/sbin/init.d/nfs.server start
/sbin/init.d/nfs.client start

/sbin/init.d/nfs.client stop
/sbin/init.d/nfs.server stop
/sbin/init.d/nfs.core stop
ps -ef | grep <nfs daemons>
exportfs -a
nfsstat
n/a

n/a

HP
xntpd
/etc/rc.config.d/netdaemons (set XNTPD to 1)
/etc/ntp.conf

/etc/rc.config.d/netdaemons

ntpq -p
ntpdate (set the date)
Page 77

Sheet1

HP
/var/adm/syslog/syslog.log
/var/adm/syslog/syslog.log
/var/adm/syslog/mail.log
/var/adm/cron/log
/var/adm/syslog/syslog.log
dmesg

logger

HP
pwck
grpck
# No reboot required
/etc/securetty
Note: you may need to 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)

Page 78

Sheet1

init
reboot
shutdown

0 - halt
1 - single users
2 - multiuser (networking)
3 - multiuser (networking, NFS, and CDE GUI) (default)
4 - multiuser (netwrking, NFS, and VUE GUI)
5 - n/a
6 - n/a

# change default - change the initdefault line


vi /etc/inittab
interact with IPL? Y
# single user
ISL> hpux -is
# Logical volume maintanence mode
ISL> hpux -lm
# No quroum check
ISL> hpux -lq
/sbin/init.d
/etc/rc.config.d (startup config files)
/sbin/rc0.d - /sbin/rc6.d

interact with IPL? Y

Page 79

Sheet1
Phases:
PDC - processor-dependent code; executes and performs self-tests
ISL - initial system loader; loads the secondary system loader hpux
HPUX - is the secondary system loader and loads the kernel /stand/vmunix, then hands over to the kernel
KERNEL - swapper processes are started by the kernel then starts the init process
INIT - reads /etc/inittab

who -r
/etc/inittab
locale -a
n/a
set_parms [initial|hostname|ip_address|timezone]
Note: set_parms is in /sbin
/etc/TIMEZONE

Page 80

Sheet1

AIX

oslevel -r

prtconf | grep -i 'System Model'


lscfg -v
lscfg -l ent0
lscfg -vl fcs0 (find the WWN of HBA adapter)
lsdev
lsdev -Cc disk
lsdev -Cc disk -p scsi0
lsslot -c [pci|phb|port]
lsslot -c pci -l ent0
lspath -l hdisk0
diag
oslevel [-r|-s]
prtconf -m
prtconf |grep -i memory
lsattr -El sys0 -a realmem
bootinfo -r
prtconf |grep -i processor

Page 81

prtconf |grep -i processor


Sheet1

lsdev -Cc disk


lsdev -Cc disk -p scsi0 (specific controller)
lsdev -Cc disk -S [a|d|s] (available, defined, stopped)
lscfg -v -l hdisk0

/unix
/usr/lib/boot
/usr/lib/drivers
Note: /unix - symbolic link to kernel file i.e /usr/lib/boot/unix_64
prtconf -k
bootinfo -K

prtconf |grep -i firmware


lscfg -pv
invscout

prtconf

smit
smitty

AIX
prtconf -m
prtconf |grep -i memory
lsattr -El sys0 -a realmem
bootinfo -r
pagesize
pagesize -a (display all supported pagesizes)
lsps -a (detailed)
lsps -s
mkps -a -s 4 -n <volume group>
Page 82

Sheet1
# change the attributes
chps -a n paging00 (don't use after restart)
# change the logical volume attributes (name in this case)
chlv -n <new name> <old old> (chang page space name)
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
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)
lscfg -v -l hdisk0

lscfg -vl hdisk0


lscfg -vl hdisk*

lsvg -l rootvg
lchangelv
cat /etc/filesystems

Page 83

Sheet1
Just create a new LVOL without a filesystem
# create a raw volume
mklv -y rawVolume vg01 10

df -k
lsfs [<filesystem>]
lsfs -q <filesystem> (detailed)
crfs -v jfs2 -d data02lv -m /data02 -A yes
-v filesystem type
-d device or logical volume
-m mountpoint
-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)
chfs -a size=1G /var (grow to 1GB in size)
chfs
Note: you can perform the following
resize
freeze
change mountpoint
permissions
lots more..............................
n/a

backup|restore
tar
dd
cpio

bootinfo -b (display last boot device)


bootlist -m [normal|service] -o (display bootable devices)
Page 84

Sheet1

bootlist -m normal hdisk0 hdisk1

bosboot -a (uses default device)


bosboot -ad hdisk1
format -d /dev/rfd0
format -d /dev/fd0.18 (high format)

mount /dev/rfd0 /floppy


mount -v cdrfs -r /dev/cd0 /cdrom
umount /cdrom

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
mksysb

based on a 9114-275 workstation


Restart the machine.
Wait the the AIX splash screen to come up. Devices begin to initialize here.
When you see the [keyboard] word on screen hit the F5 button or the 5 key depending on your console.
Choose default boot list when the maintenance screen comes up.
based on a 9114-275 workstation
Restart the machine.
Wait the the AIX splash screen to come up. Devices begin to initialize here.
When you see the [keyboard] word on screen hit the F5 button or the 5 key depending on your console.

Choose select boot options when the maintenance screen comes up, then option 1, then option 1 for scsi, then option 3 service mode
floppy:
/dev/fd0
/dev/rfd0
disk:
/dev/hdisk0
tape:
Page 85

Sheet1
cdrom:
/dev/cd0
cfgmgr
cfgmgr -l scsi0
mkdev
rmdev
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)

AIX
stores information in the ODM (Object Database Manager)
ifconfig -a
entstat -d <interface>
lsdev -Cc if
lsdev -Cc tcpip
odmget -q "name=en0" CuAt
lsattr -EHl en0
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
Page 86

Sheet1
# 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)
chdev -l ent0 -a media_speed=1000_Full_Duplex -P
chdev -l ent0 -a media_speed=Auto_Negotiation -P
Note:
entX - physical device
enX - frame type run on entX
netstat -v
entstat -d <interface>
no -a
no -o "ipforwarding=1"

netstat -i [-f inet]


netstat -s
entstat -d <interface>
netstat -ia
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"


route add 0 <gateway IP address>
Note: there is no file that holds the default router
netstat -rn
netstat -r -f inet
lsattr -EHl inet0 -a route
smitty etherchannel (creates, deletes and tests)
entstat -d ent0
hostname <new hostname>
chdev -l inet0 -a hostname=<hostname>

/etc/resolv.conf
/etc/netsvc.conf
Page 87

Sheet1
/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
domainname <domainname>

route -n get <hostname>


Boot (jumpstart) servers:
rpcinfo -b bootparam 1
NFS servers:
rpcinfo -b mountd 1
NIS servers/slaves:
rpcinfo -b ypserv 1

AIX
sysdumpdev -l (list dump destination)
sysdumpdev -e (estimates dumpsize)
sysdumpdev -L (info)
sysdumpstart -p (start dump primary)
sysdumpstart -s (start dump secondary)
# set the dump device permanently
sysdumpdev -p <dump device> -P
# analyse dump file
echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0

AIX
topas -P
topas -L (logical partitions)
mpstat
sar -c
w
(load average)
uptime (load average)
lparstat
ps
iostat -tT 1
tprof
curt
Page 88

Sheet1
topas
vmstat
sar -b
svmon
ps
ipcs -a
lockstat (version 4)
rmss
[ent|tok|fddi|atm]stat
netstat
netpmon (trcstop to stop trace)

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

AIX
genkex

n/a
n/a
chdev -l sys0 -a <parameter>=<value>
no -a
(network)
Page 89

Sheet1
vmo -a
nfso -a
ioo -a
raso -a
schedo -a

(virtual memory)
(NFS)
(Input/Ouput)
(reliability, availability, serviceability)
(processor scheduler)

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
lsattr -EHl sys0
Note: only a few kernel parameters can be changed

chdev -l sys0 -a <parameter>=<value>


Note: most parameters are dynamically changed in AIX , for example memory segments are dynamically adjusted

ipcs -a

AIX
lssrc -a
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
n/a
/var/adm/ras
/etc/syslog.conf
/etc/rc.tcpip
n/a

Page 90

Sheet1

AIX
instfix -ia

instfix -k

installp -r
lslpp -L all (all filesets)
lslpp -L <package> (single fileset)
lslpp -w <file> (file belongs)
lslpp -ha (history of filesets)
rpm -qa (all packages)
rpm -q (single package)
rpm -qf (file belongs)
rpm -qi <package> (very detailed)
oslevel -g (install packkages above os level)
whereis <filename>
which_fileset <filename>
installp -a
installp -c (cleanup after failed install)
rpm -i
geninstall (generic installer: installp, RPM, etc)
installp -u (commited packages)
installp -r (applied packages)
rpm -e <package>
geninstall -u <package>
lppchk -v
rpm -V <package>
lslpp -f <fileset>
rpm -ql <package>
/usr/lpp
/var/lib/rpm
ldd <file>

Page 91

Sheet1
AIX
cat /etc/passwd
lsuser -f ALL (detailed)
mkuser
useradd
rmuser
userdel
chuser -a
usermod
passwd -f
passwd -s
chfn <username>
chfn <username><shell>
passwd
pwdadm
pwdck -t ALL
mkgroup <group name>
rmgroup <group name>
chgroup <attribute><group name>
/etc/security/passwd
id
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
setgroups
lsgroup ALL

AIX
server: rpc.mountd, nfsd
client: rpc.statd, rpc.lockd
/etc/exports
/etc/xtab
/etc/xtab
exportfs
showmount -e localhost
mknfsexp -d <directory>
Page 92

Sheet1
mknfsmnt
shareall

rmnfsexp -d <directory> (unshares and removes from file)


exportfs -u <filesystem>
unshareall
mknfs
chnfs
startsrc -s nfsd
startsrc -s rpc.mountd
rmnfs
stopsrc -s nfsd
stopsrc -s rpc.mountd
lssrc -a |grep -i nfs
exportfs -av
nfsstat
nfso -a
nfso -o <option>=<value>
exportfs (display options)
n/a

AIX
xntpd
/etc/ntp.conf
startsrc -s xntpd
stopsrc -s xntpd
lslpp -L all|grep xntpd

startsrc -s xntpd -a "-x"


/etc/rc.tcpip
ntpq -p
ntptrace
ntpdate
Page 93

Sheet1

AIX
/var/adm/ras
/var/adm/ras
/usr/spool/mqueue/syslog
/var/adm/cron/log
/var/adm/ras
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"

AIX
pwdck -t ALL
usrck -t ALL
grpck
# No reboot required
/etc/security/user
chsec -f /etc/security/user -s root

AIX
bootlist -m normal hdisk0 hdisk1

shutdown -F (fast shutdown)


shutdown -Fr (fast shutdown and reboot)

Page 94

Sheet1

init
shutdown
reboot
telinit
halt

0 - reserved
1 - reserved
2 - multiuser mode with NFS
3 - user defined
4 - user defined
5 - user defined
6 - user defined
7-9 - user defined
# change default - change the initdefault line
vi /etc/inittab
Based on 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

/etc/rc.d
/etc/rc.d/init.d
/etc/rc.d/rc2.d - rc9.d
/etc/rc.* (config files for auto-starting)
also uses the System Resource Controller
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

Page 95

Sheet1
Phases:

Read Only Storage (ROS): check the system board, perform POST, locate and load boot image, begin system initialization and execute
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 pha

who -r
/etc/inittab
locale -a
n/a
install_assist

/etc/environment
/etc/profile

Page 96

Sheet1

Server Release
Server type

Hardware Info
Operating System

Memory

CPU (type, num

Page 97

Sheet1
CPU (type, num

Disk Drives

Kernel File

Kernel 32 or 64

Display Firmw

Display IRQ,
GUI admin too

Memory
page size (mem

display swap

Page 98

Sheet1

adding swap

removing swap

Disk Drives

Disk serial Num

Disk disk parti


Page 99

Sheet1

List Raw Partit

Filesystem co

Filesystem (cre

Tune Filesyste

Force fsck

backup filesys

Page 100
Display the boo

Sheet1

Display the boo

Setting the boo

Creating boot

Format floppy
mount/unmount

mount/unmou

remount a files

create boot dis

boot cdrom/disk

boot into main

Device paths

Page 101

Sheet1
Device paths

update /dev dir

remove or chan

list device driv

Basic network information


(hostname, ip address)

displaying netw

Page 102

Configure netw

Sheet1

Configure netw

Starting and st

Setting NIC sp

NIC speeds or

Display network
display MAC a

Displaying net

default router

display routing

Test IPMP, Bon

change the hos


setup DNS
Page 103

Name service sw

Sheet1

Name service sw
Flush DNS cac

Domain Name
Obtain IP Addr

Find Services o

Crash Dump

CPU
Page 104

Sheet1

Memory

Network I/O

Disk I/O

Application
NFS

display loaded
load modules
unload module

Page 105

Sheet1

set kernel para

display kernel

build kernel
interprocess communication

display service
start services
stop services
reload service
restart service
service status
service dependencies
service dependants

service logging,
change service startup

Page 106

Sheet1

display install

adding patch
removing patch

display install

adding packag

removing pack

verify package

List files in pa

Package direct
List libraries required for binary program

Page 107

Sheet1

display users
create a user
remove a user

modify a user

change user pa
create a group
remove a group
modify a goup
password files

useful user co

useful group

NFS Daemons

NFS files
List nfs clients that have a remote mount
display nfs sha
Page 108

Sheet1

create nfs shar

uncreate nfs sh

start/change n

stop nfs daemo


nfs status
nfs reload
nfs performanace

nfs Options
solaris/redhat

Time daemons

ntp setup

ntp daemon opt

NTP Trace co
Page 109

Sheet1

messages
syslog
mail
cron

boot

Error logging

Checking the pa
checking the group file

console login (

startup

Page 110
shutdown

Sheet1

shutdown

Change run lev


init status
0
1
2
3
4
5
6

Startup options

startup scripts

boot prompt c
Page 111

Sheet1

Boot process
determine the r
obtain default run level
list locale
start xwindows

initialize syste
Timezone

Page 112

Você também pode gostar