View
71
Download
2
Category
Preview:
DESCRIPTION
Unix
Citation preview
Common Unix Commands
Sysinfo Display system information i.e cpu, memory, etcMemory and Swap Information regarding the physical memory and swap areaDisks, Filesystems and Devices Displaying disk information, filesystemsNetworking Display and configuring network parametersCrash Dump Configure, display and use the crash dump utiltitiesPerformance Monitoring and Diagnostics List, Monitor and trace processesKernel Modules and Parameters Displaying, modifying and tuning kernel parametersServices Display, start and stop servicesPatching / Packages Installing and removing patches and software packagesAccounts Setting up and removing user accountsNFS Information on NFS i.e starting, stopping, etcNTP Network Time ProtocolLog Files Location to common log filesSecurity Security informationMisc Other stuff i.e shutdown, timezone, run level, etc
sysinfo
Solaris Red Hat Ubuntu/Debian HP-UX AIX
Server Release info
cat /etc/release cat /etc/enterprise-releasecat /etc/redhat-release
lsb_release -a
cat /proc/version
cat /etc/lsb-release
lsb_release -a
/stand/kernrel
oslevel -r Server Release info
Server type/usr/platform/`uname -i`/sbin/prtdiag -v dmidecode dmidecode
modeluname -a
prtconf | grep -i 'System Model'Server type
Hardware Info
prtdiag -vprtconf -D prtpicl -v [-c ]
picl = platform information and controllibrary
lspcilsusblshal
Note: hal = hardware abstraction layer
lspcilsusblshal
ioscanioscan -fun [disk|tape|lan]
/opt/ignite/bin/print_manifestcat /var/opt/ignite/local/manifest/manifest.info
lscfg -v lscfg -l ent0lscfg -vl fcs0 (find the WWN of HBA adapter)
lsdevlsdev -Cc disklsdev -Cc disk -p scsi0
lsslot -c [pci|phb|port]lsslot -c pci -l ent0
lspath -l hdisk0
diag
Hardware Info
Operating System uname -a uname -a uname -a uname -a oslevel [-r|-s] Operating System
Memory
/usr/platform/`uname -i`/sbin/prtdiag -vprtconf | grep -i mem cat /proc/meminfo (detailed)
free -om
cat /proc/slabinfo
cat /proc/meminfo (detailed)free -om
cat /proc/slabinfo
dmesg | grep -i physical/usr/sam/lbin/getmem/opt/ignite/bin/print_manifest
cat /var/opt/ignite/local/manifest/manifest.info
prtconf -m prtconf |grep -i memorylsattr -El sys0 -a realmembootinfo -r Memory
CPU (type, number, etc)
/usr/platform/`uname -i`/sbin/prtdiag -v
## display,offline,onlinepsrinfopsradm -f 0 (offline) psradm -n 0 (online)
cat /proc/cpuinfo (detailed) cat /proc/cpuinfo (detailed)/opt/ignite/bin/print_manifestsam -> performance monitors -> system properties
cat /var/opt/ignite/local/manifest/manifest.info
prtconf |grep -i processor
CPU (type, number, etc)
Disk Drives
formatprtvtoc
format -e (to convert EFI (zfs) to SMI)
Note:EFI - Extensible Firmware Interface
fdisk -lsfdisk -l (advanced server)parted printpartprobe -s
smartctl -a
fdisk -lsfdisk -l (advanced server)parted printpartprobe
ioscan -funC disk lsdev -Cc disklsdev -Cc disk -p scsi0 (specific controller)lsdev -Cc disk -S [a|d|s] (available, defined, stopped)
lscfg -v -l hdisk0 Disk Drives
SMI - Sun Microsystems Inc
Kernel File and associateddirectories
/kernel/genunix
/platform/`uname -m`/kernel/platform/i86pc/kernel/kernel/usr/kernel
/boot/initrd.?????.img/boot/vmlinuz
/boot/initrd.img-?????-server/boot/vmlinuz-????-server
/stand/vmunix /unix
/usr/lib/boot/usr/lib/drivers
Note: /unix - symbolic link to kernel file i.e/usr/lib/boot/unix_64
Kernel File
Kernel 32 or 64
isainfo -kv (solaris 9+)isalist (sparc v9 will be listed first)isainfo -b
uname -auname -mgetconf -a |grep -i 'long_bit'cat /proc/version
uname -auname -mgetconf -a |grep -i 'long_bit'
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 bitgetconf HW_CPU_SUPP_BITS/opt/ignite/bin/print_manifest |grep -i 'hw capability'
prtconf -kbootinfo -K
Kernel 32 or 64
Display Firmware
At the OK prompt type banner boot into the BIOS (normally F2 or F12) boot into the BIOS (normally F2 or F12)workstations:rebootenter PDCtype: IN (information menu) type: FV (Firmware Version)
prtconf |grep -i firmware lscfg -pvinvscout Display Firmware
Display IRQ, IO ports and DMAn/a /proc/interrupts
/proc/ioports/proc/dma
/proc/interrupts/proc/ioports/proc/dma
n/a prtconf Display IRQ, IO ports andDMA
GUI admin tool admintool linuxconf linuxconf sam smitsmitty GUI admin tool
Memory and Swap
Solaris Red Hat Ubuntu/Debian HP AIX
Memory
/usr/platform/`uname -i`/sbin/prtdiag -vprtconf | grep -i mem
cat /proc/meminfo (detailed)free -om
cat /proc/meminfo (detailed)free -om dmesg | grep -i physical
/usr/sam/lbin/getmem/opt/ignite/bin/print_manifest
cat /var/opt/ignite/local/manifest/manifest.info
prtconf -m prtconf |grep -i memorylsattr -El sys0 -a realmembootinfo -r Memory
page size(memory)
/usr/bin/pagesize /usr/bin/getconf -a| egrep -i'pagesize|page_size'
/usr/bin/getconf -a| egrep -i'pagesize|page_size'
dmesg |grep -i physical pagesizepagesize -a (display all supported pagesizes) page size (memory)
display swapswap -lswap -s
cat /proc/swaps (detailed)swapon -s
cat /proc/swaps (detailed)swapon -s
swapinfo (displayed in KB)swapinfo -m (display in Mb)swapinfo -tm (total / Mb)
lsps -a (detailed) lsps -s display swap
adding swap
mkfile 5m /var/swapfile swap -a /var/swapfile
update /etc/vfstab
device:create partition with fdisk (type 82)file(create 50MB swap file):dd if=/dev/zero of=/var/swapfilebs=1024 count=50000
mkswap |swapon |
update /etc/fstab
device:create partition with fdisk (type82)file(create 50MB swap file):dd if=/dev/zero of=/var/swapfilebs=1024 count=50000
mkswap |swapon |
update /etc/fstab
Create logical volume or filesystem
swapon | -f swapon -p 3 | -f
update /etc/fstab
Note: -p = priority swap number . The nswapdevtunable system parameter controls the maximumnumber of swap devices.
mkps -a -s 4 -n
# change the attributes chps -a n paging00 (don't use after restart)
# change the logical volume attributes (name in this case) chlv -n (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
adding swap
removingswap
update /etc/vfstabswap -d
swapoff |
Remove device or file as normal
swapoff |
Remove device or file as normal
remove entry from /etc/fstabreboot
swapoff /dev/paging00rmps paging00
Note: paging space must be deactiviated before removingremoving swap
Disks, Filesystems and Devices
Solaris Red Hat Ubuntu/Debian HP AIX
formatprtvtoc cfgadm -alfcinfo hba-port
fdisk -lsfdisk -l (advanced server)parted printpartprobe
fdisk -lsfdisk -l (advanced server)parted printpartprobe
ioscan -funC disk lsdev -Cc disklsdev -Cc disk -p scsi0 (specific controller)lsdev -Cc disk -S [a|d|s] (available, defined,stopped)
Disk Drives
luxadm probempathadm list initiator-port mpathadm show iscsiadm list initiator-nodeiscsiadm list discovery
format -e (to convert EFI (zfs) to SMI)
Note:EFI - Extensible Firmware InterfaceSMI - Sun Microsystems Inc
udevadm info -q all -n /dev/sda1blkiddmsetup [ls|info]
lscfg -v -l hdisk0
Disk Drives
Disk serial Number, type,etc
formatiostat -Enluxadm inq (A5x00 disk arrays)
hdparm -i /dev/hdahdparm -I /dev/hda (detailed)
hdparm -Tt /dev/hda (speed test)
sdparm -i /dev/sdb
cat /proc/ide/ide0/hda/modelcat /proc/scsi/scsi
hdparm -i /dev/hdahdparm -I /dev/hda (detailed)
haparm -Tt /dev/hda (speed test)
sdparm -i /dev/sdb
cat /proc/ide/ide0/hda/modelcat /proc/scsi/scsi
diskinfo -v /dev/rdsk/c0t4d0 (detailed but no serialnumber)/opt/ignite/bin/print_manifest (no serial number)
## Insure that the online diagnostic support toolshave been installedswlist -l bundle | grep 'Support Tools'
## Command-Line Support Tools Manager (cstm) ## The run cstm cstmcstm> mapcstm> sel dev 4 (select the disk of you choice)cstm> infocstm> il (obtain the serial number) cstm> quit
lscfg -vl hdisk0lscfg -vl hdisk*
Disk serial Number, type, etc
Disk disk partitions
prtvtoc
cat /etc/vfstabfdisk -lsfdisk -l (advanced server)
cat /proc/partitions (very high level)cat /etc/fstab
fdisk -lsfdisk -l (advanced server)
cat /proc/partitions (very high level)cat /etc/fstab
lvlnboot -v /dev/vg00 lifls -Clv
# Display the LIF contentslifcp /dev/dsk/c0t6d0:AUTO -
cat /etc/fstab
Note: Boot programs are stored in the boot area inLogical Interchange Format (LIF), which is similar toa file system. For a device to be bootable, the LIFvolume on that device must contain at least the ISL(the initial system loader) and HPUX (the HP-UXbootstrap utility) LIF files. ISL is like GRUB.
lsvg -l rootvg lchangelv
cat /etc/filesystems
Disk disk partitions
List Raw Partitions
use format to partition the disk then just usethe slice as a raw partition, remember to usethe character device
## Old way /etc/sysconfig/rawdevicesservice rawdevices startchkconfig rawdevices on
## New way, Edit below file /etc/udev/rules.d/60-raw.rulesudevinfo -d or udevadm info
## Display raw partitions raw -qa
mknod /dev/rawctl c 162 0mknod /dev/raw/raw0 c 162 1mknod /dev/raw/raw1 c 162 2ln -s /dev/rawctl /dev/raw/rawctl
## map raw devices to the diskraw /dev/raw/raw1 /dev/sdb1
## display raw devicesraw -qa
Just create a new LVOL without a filesystem - that'sit. Just create a new LVOL without a filesystem
# create a raw volumemklv -y rawVolume vg01 10
List Raw Partitions
Bad Blocksformat (use analyse ) badblocks badblocks dd if=/dev/rdsk/cXtYd0 of=/dev/null bs=1024K
Note: no errors means disk is good
chlv -b [y|n]
Note: enables bad block relocation
Filesystem commandsdf -kdf -h
df -k df -h
df -kdf -h
bdfdf [-egiklnvfb]
df -k lsfs [] lsfs -q (detailed)
Filesystem commands
Filesystem (create|remove)
newfs -v
# Display how the filesystem was created newfs -Nv
mkfs -t ext3 /dev/sdb1 mke2fs -t ext4 /dev/sdb1
# all point to mke2fs mkfs.ext2mkfs.ext3mkfs.ext4
cat /etc/mke2fs.conf
mkfs -t ext3 /dev/sdb1 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
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)
Filesystem (create|remove|resize)
tunefstune2fs tune2fs
tunefs -v chfs
Tune Filesystems
fstyp -v |grep -i minfree tune2fs -l /dev/sda1
# change reserved blocks percentage to 1%tune2fs -m 1 /dev/sda1
tune2fs -l /dev/sda1
# change reserved blocks percentage to 1%tune2fs -m 1 /dev/sda1
vxtunefs -v fstyp -v
# Disk fragmentationfsadm -F vxfs -E / (report)fsadm -F vxfs -e / (defrag)
Note: you can perform the followingresizefreezechange mountpointpermissionslots more..............................
Tune Filesystems
Force fsck # Check to see filesystem needs checkingfstyp -v | grep fsclean
touch /forcefsckshutdown -Fr nowfsck.mode=force (kernel parameter)
tune2fs -l /dev/sdb |grep -i 'filesystem state'
touch /forcefsckshutdown -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
# Look at the second line to see if a filesystem # needs checking tunefs -v
n/a
Force fsck
backup filesystem
ufsdump|ufsrestoretarddcpio
dump/restoretarddcpio
dump/restoretarddcpio
fbackup/frecoverdump/restoreftio tarddcpio
backup|restoretarddcpio backup filesystem
Display the boot device
eeprom |grep boot-device prtconf -pv |grep bootpath prtpicl -v|grep ':bootpath'
cat /boot/grub/grub.confcat /etc/lilo.conf
grub = grand unified boot loaderlilo = linux loader
cat /boot/grub/menu.lst setboot bootinfo -b (display last boot device) bootlist -m [normal|service] -o (display bootable devices)
Display the boot device
Setting the boot device
setenv boot-device [|]eeprom boot-device [|] /boot/grub/grub.conf
/etc/lilo.conf
/boot/grub/menu.lst setboot -p setboot -a
# autoboot sequnce setboot -b [on|off]
bootlist -m normal hdisk0 hdisk1
Setting the boot device
Creating boot device (MBR)installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk
grub-install lilo -v
grub-install mkboot -l
Note: we are treating the disk as a LVM device
bosboot -a (uses default device)bosboot -ad hdisk1 Creating boot device (MBR)
Format floppy drivefdformat -v -Uvolcheck -vnewfs -v /vol/disk/aliases/floppy0
floppy --probe (use device obtained below ) floppy --createrc > /etc/fd0floppy --format /dev/fd0mkfs /dev/fd0
n/a n/a format -d /dev/rfd0format -d /dev/fd0.18 (high format) Format floppy drive
mount/unmount floppy volrmmount -l floppy0eject floppymount /dev/fd0 /mnt/floppyumount /mnt/floppy
n/a n/a mount /dev/rfd0 /floppy mount/unmount floppy
mount/unmount CDROM
mount -F hsfs -o ro /cdrom/cdrom0umount /cdrom/cdrom0
/etc/init.d/volmgr starteject cdrom
mount -rt iso9660 /dev/cdrom /mnt/cdromumount /mnt/cdromeject cdrom
mount -rt iso9660 /dev/cdrom /mnt/cdromumount /mnt/cdromeject cdrom
mount -rF cdfs /dev/dsk/c1t6d0 /cdrom
start: /usr/sbin/pps_mountdpps_mount
mount -v cdrfs -r /dev/cd0 /cdromumount /cdrom
mount/unmount CDROM
mount/umount ISO image
lofiadm -a /dev/lofi/1mount -F hsfs -o ro /dev/lofi/1 /mnt
# to listlofiadm
remount a filesystem
n/a mount -o remount,rw / mount -o remount,rw / mount_vxfs -o remount,ro mount -o remount,rw
Note:I did find a note that it should be possible to remounta jfs2 filesystem, but it did not work on my system
remount a filesystem
create boot disk orrecovery tape
n/a mkbootdisk `uname -r` (boot diskette) n/a recovery tape (preview)make_tape_recovery -v -l -x inc_entire=vg00/opt/ignite/bin/make_recovery -ACv
mksysbcreate boot disk or recovery tape
boot cdrom/diskette (singleuser)
ok> boot cdrom -s using the grub window append the word single tothe kernel line
using the grub window append the word single tothe kernel line
enter PDC> search >boot p1 (cdrom) interact with IPL? YISL> hpux -is
based on a 9114-275 workstation
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 yourconsole.
4. Choose default boot list when the maintenancescreen comes up.
boot cdrom/diskette (single user)
ok> boot -as f10 or f12 f10 or f12 >boot pri interact with IPL? Y
based on a 9114-275 workstation
boot into maintenace mode
ISL> hpux -lm 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 yourconsole.
4. Choose select boot options when themaintenance screen comes up, then option 1, thenoption 1 for scsi, then option 3 service mode boot
boot into maintenace mode
Device paths
floppy:
disk:/dev/dsk/c0t0d0s0
tape:/dev/rmt/0ucb
cdrom:/dev/dsk/c0t6d0s0/dev/scd0 (external usb cd)
floppy:/dev/fd0
disk:/dev/hda or /dev/sda /dev/hdb or /dev/sdb
tape:
cdrom:/dev/hda (depends on number of IDE disks)
floppy:/dev/fd0
disk:/dev/hda or /dev/sda /dev/hdb or /dev/sdb
tape:
cdrom:/dev/hda (depends on number of IDE disks)
floppy:n/a
disk:/dev/dsk/c0t6d0
tape:/dev/dsk/rmt/0
cdrom:/dev/dsk/c1t6d0
floppy:/dev/fd0/dev/rfd0
disk:/dev/hdisk0
tape:
cdrom:/dev/cd0
Device paths
update /dev directory
drvconfigdevlinksdisks|tapes|ports
devfsadm ( solaris 8, 9, 10)
/dev/MAKEDEV /dev/MAKEDEV insf -C tape (Class)
insf -H 0.1.0 -e (recreate deleted link)
cfgmgrcfgmgr -l scsi0
mkdevupdate /dev directory
remove or change a device
rem_drv # remove all devices from a hardward path rmsf -k -H 52.6.0
rmdevrmdev -l cd0
chdevchdev -l rmt0 -a ret=no
remove or change a device
list device drivers
prtconf -D sysdef
cat /proc/devices cat /proc/devices lsdevlsdevlsdev -Cc disklsdev -Cc disk -p scsi0
lsslot -c pci -l ent0
lscfglscfg -l ent0lscfg -vl fcs0 (find the WWN of HBA adapter)
lspath -l hdisk0
getconf DISK_SIZE hdisk1 (detailed)
list device drivers
Networking
Solaris Red Hat Ubuntu/Debian HP AIX Basic network information (hostname, ip address)
/etc/hostname.hme0 /etc/sysconfig/network/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/network/interfaces /etc/rc.config.d/netconf stores information in the ODM (Object Database Manager) Basic network information (hostname, ip address)
displaying network interfaces
prtdiag -v ifconfig -a
kstat hme:0:parameters: kstat e1000g:0:parameters:
module:instance:name:statistics
# Solaris 11 netadm list
dladm show-physdladm show-linkdladm show-linkpropdladm show-vnicdladm show-etherstub
ipadm show-ifipadm show-ifprop ipadm show-addripadm show-addrprop
ifconfigsystem-config-network (GUI)
ifconfig ioscan -funC lan (list hardware) lanscan -v (list configured)ifconfig lan0 (individual)
ifconfig -a
entstat -d
lsdev -Cc iflsdev -Cc tcpip
odmget -q "name=en0" CuAt
lsattr -EHl en0 displaying networkinterfaces
ifconfigifconfig ifconfig ifconfig
mktcpip (completely setup a network interface)
Configure network interface
# Solaris 11 - Automatic (using profiles) netadm enable -p ncp Automaticnetcfg (use by Automatic)
# Solaris 11 - Manualnetadm enable -p ncp DefaultFixednetcfg
dladm create-vnicdladm delete-vnic dladm rename-link
dladm create-etherstub
ipadm create-ip net1 ipadm create-addr -T static -a 192.168.0.110/24 net1/pfv ipadm delete-ipipadm delete-addr
rmtcpip (remove all network interfaces)
# configure an interfacemktcpip -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 interfaceifconfig en1 detach
ifconfig (configures IP address)
chdev (add aliases to network interface)
Configure networkinterface
Starting and stopping a networkinterface
ifconfig qfe0 upifconfig qfe0 down
/sbin/ifup eth0/sbin/ifdown eth0
/sbin/ifup eth0/sbin/ifdown eth0 ifconfig lan0 up
ifconfig lan0 down
note: there is no "ifconfig -a" in hpux use lanscanthen "ifconfig "
ifconfig en0 upifconfig en0 downifconfig en0 detach (remove) Starting and stopping anetwork interface
Setting NIC speed
ndd -set (dynamically) /etc/system (edit and update then reboot - permanent)
mii-tool -F 100baseTx-FD eth0ethtool -s eth1 speed 100 duplex full
ethtool -s eth1 speed 100 duplex full ndd -set lanadmin -X lan0
chdev -l ent0 -a media_speed=1000_Full_Duplex -Pchdev -l ent0 -a media_speed=Auto_Negotiation -P
Note:entX - physical deviceenX - frame type run on entX
Setting NIC speed
Change NIC parameters
ndd -get
# List parameters ndd -get /dev/hme \?ndd -get /dev/e1000g0 \?ndd -get /dev/ip \?ndd -get /dev/tcp \?
mii-tool -v ethtool eth1ethtool -t eth0 online
sysctl -a | grep net*
ethtool eth0
sysctl -a |grep net*lanadmin -> lan -> display
## options supported ndd -get /dev/ip ?ndd -get /dev/tcp ?ndd -get /dev/arp ?ndd -get /dev/udp ?
netstat -ventstat -d
no -ano -o "ipforwarding=1"
NIC speeds or Parameters
Display NIC statistics netstat -i [-I interface]
netstat -snetstat -i [-f inet] netstat -s entstat -d
Display network statistics
display MAC address ifconfig -a (as user root) ifconfigsystem-config-network (GUI)ifconfig lanscan netstat -ia display MAC address
Displaying network packets
snoop -d tcpdump -i
ethereal (needs to be installed)
tcpdump -i
ethereal (needs to be installed)
nettl -startnettl -status allnettl -tn pduin pduout -e ns_ls_driver -file/var/adm/LANnettl -stop
use netfmt to display the trace file
tcpdump -i iptrace -i ipreport (used with iptrace to view reports)
Note: you must stop the iptrace by using "kill -15"
Displaying networkpackets
default router
/etc/defaultrouter
route add default route -p add default (persist changes)
edit /etc/sysconfig/network
add: GATEWAY=
edit /etc/network/interfaces
add: gateway
/etc/rc.config.d/netconf route add 0
Note: there is no file that holds the default router default router
display routing tablenetstat -rn netstat -rn
route -nnetstat -rnroute -n
netstat -rn netstat -rnnetstat -r -f inetlsattr -EHl inet0 -a route
display routing table
Test IPMP, Bonding
if_mpadm -d (detach)if_mpadm -r (reattach)
tail /var/adm/messages
ifenslave -d bond0 eth1 (detach) ifenslave bond0 eth1 (reattach)
cat /proc/net/bonding/bond0
# create bonding/etc/sysconfig/network-scripts/ifcfg-bond0
# modprobe/etc/modprobe.d/bonding.conf
# for bonding options - use BONDING_OPTS /etc/sysconfig/network-scripts/ifcfg-bond0
# see bonding modecat /sys/class/net/bond0/bonding/mode
ifenslave -d bond0 eth1 (detach) ifenslave bond0 eth1 (reattach)
cat /proc/net/bonding/bond0
You buy an optional product called Auto-PortAggragation.
smitty etherchannel (creates, deletes and tests)
entstat -d ent0
Test IPMP, Bonding
/etc/sysconfig/network /etc/hostname set_parms hostname (requires reboot) hostname
change the hostname
change the following files:
/etc/nodename/etc/hostname./etc/inet/hosts/etc/inet/ipnodes/etc/net - few files in here as well
# Solaris 11svccfg -s system/identity:node listprop config/nodename
svcfg -s system/identity:node setprop config/nodename =astring: hostnamesvcadm refresh system/identity:nodesvcadm restart indentity:node
/etc/hosts
sysctl -a |grep hostname
/etc/hosts
sysctl -a |grep hostname
chdev -l inet0 -a hostname=
change the hostname
setup DNS
/etc/resolv.conf
# Solaris 11 - You need to use the svccfg commandsvccfg -s dns/client listprop config/nameserversvccfg -s dns/client listprop config/searchsvccfg -s name-service/switch listprop config/hostsvccfg -s name-service/switch listprop config/password
svcprop
Note: just use listprop on its own to view all options
svccfg -s "dns/client" setprop "config/nameserver =net_address: (192.168.0.1)"svccfg -s "dns/client" setprop 'config/domain = astring:("datadisk.co.uk")' svccfg -s "name-service/switch" setprop 'config/host =astring: "file dns"'svcadm refresh name-service/switchsvcadm refresh dns/client
/etc/resolv.conf /etc/resolv.conf /etc/resolv.conf /etc/resolv.conf
setup DNS
Name service switch file (DNSclient)
/etc/nsswitch.conf/etc/resolv.conf
# Solaris 11 - you need to use the svccfg command see above
/etc/nsswitch.conf/etc/host.conf/etc/resolv.conf
/etc/nsswitch.conf/etc/host.conf/etc/resolv.conf
/etc/nsswitch.conf/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)
Name service switch file(DNS client)
Flush DNS cache svcadm restart system/name-service-cache:default ## if installed service nscd restart n/a netcdctrl -t dns -e hosts -f Flush DNS cache
Domain Name/etc/defaultdomain /etc/sysconfig/network (HOSTNAME option)
/etc/resolv.conf
Note: for NIS use the NISDOMAIN option
/etc/host/etc/resolv.conf
/etc/rc.config.d/netconf domainname Domain Name
Obtain IP Address routing route -n get tracerouteip route get traceroute
ip route get traceroute
n/a route -n get Obtain IP Address routing
Find Services on the network
Boot (jumpstart) servers:rpcinfo -b bootparam 1
NFS servers:rpcinfo -b mountd 1
NIS servers/slaves:rpcinfo -b ypserv 1
Boot (jumpstart) servers:rpcinfo -b bootparam 1
NFS servers:rpcinfo -b mountd 1
NIS servers/slaves:rpcinfo -u ypserv
Boot (jumpstart) servers:rpcinfo -b bootparam 1
NFS servers:rpcinfo -b mountd 1
NIS servers/slaves:rpcinfo -u ypserv
Boot (jumpstart) servers:rpcinfo -b bootparam 1
NFS servers:rpcinfo -b mountd 1
NIS servers/slaves:rpcinfo -b ypserv 1
Boot (jumpstart) servers:rpcinfo -b bootparam 1
NFS servers:rpcinfo -b mountd 1
NIS servers/slaves:rpcinfo -b ypserv 1
Find Services on thenetwork
Crash Dump
Solaris Red Hat Ubuntu/Debian HP AIX
Crash Dump
dumpadm -d coreadm
crash (used toanalyse crash dumps)adb (used to analysecrash dumps)
diskdumpnetdumpkdump (part of kexec rpm)
/etc/kdump.conf (select where youwant the dump to go) service kdump startchkconfig kdump on
## to crash the systemecho "c" > /proc/sysrq-trigger
diskdumpnetdumpkdump (part of kexec rpm)
/etc/kdump.conf (select where youwant the dump to go) service kdump startchkconfig kdump on
## to crash the systemecho "c" > /proc/sysrq-trigger
edit /stand/system
add either:dump 2/0/1.5.0dump lvoldump none
# crash config file/etc/rc.config.d/savecrash
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 -P
# analyse dump fileecho "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0
Crash Dump
crash (used to analyse crash dumps) crash (used to analyse crash dumps)
Performance Monitoring and Diagnostics
Solaris Red Hat Ubuntu/Debian HP AIX
CPU
top (sunfreeware)prstat sarmpstatw (load average)uptime (load average) psvmstat
topsarmpstatw (load average)uptime (load average) psvmstatprocinfooprofilecat /proc/cpuinfo
topsarmpstatw (load average)uptime (load average) psvmstatprocinfocat /proc/cpuinfo
topsarw (load average)uptime (load average) psvmstatglancesam
topas -Ptopas -L (logical partitions) mpstatsar -c w (load average)uptime (load average) lparstatpsiostat -tT 1tprofcurt
CPU
Memory
prstatvmstattopsar
freevmstattopprocinfoslabtopsarcat /proc/meminfo
freevmstattopprocinfoslabtopsarcat /proc/meminfo
topvmstatsarsamglance
topasvmstatsar -bsvmonpsipcs -alockstat (version 4) rmss
Memory
Network
nddnetstatlsofsnooproute
ethtoolmii-toolnetstatlsoftcpdump ipiptrafnmap
ethtoolmii-toolnetstatlsoftcpdump ipiptraf
netstatlanadminsamglance
[ent|tok|fddi|atm]statnetstatnetpmon (trcstop to stoptrace) Network I/O
Disk
sar -diostatvmstatlsof
sar -diostatvmstatlsof
sar -diostatvmstatlsof
iostatsarsam glance
topas -D (disk)topas -F (filesystem) iostatsar -D fcstat (fibre)lvmstatfilemon (trcstop to stop) fileplace
# disk stat history chdev -l sys0 -a iostat=truelsattr -HEl sys0 -a iostat
Disk I/O
Application
truss -p ppriv -D -e
strace -p strace -p download and install tusc
tusc -p topastrusssar probevuetprofsvmon -P
Application
NFS nfsstat nfsstat nfsstat nfsstat nfsstat NFS
Process
topprstatps -ef pargs pcred pfiles pflags pgrep pkill pmap pldd preap prun psig pstack pstop ptime ptree pwait pwdx
Kernel Modules and Parameters
Solaris Red Hat Ubuntu/Debian HP AIX
display loaded modules
modinfo cat /proc/modules (more detailed) lsmodmodinfo
Location: /lib/modules/`uname -r`/kernel/drivers
Config:/etc/modprobe.conf/etc/modprobe.d
cat /proc/modules (more detailed) lsmod
Location: /lib/modules/`uname -r`/kernel/drivers
Config:/etc/modprobe.d/options/etc/modprobe.d
kmadmin -k genkex
display loaded modules
load modules modload -p drv/ modprobe insmodmodprobe insmod
kmadmin -L n/a load modules
unload modulesmodunload -i modprobe -r
rmmodmodprobe -r rmmod kmadmin -U
kmadmin -u
n/aunload modules
set kernel parameters(tuning)
/etc/system (edit and reboot) /etc/sysctl.conf (edit and update then reboot)sysctl -p
sysctl -w param=value
No reboot (dynamically):echo "250 32000 100 28" > /proc/sys/kernel/semecho "536870912" > /proc/sys/kernel/shmmaxecho "4096" > /proc/sys/kernel/shmmniecho "2097152" > /proc/sys/kernel/shmalletc.............................................
/etc/sysctl.conf (edit and update then reboot)sysctl -p
sysctl -w param=value
No reboot (dynamically):echo "250 32000 100 28" > /proc/sys/kernel/semecho "536870912" > /proc/sys/kernel/shmmaxecho "4096" > /proc/sys/kernel/shmmniecho "2097152" > /proc/sys/kernel/shmalletc.............................................
kcweb (11i) kctune (11i only)rebuild kernel (< 11i see below)
chdev -l sys0 -a =no -a (network)vmo -a (virtual memory) nfso -a (NFS)ioo -a (Input/Ouput) raso -a (reliability, availability, serviceability) schedo -a (processor scheduler)
vi /etc/security/limitscd /etc/tunables
tunchange, tundefault, tunsave, tunrestore, tuncheck
Note: most parameters are dynamically changed in AIX , for examplememory segments are dynamically adjusted
set kernel parameters
display kernelparameters
cat /etc/systemsysdef -i
sysctl -acat /etc/sysctl.conf
cat /proc/sys/kernel/semcat /proc/sys/kernel/shmmaxetc...................................
sysctl -acat /etc/sysctl.conf
cat /proc/sys/kernel/semcat /proc/sys/kernel/shmmaxetc...................................
kctune (11i only)sysdefkmtunekmsystem/usr/sam/lbin/getkinfo -f /stand/vmunix -o/tmp/kernel.data
lsattr -EHl sys0
Note: only a few kernel parameters can be changed display kernel parameters
build kernel
edit and update file then reboot:/etc/system
cd /usr/src/linux-2.5edit Makefile (change EXTRAVERSION)make mrproperbackup .configmake xconfigmake depmake bzImagemake modulesmove new kernelmake modules_installchange lilo/grub config filereboot
cd /stand/build/usr/lbin/sysadm/system_prep -v -s systemedit system file/usr/sbin/mk_kernel -s ./systemmv /stand/system /stand/system.oldmv /stand/vmunix /stand/vmunix.oldmv /stand/build/system /standmv /stand/build/vmunix_test /stand/vmunixreboot
chdev -l sys0 -a =
Note: most parameters are dynamically changed in AIX , for examplememory segments are dynamically adjusted
build kernel
interprocesscommunication
ipcs -a ipcs -a ipcs -a ipcs -a ipcs -a interprocesscommunication
Services
Solaris Red Hat Ubuntu/Debian HP AIX
display servicessvcs -asvcs -l svcs -vx inetadm -l
service --status-all There is no services or chkconfigcommand use the old fashioned way/etc/init.d/
There is no services or chkconfigcommand use the old fashioned way/sbin/init.d/
lssrc -a
display services
start services svcadm enable nfs service nfs start startsrc -s startsrc -g start services
stop services svcadm disable nfs service nfs stop stopsrc -s stopsrc -g stop services
reload service svcadm refresh nfssvcadm clear nfs (changes state)service nfs reload refresh -s reload service
restart service svcadm restart nfs service nfs restart stopsrc -s startsrc -s restart service
service status svcs nfs service nfs staus lssrc -a service statusservice dependencies svcs -d network n/a n/a service dependenciesservice dependants svcs -D network n/a n/a service dependants
# change or add
Service notificationssvccfg
# verify or confirm svcprop
service logging, etc
/var/svc/log/var/svc/manifest/lib/svc/method/etc/svc/repository.db/system/volatile/svc_nonpersist.db
n/a /var/adm/ras/etc/syslog.conf /etc/rc.tcpip service logging, etc
change servicestartup
n/a chkconfig --levels 2345nfs on
n/a change servicestartup
Add a new service
n/a# Create yourstop/start# script in /etc/init.d
chkconfig --add
Patching / Software
Solaris Red Hat Ubuntu/Debian HP AIX
display installed patchesshowrev -ppatchadd -p
swlist -l bundle swlist -l productswlist -l patch
instfix -iadisplay installed patches
adding patch
patchaddpatchadd -M (multiple patches)
patch -p1
zcat patch46.gz | patch -p1
Note: -p = # of path stripping
swcopy (install patch into depot)swinstall (install patch from depot)
Note: the swagentd daemon must be running
instfix -k
adding patch
removing patch patchrm patch -R -p1 swremove installp -r removing patch
display installed packages
pkginfo (all packages)pkginfo -l (single package)pkgchk -l -p (file belongs)
# NEW IPSpkg list (all packages)pkg info (single package)pkg search (find packages and files)
rpm -qa (all packages)rpm -q (single package)rpm -qf (file belongs)rpm -qi (very detailed)
dpkg -ldpkg -S (search)dpkg -S (file belongs) dpkg -s (status)dpkg -p (detailed)
swlist -l bundle swlist -l product
## check a packageswlist -s
lslpp -L all (all filesets)lslpp -L (single fileset) lslpp -w (file belongs)lslpp -ha (history of filesets)
rpm -qa (all packages)rpm -q (single package)rpm -qf (file belongs)rpm -qi (very detailed)
oslevel -g (install packkages above os level)
whereis which_fileset
display installed packages
adding package
pkgadd
# NEW IPSpkg installpkg update
rpm -Uhv (updates/installs if not already)rpm -ihv (install)
dpkg -i swinstallswinstall -s installp -a
installp -c (cleanup after failed install)
rpm -i
geninstall (generic installer: installp, RPM, etc)
adding package
removing packages
pkgrm
# NEW IPSpkg uninstall
rpm -e dpkg -r (do not remove config files)dpkg -P (remove config files)
swremoveinstallp -u (commited packages) installp -r (applied packages)
rpm -e
geninstall -u
removing packages
verify package
pkginfo -lpkginfo -p
# NEW IPSpkg publisher pkg verify
rpm -V n/a swverity (see /var/adm/sw/swagent.log) lppchk -v
rpm -V verify package
List files in package
pkgchk -l | grep -i pathname
# NEW IPSpkg contents
rpm -ql dpkg -L (list files) swlist -l file lslpp -f
rpm -ql List files in package
# NEW IPSpkg history
Other package commandspkg purge-historypkg freezepkg unfreeze pkg fixpkg refreshpkg publisher
Package directory
/var/sadm /var/lib/rpm /var/lib/dpkg/info /var/adm/sw/usr/lpp
/var/lib/rpmPackage directory
List libraries required for binaryprogram
ldd ldd ldd chatr ldd List libraries required for binaryprogram
Accounts
Solaris Red Hat Ubuntu/Debian HP AIX
display userscat /etc/passwd
logins -x [-p]
cat /etc/passwdsystem-config-users (GUI)
cat /etc/passwd cat /etc/passwdlogins -x
cat /etc/passwd
lsuser -f ALL (detailed)display users
create a useruseradd
# user defaults /usr/sadm/defadduser
useraddsystem-config-users (GUI) useradd
useraddsam
mkuseruseradd create a user
remove a user userdel userdelsystem-config-users (GUI) userdeluserdelsam
rmuseruserdel remove a user
modify a user usermod usermodsystem-config-users (GUI) usermodusermodsam
chuser -ausermod passwd -fpasswd -schfn chfn
modify a user
change userpassword passwd passwd passwd passwd
passwdpwdadmpwdck -t ALL
change user password
create a group groupadd groupadd groupadd groupadd mkgroup create a groupremove a group groupdel groupdel groupdel groupdel rmgroup remove a groupmodify a goup groupmod groupmod groupmod groupmod chgroup modify a goup
password files /etc/passwd/etc/shadow/etc/passwd/etc/shadow
/etc/passwd/etc/shadow
/etc/passwd/tcb/files/auth/r/root (trusted system) /etc/security/passwd password files
useful usercommands
id -awhoamiwhowfingerlogins -p
id -awhoamiwhowfinger
id -awhoamiwhowfinger
idwhoamiwhowuptime (displays # of users logged in)finger
idwhoamiwhowuptime (displays # of users logged in)finger
# License information lslicensechlicense
# Maximum number of processes for a user lsattr -D -l sys0 -a maxuprocchdev -l sys0 -a maxuproc=
useful user commands
useful groupcommands
groupssetpgrpnewgrp
groups groups groupssetprivgrp
groupssetgroupslsgroup ALL
useful group commands
Password Policy /etc/security/policy.conf/etc/default/passwd/etc/login.defs
Password Aging passwd chage -l chage
NFS
Solaris Red Hat Ubuntu/Debian HP AIX
NFS Daemonsserver: mountd, nfsdclient: statd, lockd
server: rpc.mountd,nfsdclient: rpc.statd, lockd server: rpc.mountd,nfsd
client: rpc.statd, lockd
server: rpc.mountd, nfsdclient: rpc.statd, lockd server: rpc.mountd, nfsd
client: rpc.statd, rpc.lockd
NFS files/etc/dfs/dfstab/etc/dfs/sharetab/etc/rmtab
/etc/exports/var/lib/nfs/etab/var/lib/nfs/xtab
/etc/exports/var/lib/nfs/etab/var/lib/nfs/xtab
/etc/exports/etc/xtab
/etc/exports/etc/xtab
List nfs clients that have a remote mount /etc/rmtab /var/lib/nfs/rmtab /var/lib/nfs/rmtab /etc/rmtab /etc/xtab
display nfs shares dfsharesshowmount -e localhostshowmount -e localhost showmount -e localhost showmount -e localhost exportfs
showmount -e localhost
create nfs share
/etc/dfs/dfstab (edit and add share)share
## dfstab example share -F nfs -d "jumpstart" /export/jumpstart
redhat-config-nfs (GUI)
/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 add share, see below example)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/rc.config.d/nfsconf (edit)/etc/exports (edit and add share)exportfs -a
mknfsexp -d mknfsmnt
shareall
uncreate nfs share
unshare /etc/dfs/dfstab (edit and remove share)
/etc/exports (edit and remove share)/sbin/service nfs reload
/etc/exports (edit and remove share)exportfs -rav (export the shares)
/etc/rc.config.d/nfsconf (edit)exportfs -au (unshare all)exportfs -u /home/vallep /etc/exports (edit and remove share)
rmnfsexp -d (unshares and removes from file)
exportfs -u unshareall
start/change nfs daemons
/etc/init.d/nfs.server start /etc/init.d/nfs.client start
svcadm enable nfs/serversvcadm disable nfs/server
/sbin/service nfs start /etc/init.d/portmap start/etc/init.d/nfs-kernel-server start
/sbin/init.d/nfs.core start/sbin/init.d/nfs.server start/sbin/init.d/nfs.client start
mknfschnfs
startsrc -s nfsdstartsrc -s rpc.mountd
stop nfs daemons/etc/init.d/nfs.server stop/etc/init.d/nfs.client stop
/sbin/service nfs stop /etc/init.d/portmap stop/etc/init.d/nfs-kernel-server stop
/sbin/init.d/nfs.client stop/sbin/init.d/nfs.server stop /sbin/init.d/nfs.core stop
rmnfs
stopsrc -s nfsdstopsrc -s rpc.mountd
nfs status ps -ef|grep < nfs daemons> /sbin/service nfs status /etc/init.d/nfs-kernel-server status ps -ef | grep lssrc -a |grep -i nfsnfs reload shareall /sbin/service nfs reload exportfs -rav (export the shares) exportfs -a exportfs -avnfs performanace nfsstat nfsstat nfsstat nfsstat nfsstat
nfs Optionsn/a cat /var/lib/nfs/etab cat /var/lib/nfs/etab n/a nfso -a
nfso -o =
exportfs (display options)
solaris/redhat mount problems (nfs v3 tov4)
## Make sure you use NFS version 3 mount -F nfs -o vers=3
n/a n/a n/a n/a
NTP
Solaris Red Hat Ubuntu/Debian HP AIX
Time daemons xntpd ntpdntpd xntpd xntpd
Time daemons
ntp setup
# 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
/etc/ntp.conf (edit with ntp servers)dateconfig (GUI)
chkconfig --list ntpdchkconfig --level 2345 ntpd on /sbin/service ntpd start
/etc/default/ntp/etc/ntp.conf
/etc/init.d/ntp [start|stop|restart]
/etc/rc.config.d/netdaemons (set XNTPD to 1) /etc/ntp.conf /etc/ntp.conf
startsrc -s xntpdstopsrc -s xntpd
lslpp -L all|grep xntpd ntp setup
ntp daemon options
/lib/svc/method/xntp /etc/sysconfig/ntpd /etc/default/ntp /etc/rc.config.d/netdaemonsstartsrc -s xntpd -a "-x"
/etc/rc.tcpipntp daemon options
NTP Trace commandsntpq -pntptrace
ntpq -pntptrace
ntpq -pntptrace
ntpq -pntpdate (set the date)
ntpq -pntptracentpdate
NTP Trace commands
Log Files
Solaris Red Hat Ubuntu/Debian HP AIX messages /var/adm/messages /var/log/messages /var/log/messages /var/adm/syslog/syslog.log /var/adm/ras messages
syslog /var/log/syslog /var/log/syslog /var/log/syslog /var/adm/syslog/syslog.log /var/adm/ras syslogmail /var/log/mail /var/log/mail.* /var/adm/syslog/mail.log /usr/spool/mqueue/syslog mailcron /var/cron/log /var/log/cron /var/log/cron.log /var/adm/cron/log /var/adm/cron/log cron
boot /var/adm/messagesdmesg/var/log/bootdmesg
/var/log/bootdmesg
/var/adm/syslog/syslog.logdmesg
/var/adm/ras
alog -o -t bootalog -o -t consolealog -L (list all the logs available)
boot
Error logging logger logger logger logger
/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 (single errorlog report)
errclear (clears errorlog)errclear -d (clears class errors)
errlogger "message upto 230 chars"
Error logging
Security
Solaris Red Hat Ubuntu/Debian HP AIX
Checking the passwd file pwck pwck pwck pwck pwdck -t ALL usrck -t ALL Checking the passwd file
checking the group file grpck grpck grpck grpck grpck checking the group file
console login (allow/deny)
# Solaris 10 (no reboot) /etc/default/login
# Solaris 11 (no reboot)/etc/default/login/etc/user_attr (see below)
rolemod -K type=normal root
# No reboot required /etc/securetty
# No reboot required /etc/securetty
# No reboot required /etc/securetty
Note: you may need to create thisfile if it does not exist
# No reboot required/etc/security/user
chsec -f /etc/security/user -s rootconsole login (allow/deny)
Misc
Solaris Red Hat Ubuntu/Debian HP AIX
startupeeprom
setenv boot-device
grub (GUI)lilo (text based)
grub (GUI) setboot -p setboot -a
# autoboot sequnce setboot -b [on|off]
bootlist -m normal hdisk0 hdisk1
startup
shutdown
shutdown -i5 -g0 -y (power down)shutdown -i6 -g0 -y (reboot)shutdown -i0 -g0 -y (OK prompt)
reboot -- -r (reboot/reconfigure)
touch /reconfigure
shutdown -h (halt)shutdown -r (reboot)shutdown -f (fast reboot no fsck)shutdown -F (force fsck)
shutdown -h (halt)shutdown -r (reboot)shutdown -P (power off)
touch /forcefsck
# edit /etc/default/rcS change below so # you dont have to hang around FSCKFIX=yes
shutdown -h now (halt)shutdown -r now(reboot)
shutdown -F (fast shutdown) shutdown -Fr (fast shutdown and reboot)
shutdown
Change run level
haltinitpoweroffrebootshutdowntelinituadmin
haltinitpoweroffrebootshutdowntelinit
haltinitpoweroffrebootshutdowntelinit
initrebootshutdown
initshutdownreboot telinithalt
Change run level
init status0123456
0 - shutdown1 - single user2 - n/a3 - Multi-user4 - n/a5 - power off6 - reboot
# change defaultvi /etc/inittab
0 - halt1 - single user2 - multiuser (no networking)3 - multiuser (networking)4 - unused5 - GUI6 - reboot
# change defaultvi /etc/inittab
0 - halt1 - single user2 - 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
0 - halt1 - single users2 - multiuser (networking)3 - multiuser (networking, NFS, and CDE GUI) (default) 4 - multiuser (netwrking, NFS, and VUE GUI)5 - n/a6 - n/a
# change default - change the initdefault line vi /etc/inittab
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
init status0123456
Startup options
boot
# Options-s single user-a interactive-x no device drivers (used inclustering) -r reconfigure devices-m milestone
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 networkemergency: root fs read-only, no init files run rescue: use cd-rom/network, root mounted as/mnt/sysimage
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 networkemergency: root fs read-only, no init files run rescue: use cd-rom/network, root mounted as/mnt/sysimage
interact with IPL? Y
# single user ISL> hpux -is
# Logical volume maintanence mode ISL> hpux -lm
# No quroum checkISL> hpux -lq
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 1after the word keyboard but before the wordspeaker
Startup options
startup scripts
/etc/init.d
/etc/rc0.d - /etc/rc6.d
/etc/init.d
/etc/rc0.d - /etc/rc6.d
/etc/init.d
/etc/rc0.d - /etc/rc6.d
/sbin/init.d/etc/rc.config.d (startup config files)
/sbin/rc0.d - /sbin/rc6.d
/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
startup scripts
boot promptcommands
bootprintenvsetenvbannerdevaliasshow-devsshow-pci-devs-all probe-scsi-allprobe-fcal-allprobe-pci watch-net-allreset-all
F10 or F12 F10 or F12 interact with IPL? YBased 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 1after the word keyboard but before the wordspeaker
boot prompt commands
Boot process
Phases:
Boot PROM: displays systeminformation, run POST, loadbootblk, locate ufsbootBoot Programs: bootblk loadsand executes the ufsbootKernel Initialization: ufsbootloads and executes the corekernel, initializes core kerneldata structures, loads otherkernel modules based on the/etc/system file, starts/sbin/init programinit: starts other processesbased on the /etc/inittab file
Boot sequence
1. BIOS2. POST3. Master Boot Record (MBR) - point to the
bootloader GRUB or LILO4. GRUB (stage 1) - point to GRUB stage 1_55. GRUB (stage 1_5) - deals with specific
filesystem types look at /boot/grub/*1_5 files6. GRUB (stage 2) reads /etc/grub.conf and
displays the grub menu, it specifies the kerneland the initrd files
7. KERNEL - control given to the kernel8. INIT - reads /etc/inittab and runs
/etc/rc.d/rc.sysinit script
Boot sequence
1. BIOS2. POST3. Master Boot Record (MBR) - point to the
bootloader GRUB or LILO4. GRUB (stage 1) - point to GRUB stage 1_55. GRUB (stage 1_5) - deals with specific
filesystem types look at /boot/grub/*1_5files
6. GRUB (stage 2) reads /boot/grub/menu.lstand displays the grub menu, it specifies thekernel and the initrd files
7. KERNEL - control given to the kernel8. INIT - runs the /etc/event.d/rc-default script
Phases:
1. PDC - processor-dependent code; executes andperforms self-tests
2. ISL - initial system loader; loads the secondarysystem loader hpux
3. HPUX - is the secondary system loader and loadsthe kernel /stand/vmunix, then hands over tothe kernel
4. KERNEL - swapper processes are started by thekernel then starts the init process
5. INIT - reads /etc/inittab
Phases:
Read Only Storage (ROS): check thesystem board, perform POST, locate andload boot image, begin systeminitialization and execute phase 1 of the/etc/rc.boot scriptBase Device Configuration: startconfiguration manager to configue basedevicesSystem Boot: start init process phase 2,switch to hard-disk root filesystem, startother processes defined by /etc/inittaband execute phase 3 of the /etc/rc.bootscript
Boot process
Boot Environments(BE)
bootadm list-archivebootadm update-archivebootadm list-menu bootadm set-menu
beadm createbeadm renamebeadm activatebeadm listbeadm destroy
determine the runlevel
who -r runlevelwho -r
runlevelwho -r
who -r who -r determine the run level
obtain default runlevel
cat /etc/inittab cat /etc/inittab /etc/event.d/rc-default /etc/inittab /etc/inittab obtain default run level
list locale locale -a locale -a locale -a locale -a locale -a list locale
start xwindows n/a startx (shorthand of below)initx (lots of parms) n/a n/a start xwindows
initialize systemsys-unconfig set_parms [initial|hostname|ip_address|timezone]
Note: set_parms is in /sbin
install_assistinitialize system
Timezone /etc/TIMEZONE/etc/default/init/etc/sysconfig/clock/usr/share/zoneinfo/zone.tab
/etc/timezone/usr/share/zoneinfo/zone.tab
/etc/TIMEZONE /etc/environment/etc/profile Timezone
Recommended