Escolar Documentos
Profissional Documentos
Cultura Documentos
Hardware Info
Operating System
Memory
Page 1
Sheet1
CPU (type, number, etc)
Disk Drives
Kernel 32 or 64
Display Firmware
Memory
page size (memory)
display swap
Page 2
Sheet1
adding swap
removing swap
Disks, Filesystems and Devices
Disk Drives
Sheet1
Filesystem commands
Filesystem (create|remove)
Tune Filesystems
Force fsck
backup filesystem
Page 4
Display the boot device
Sheet1
mount/unmount CDROM
remount a filesystem
Device paths
Page 5
Sheet1
Device paths
Page 6
Sheet1
default router
Sheet1
Domain Name
Obtain IP Address routing
Crash Dump
Performance Monitoring and Diagnostics
CPU
Page 8
Sheet1
Memory
Network I/O
Disk I/O
Application
NFS
Kernel Modules and Parameters
Page 9
Sheet1
build kernel
interprocess communication
Services
display services
start services
stop services
reload service
restart service
service status
service dependencies
service dependants
Page 10
Sheet1
Add a new service
Patching / Software
adding patch
removing patch
adding package
removing packages
verify package
Package directory
List libraries required for binary program
Accounts
Page 11
Sheet1
display users
create a user
remove a user
modify a user
NFS Daemons
NFS files
List nfs clients that have a remote mount
display nfs shares
Page 12
Sheet1
nfs Options
solaris/redhat mount problems (nfs v3 to v4)
NTP
Time daemons
ntp setup
Sheet1
Log Files
messages
syslog
mail
cron
boot
Error logging
Security
startup
Page 14
shutdown
Sheet1
shutdown
Startup options
startup scripts
Sheet1
Boot process
determine the run level
obtain default run level
list locale
start xwindows
initialize system
Timezone
Page 16
Sheet1
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
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
ufsdump|ufsrestore
tar
dd
cpio
Sheet1
prtpicl -v|grep ':bootpath'
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
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
/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
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
Sheet1
cat /etc/system
sysdef -i
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
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
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
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'
/proc/interrupts
/proc/ioports
/proc/dma
linuxconf
Red Hat
cat /proc/meminfo (detailed)
free -om
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
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 /
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 -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
Sheet1
chkconfig --add <script>
Red Hat
rpm -e <package>
rpm -V <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
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
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'
/proc/interrupts
/proc/ioports
/proc/dma
linuxconf
Ubuntu/Debian
cat /proc/meminfo (detailed)
free -om
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
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 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
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>
n/a
/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
/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
/stand/vmunix
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.
HP
ioscan -funC disk
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)
fbackup/frecover
dump/restore
ftio
tar
dd
cpio
setboot
Page 68
setboot
Sheet1
n/a
mount -rF cdfs /dev/dsk/c1t6d0 /cdrom
start: /usr/sbin/pps_mountd
pps_mount
mount_vxfs -o remount,ro <filesystem>
>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)
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
netstat -rn
/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
nfsstat
HP
kmadmin -k
Sheet1
rebuild kernel (< 11i see below)
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
/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
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
Page 81
/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
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
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
Sheet1
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"
/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>
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
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
AIX
xntpd
/etc/ntp.conf
startsrc -s xntpd
stopsrc -s xntpd
lslpp -L all|grep xntpd
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
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
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
Sheet1
Filesystem co
Filesystem (cre
Tune Filesyste
Force fsck
backup filesys
Page 100
Display the boo
Sheet1
Creating boot
Format floppy
mount/unmount
mount/unmou
remount a files
boot cdrom/disk
Device paths
Page 101
Sheet1
Device paths
remove or chan
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
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
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
uncreate nfs sh
start/change n
nfs Options
solaris/redhat
Time daemons
ntp setup
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
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