Common Unix Commands
Swap Sysinfo Services NFS Disk Kernel Modules Networking Patching / Packages Accounts NTP Log Files Security Misc swap Solaris swap -l display swap swap -s Red Hat cat /proc/swaps (detailed) swapon -s HP swapinfo (displayed in KB) swapinfo -m (display in Mb) swapinfo -tm (total / Mb) Create logical volume or filesystem swapon
| -f swapon -p 3 | -f update /etc/fstab Note: -p = priority swap number remove entry from /etc/fstab Information regarding the swap area Display system information i.e cpu, memory, etc Display, start and stop services Information on NFS i.e starting, stopping, etc Displaying disk information i.e type, serial number, etc Displaying and modifing kernel parameters Display and configuring network parameters Installing and removing patches and software packages Setting up and removing user accounts Network Time Protocol Location to common log files Security information Other stuff i.e shutdown, timezone, run level, etc
adding swap
mkfile 5m device: /var/swapfile create partition with fdisk (type 82) swap -a /var/swapfile file: dd if=/dev/zero of=/var/swapfile bs=1024 update /etc/vfstab count=65536 mkswap | swapon | update /etc/fstab
removing
update /etc/vfstab
swapoff |
swap
swap -d Remove device or file as normal
reboot
sysinfo Solaris /usr/platform/`uname r`/sbin/prtdiag -v prtdiag -v prtpicl -v [-c ] prtconf -D /usr/platform/`uname r`/sbin/prtdiag -v prtconf | grep -i mem /usr/platform/`uname r`/sbin/prtdiag -v format prtvtoc Disk Drives format -e (to convert EFI (zfs) to SMI) Disk serial Number, type, etc format iostat -En luxadm inq (A5x00 disk arrays) prtvtoc Disk disk partitions Red Hat HP model uname -a
Server type Hardware Info
lspci lsusb cat /proc/meminfo (detailed) free -om cat /proc/cpuinfo (detailed) dmesg | grep -i physical /usr/sam/lbin/getmem /opt/ignite/bin/print_manifest /opt/ignite/bin/print_manifest sam -> performance monitors -> system properties ioscan -funC disk
Memory
CPU (type, number, etc)
fdisk -l sfdisk -l (advanced server) parted print partprobe hdparm -i /dev/hda hdparm -I /dev/hda (detailed) cat /proc/ide/ide0/hda/model fdisk -l sfdisk -l (advanced server) cat /proc/partitions (very high level)
diskinfo -v /dev/rdsk/c0t4d0 (detailed but no serial number) /opt/ignite/bin/print_manifest (no serial number) lifls -Clv
List Raw Partitions Tune Filesystems
n/a tunefs fstyp -v
raw -qa tune2fs tune2fs -l /dev/sda1
n/a tunefs
Kernel 32 or 64
isainfo -kv (solaris 9+) uname -a isalist (sparc v9 will be listed first) uname -m getconf -a |grep -i 'long_bit'
getconf KERNEL_BITS ( version 11) HPUX < version 11 all 32 bit Note: determine if system supports 64 bit getconf HW_CPU_SUPP_BITS
At the OK prompt type banner
Display Firmware
boot into the BIOS (normally F2 or workstations: F12) reboot enter PDC type: IN (information menu) type: FV (Firmware Version) servers:
truss -p Trace system calls
strace -p
download and install tusc tusc -p
Display IRQ, IO ports and DMA Services
n/a
/proc/interrupts /proc/ioports /proc/dma
n/a
Solaris 10 display services start services stop services reload service restart service service status service dependencies service dependants service logging, etc 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
Red Hat services --status-all service nfs start service nfs stop service nfs reload service nfs restart service nfs staus n/a n/a n/a
HP n/a n/a n/a n/a n/a n/a n/a n/a n/a
/lib/svc/method NFS Solaris server: mountd, nfsd client: statd, lockd NFS Daemons /etc/dfs/dfstab /etc/dfs/sharetab display nfs shares dfshares showmount -e localhost /etc/dfs/dfstab (edit and add share) share showmount -e localhost redhat-config-nfs (GUI) /etc/exports (edit and add share) /sbin/service nfs reload /etc/exports showmount -e localhost cat /etc/xtab (currently exported) /etc/rc.config.d/nfsconf (edit) /etc/exports (edit and add share) exportfs -a Red Hat server: rpc.mountd,nfsd client: rpc.statd, lockd HP server: rpc.mountd, nfsd client: rpc.statd, lockd
create nfs share
uncreate nfs share
unshare /etc/exports (edit and remove share) /etc/rc.config.d/nfsconf (edit) /etc/dfs/dfstab (edit and remove share) /sbin/service nfs reload exportfs -au (unshare all) exportfs -u /home/vallep /etc/exports (edit and remove share) /etc/init.d/nfs.server start /etc/init.d/nfs.client start /sbin/service nfs start /sbin/init.d/nfs.core start /sbin/init.d/nfs.server start /sbin/init.d/nfs.client start
nfs start svcadm enable nfs/server svcadm disable nfs/server nfs stop nfs status nfs reload nfs performanace /etc/init.d/nfs.server stop /etc/init.d/nfs.client stop ps -ef|grep < nfs daemons> shareall nfsstat /sbin/service nfs stop
/sbin/init.d/nfs.client stop /sbin/init.d/nfs.server stop /sbin/init.d/nfs.core stop ps -ef | grep exportfs -a nfsstat cat /etc/rmtab
/sbin/service nfs status /sbin/service nfs reload nfsstat
List nfs clients that have remote mount cat /etc/rmtab Disk
Solaris eeprom Display the boot device
Red Hat cat /etc/grub.conf cat /etc/lilo.conf grub = grand unified boot loader lilo = linux loader
HP setboot
setting the boot device Creating boot device (MBR)
setenv boot-device | eeprom boot-device |
/etc/grub.conf /etc/lilo.conf
setboot -p setboot -a
installboot /usr/platform/`uname i`/lib/fs/ufs/bootblk fdformat -v -U volcheck -v newfs -v /vol/disk/aliases/floppy0
grub-install 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
mkboot n/a
format floppy drive
mount/unmount floppy
volrmmount -l floppy0 eject floppy
n/a mount -rF cdfs /dev/dsk/c1t6d0 /cdrom start: /usr/sbin/pps_mountd pps_mount recovery tape (preview) make_tape_recovery -v -l -x inc_entire=vg00 /opt/ignite/bin/make_recovery -ACv
mount -F hsfs -o ro /cdrom/cdrom0 mount -rt iso9660 /dev/cdrom umount /cdrom/cdrom0 /mnt/cdrom umount /mnt/cdrom mount/unmount CDROM /etc/init.d/volmgr start eject cdrom eject cdrom n/a create boot disk or recovery tape ok> boot cdrom -s boot cdrom/diskette (single user) boot into maintenace ok> boot -as mkbootdisk `uname -r` (boot diskette)
linux single (at the boot prompt) enter PDC > search >boot p1 (cdrom) interact with IPL? Y ISL> hpux -is f10 or f12 >boot pri
mode
interact with IPL? Y ISL> hpux -lm
Kernel Modules Solaris modinfo display loaded modules Location: /lib/modules/`uname -r`/kernel/drivers load modules unload modules modload -p drv/st modunload -i drv/st edit /etc/system reboot modprobe insmod modprobe -r rmmod kmadmin -L kmadmin -U kmadmin -u Red Hat cat /proc/modules (more detailed) lsmod HP kmadmin -k
/etc/sysctl.conf (edit and update then reboot) kcweb (11i) sysctl -p kctune (11i only) rebuild kernel (< 11i see below) sysctl -w param=value No reboot (dynamically): echo "250 32000 100 28" > /proc/sys/kernel/sem echo "536870912" > /proc/sys/kernel/shmmax echo "4096" > /proc/sys/kernel/shmmni echo "2097152" > /proc/sys/kernel/shmall etc.............................................
set kernel parameters
cat /etc/system sysdef -i ipcs -a display kernel parameters
sysctl -a cat /etc/sysctl.conf cat /proc/sys/kernel/sem cat /proc/sys/kernel/shmmax etc................................... ipcs -a
kctune (11i only) sysdef kmtune kmsystem /usr/sam/lbin/getkinfo -f /stand/vmunix -o /tmp/kernel.data
edit and update file then reboot: /etc/system
build kernel
cd /usr/src/linux-2.4 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
cd /stand/build /usr/lbin/sysadm/system_prep -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
Networking Solaris /etc/hostname.hme0 /etc/defaultrouter default router add: GATEWAY= Starting and stopping a network ifconfig qfe0 up ifconfig qfe0 down interface ndd -get ndd -get dev/ip \? (list all params) NIC speeds or Parameters kstat hme:0 ndd -set (dynamically) /etc/system (edit and update then reboot - permanent) if_mpadm -d if_mpadm -r (detach) (reattach) /sbin/ifup eth0 /sbin/ifdown eth0 mii-tool -v ethtool eth1 ethtool -t eth0 online sysctl -a | grep net* Setting NIC speed mii-tool -F 100baseTx-FD eth0 ethtool -s eth1 speed 100 duplex full ifenslave -d bond0 eth1 (detach) ifenslave bond0 eth1 (reattach) cat /proc/net/bonding/bond0 ndd -set lanadmin -X