AIX Learning, copied from the web, credit and References* Below to the original authors/webistes/wikipedia/Google/IBM.
IBM-AIX
Company / developer IBM
Programmed in C
OS family Unix
Working state Current
Source model Closed source
Initial release 1986
Latest stable release 7.1 TL1 / October, 2011
Marketing target Workstation, Server
Available language(s) English
Available programming languages(s) C
Supported platforms ROMP, IBM POWER, PowerPC, IBM PS/2, System/370, ESA/390
Kernel type Dynamic Extendable
Default user interface Common Desktop Environment,
(KDE and GNOME optional)
License Proprietary
Official website IBM AIX
http://www.opengroup.org/openbrand/register/
AIX (Advanced Interactive eXecutive, pronounced "a i ex") is a series of proprietary Unix operating systems developed and sold by IBM for several of its computer platforms. Originally released for the IBM 6150 RISC workstation, AIX now supports or has supported a wide variety of hardware platforms, including the IBM RS/6000 series and later IBM POWER and PowerPC-based systems, IBM System i, System/370 mainframes, PS/2 personal computers, and the Apple Network Server. AIX is based on UNIX System V with 4.3BSD-compatible extensions. It is one of four commercial operating systems that are presently certified to The Open Group's UNIX 03 standard. (The others are Mac OS X, Solaris and HP-UX.)
Common Unix Commands
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
Server Release info | cat /etc/release | cat /etc/enterprise-release cat /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 |
model |
prtconf | grep -i 'System Model' | Server type |
Hardware Info | prtdiag -v prtpicl -v [-c <class>] prtconf -D |
lspci Note: hal = hardware abstraction layer |
lspci lsusb lshal |
ioscan /opt/ignite/bin/print_manifest |
lscfg -v lsdev lsslot -c [pci|phb|port] 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 -v prtconf | grep -i mem |
cat /proc/meminfo (detailed) cat /proc/slabinfo |
cat /proc/meminfo (detailed) cat /proc/slabinfo |
dmesg | grep -i physical cat /var/opt/ignite/local/manifest/manifest.info |
prtconf -m prtconf |grep -i memory lsattr -El sys0 -a realmem bootinfo -r |
Memory |
CPU (type, number, etc) |
/usr/platform/`uname -i`/sbin/prtdiag -v ## display,offline,online |
cat /proc/cpuinfo (detailed) | cat /proc/cpuinfo (detailed) |
/opt/ignite/bin/print_manifest cat /var/opt/ignite/local/manifest/manifest.info |
prtconf |grep -i processor | CPU (type, number, etc) |
Disk Drives |
format format -e (to convert EFI (zfs) to SMI) Note: |
fdisk -l sfdisk -l (advanced server) parted <device> print partprobe -s <device> |
fdisk -l sfdisk -l (advanced server) parted <device> print partprobe <device> |
ioscan -funC disk | lsdev -Cc disk lsdev -Cc disk -p scsi0 (specific controller) lsdev -Cc disk -S [a|d|s] (available, defined, stopped) lscfg -v -l hdisk0 |
Disk Drives |
Kernel File and associated directories |
/kernel/genunix |
/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 -a uname -m getconf -a |grep -i 'long_bit' |
uname -a uname -m getconf -a |grep -i 'long_bit' |
getconf KERNEL_BITS ( version 11)
|
prtconf -k bootinfo -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: |
prtconf |grep -i firmware lscfg -pv invscout |
Display Firmware |
Display IRQ, IO ports and DMA | n/a | /proc/interrupts /proc/ioports /proc/dma |
/proc/interrupts /proc/ioports /proc/dma |
n/a | prtconf | Display IRQ, IO ports and DMA |
GUI admin tool | admintool | linuxconf | linuxconf | sam | smit smitty |
GUI admin tool |
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
Memory | /usr/platform/`uname -i`/sbin/prtdiag -v prtconf | grep -i mem |
cat /proc/meminfo (detailed) free -om |
cat /proc/meminfo (detailed) free -om |
dmesg | grep -i physical cat /var/opt/ignite/local/manifest/manifest.info |
prtconf -m prtconf |grep -i memory lsattr -El sys0 -a realmem bootinfo -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 | pagesize pagesize -a (display all supported pagesizes) |
page size (memory) |
display swap | swap -l swap -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 |
device: |
device: create partition with fdisk (type 82) file(create 50MB swap file): dd if=/dev/zero of=/var/swapfile bs=1024 count=50000 mkswap <device>|<file> swapon <device>|<file> update /etc/fstab |
Create logical volume or filesystem 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. |
mkps -a -s 4 -n <volume group> # 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 |
adding swap |
removing swap | update /etc/vfstab swap -d |
swapoff <device>|<file> Remove device or file as normal |
swapoff <device>|<file> Remove device or file as normal |
remove entry from /etc/fstab reboot |
swapoff /dev/paging00 rmps paging00 Note: paging space must be deactiviated before removing |
removing swap |
Disks, Filesystems and Devices
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
Disk Drives |
format format -e (to convert EFI (zfs) to SMI) Note: |
fdisk -l sfdisk -l (advanced server) parted <device> print partprobe <device> |
fdisk -l sfdisk -l (advanced server) parted <device> print partprobe <device> |
ioscan -funC disk | lsdev -Cc disk lsdev -Cc disk -p scsi0 (specific controller) lsdev -Cc disk -S [a|d|s] (available, defined,stopped) lscfg -v -l hdisk0 |
Disk Drives |
Disk serial Number, type, etc | format iostat -En luxadm inq <disk> (A5x00 disk arrays) |
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 |
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 |
diskinfo -v /dev/rdsk/c0t4d0 (detailed but no serial number) ## Insure that the online diagnostic support tools have been installed ## Command-Line Support Tools Manager (cstm) |
lscfg -vl hdisk0 lscfg -vl hdisk* |
Disk serial Number, type, etc |
Disk disk partitions | prtvtoc <device> cat /etc/vfstab |
fdisk -l cat /proc/partitions (very high level)
|
fdisk -l cat /proc/partitions (very high level) |
lvlnboot -v /dev/vg00 Note: Boot programs are stored in the boot area in Logical
Interchange Format (LIF), which is similar to a file system. For a
device to be bootable, the LIF volume on that device must contain at
least the ISL |
lsvg -l rootvg cat /etc/filesystems |
Disk disk partitions |
List Raw Partitions | use format to partition the disk then just use the slice as a raw partition, remember to use the character device |
## Old way ## New way, Edit below file |
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 |
Just create a new LVOL without a filesystem - that's it. |
Just create a new LVOL without a filesystem # create a raw volume
|
List Raw Partitions |
Filesystem commands | df -k df -h |
df -k df -h |
df -k df -h |
bdf df [-egiklnvfb] |
df -k lsfs [<filesystem>] lsfs -q <filesystem> (detailed) |
Filesystem commands |
Filesystem (create|remove) | newfs -v <raw device> # Display how the filesystem was created newfs -Nv <filesystem> |
mkfs -t ext3 /dev/sdb1 | 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 chfs -a size=+1G /var (grow by additional 1GB) |
Filesystem (create|remove|resize) |
Tune Filesystems | tunefs fstyp -v <device> |grep -i minfree |
tune2fs # change reserved blocks percentage to 1% |
tune2fs # change reserved blocks percentage to 1% |
tunefs -v <filesystem> vxtunefs -v <filesystem> fstyp -v <filesystem> # Disk fragmentation fsadm -F vxfs -E / (report) fsadm -F vxfs -e / (defrag) |
chfs Note: you can perform the following resize freeze change mountpoint permissions lots more.............................. |
Tune Filesystems |
Force fsck | # Check to see filesystem needs checking fstyp -v <filesystem> | grep fsclean |
touch /forcefsck shutdown -Fr now tune2fs -l /dev/sdb<?> |grep -i 'filesystem state' |
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 |
# Look at the second line to see if a filesystem |
n/a | Force fsck |
backup filesystem | ufsdump|ufsrestore tar dd cpio |
dump/restore tar dd cpio |
dump/restore tar dd cpio |
fbackup/frecover dump/restore ftio tar dd cpio |
backup|restore tar dd cpio |
backup filesystem |
Display the boot device | eeprom |grep boot-device prtconf -pv |grep bootpath prtpicl -v|grep ':bootpath' |
cat /boot/grub/grub.conf grub = grand unified boot 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 [<device>|<alias>] eeprom boot-device [<device>|<alias>] |
/boot/grub/grub.conf
|
/boot/grub/menu.lst | setboot -p <primary path> setboot -a <alternate path> # 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 <raw-device> | grub-install <raw-device> lilo -v |
grub-install <raw-device> | mkboot -l <device> Note: we are treating the disk as a LVM device |
bosboot -a (uses default device) bosboot -ad hdisk1 |
Creating boot device (MBR) |
Format floppy drive | fdformat -v -U volcheck -v newfs -v /vol/disk/aliases/floppy0 |
floppy --probe (use device obtained below ) floppy --createrc > /etc/fd0 floppy --format /dev/fd0 mkfs /dev/fd0 |
n/a | n/a | format -d /dev/rfd0 format -d /dev/fd0.18 (high format) |
Format floppy drive |
mount/unmount floppy | volrmmount -l floppy0 eject floppy |
mount /dev/fd0 /mnt/floppy umount /mnt/floppy |
n/a | n/a | mount /dev/rfd0 /floppy | mount/unmount floppy |
mount/unmount CDROM | mount -F hsfs -o ro <device path> /cdrom/cdrom0 umount /cdrom/cdrom0 /etc/init.d/volmgr start eject cdrom |
mount -rt iso9660 /dev/cdrom /mnt/cdrom |
mount -rt iso9660 /dev/cdrom /mnt/cdrom umount /mnt/cdrom eject cdrom |
mount -rF cdfs /dev/dsk/c1t6d0 /cdrom start: /usr/sbin/pps_mountd |
mount -v cdrfs -r /dev/cd0 /cdrom umount /cdrom |
mount/unmount CDROM |
remount a filesystem | n/a | mount -o remount,rw / | mount -o remount,rw / | mount_vxfs -o remount,ro <filesystem> |
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 |
remount a filesystem |
create boot disk or recovery 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 |
mksysb | create boot disk or recovery tape |
boot cdrom/diskette (single user) | ok> boot cdrom -s | using the grub window append the word single to the kernel line | using the grub window append the word single to the kernel line | enter PDC > search >boot p1 (cdrom) interact with IPL? Y ISL> hpux -is |
based on a 9114-275 workstation
|
boot cdrom/diskette (single user) |
boot into maintenace mode | ok> boot -as | f10 or f12 | f10 or f12 | >boot pri interact with IPL? Y ISL> hpux -lm |
based on a 9114-275 workstation
|
boot into maintenace mode |
Device paths | floppy:
disk: |
floppy: disk: tape: cdrom: |
floppy: disk: tape: cdrom: |
floppy: disk: tape: cdrom: |
floppy: disk: tape: cdrom: |
Device paths |
update /dev directory | drvconfig devlinks disks|tapes|ports devfsadm ( solaris 8, 9, 10) |
/dev/MAKEDEV <device> | /dev/MAKEDEV <device> |
insf -C tape (Class) insf -H 0.1.0 -e (recreate deleted link) |
cfgmgr mkdev |
update /dev directory |
remove or change a device | rem_drv | # remove all devices from a hardward path rmsf -k -H 52.6.0 |
rmdev rmdev -l cd0 chdev chdev -l rmt0 -a ret=no |
remove or change a device | ||
list device drivers | prtconf -D sysdef |
cat /proc/devices | cat /proc/devices | lsdev |
lsdev lsslot -c pci -l ent0 |
list device drivers |
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 kstat e1000g:0 |
ifconfig system-config-network (GUI) |
ifconfig | ioscan -funC lan (list hardware) lanscan -v (list configured) ifconfig lan0 (individual) |
ifconfig -a entstat -d <interface> lsdev -Cc if lsdev -Cc tcpip odmget -q "name=en0" CuAt lsattr -EHl en0 |
displaying network interfaces |
Configure network interface | ifconfig | ifconfig | ifconfig | ifconfig <interface> |
mktcpip (completely setup a network interface) # configure an interface # remove an interface |
Configure network interface |
Starting and stopping a network interface | ifconfig qfe0 up ifconfig qfe0 down |
/sbin/ifup eth0 /sbin/ifdown eth0 |
/sbin/ifup eth0 /sbin/ifdown eth0 |
ifconfig lan0 up note: there is no "ifconfig -a" in hpux use lanscan then "ifconfig <interface>" |
ifconfig en0 up |
Starting and stopping a network interface |
Setting NIC speed | ndd -set <device> <parm> <value> (dynamically) /etc/system (edit and update then reboot - permanent) |
mii-tool -F 100baseTx-FD eth0 ethtool -s eth1 speed 100 duplex full |
ethtool -s eth1 speed 100 duplex full | ndd -set <device> <parm> <value> lanadmin -X <option> lan0 |
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 |
Setting NIC speed |
Change NIC parameters |
ndd -get <device> <parm> |
mii-tool -v |
ethtool eth0 sysctl -a |grep net* |
lanadmin -> lan -> display |
netstat -v |
NIC speeds or Parameters |
Display NIC statistics | netstat -i [-I interface] netstat -s |
netstat -i [-f inet] netstat -s entstat -d <interface> |
Display network statistics | |||
display MAC address | ifconfig -a (as user root) | ifconfig system-config-network (GUI) |
ifconfig | lanscan | netstat -ia | display MAC address |
Displaying network packets | snoop -d <interface> |
tcpdump -i <interface> ethereal (needs to be installed) |
tcpdump -i <interface> ethereal (needs to be installed) |
nettl -start use netfmt to display the trace file |
tcpdump -i <interface> Note: you must stop the iptrace by using "kill -15" |
Displaying network packets |
default router | /etc/defaultrouter route add default <gteway> |
edit /etc/sysconfig/network add: GATEWAY=<IP address> |
edit /etc/network/interfaces add: gateway <IP address> |
/etc/rc.config.d/netconf | route add 0 <gateway IP address> Note: there is no file that holds the default router |
default router |
display routing table | netstat -rn | netstat -rn route -n |
netstat -rn route -n |
netstat -rn | netstat -rn netstat -r -f inet lsattr -EHl inet0 -a route |
display routing table |
Test IPMP, Bonding |
if_mpadm -d (detach) tail /var/adm/messages |
ifenslave -d bond0 eth1 (detach) cat /proc/net/bonding/bond0 |
ifenslave -d bond0 eth1 (detach) cat /proc/net/bonding/bond0 |
You buy an optional product called Auto-Port Aggragation. | smitty etherchannel (creates, deletes and tests) entstat -d ent0 |
Test IPMP, Bonding |
change the hostname |
change the following files: /etc/nodename |
/etc/sysconfig/network /etc/hosts sysctl -a |grep hostname |
/etc/hostname /etc/hosts sysctl -a |grep hostname |
set_parms hostname (requires reboot) | hostname <new hostname> chdev -l inet0 -a hostname=<hostname> |
change the hostname |
setup DNS | /etc/resolv.conf | /etc/resolv.conf | /etc/resolv.conf | /etc/resolv.conf | /etc/resolv.conf | setup DNS |
Name service switch file (DNS client) |
/etc/nsswitch.conf |
/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 <domainname> | Domain Name |
Obtain IP Address routing | route -n get <hostname> traceroute |
ip route get <IP address> traceroute |
ip route get <IP address> traceroute |
n/a | route -n get <hostname> | Obtain IP Address routing |
Find Services on the network |
Boot (jumpstart) servers: NFS servers: NIS servers/slaves: |
Boot (jumpstart) servers: NFS servers: NIS servers/slaves: |
Boot (jumpstart) servers: NFS servers: NIS servers/slaves: |
Boot (jumpstart) servers: NFS servers: NIS servers/slaves: |
Boot (jumpstart) servers: NFS servers: NIS servers/slaves: |
Find Services on the network |
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
Crash Dump |
dumpadm -d <device> crash (used to analyse crash dumps) |
diskdump /etc/kdump.conf (select where you want the dump to go) crash (used to analyse crash dumps) |
diskdump /etc/kdump.conf (select where you want the dump to go) crash (used to analyse crash dumps) |
edit /stand/system add either: # crash config file
|
sysdumpdev -l (list dump destination) sysdumpstart -p (start dump primary) |
Crash Dump |
Performance Monitoring and Diagnostics
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
CPU | top (sunfreeware) prstat sar mpstat w (load average) uptime (load average) ps vmstat |
top sar mpstat w (load average) uptime (load average) ps vmstat procinfo oprofile cat /proc/cpuinfo |
top sar mpstat w (load average) uptime (load average) ps vmstat procinfo cat /proc/cpuinfo |
top sar w (load average) uptime (load average) ps vmstat glance sam |
topas -P |
CPU |
Memory | prstat vmstat top sar |
free vmstat top procinfo slabtop sar cat /proc/meminfo |
free vmstat top procinfo slabtop sar cat /proc/meminfo |
top vmstat sar sam glance |
topas vmstat sar -b svmon ps ipcs -a lockstat (version 4) rmss |
Memory |
Network I/O | ndd netstat lsof snoop route |
ethtool mii-tool netstat lsof tcpdump ip iptraf |
ethtool mii-tool netstat lsof tcpdump ip iptraf |
netstat lanadmin sam glance |
[ent|tok|fddi|atm]stat netstat netpmon (trcstop to stop trace) |
Network I/O |
Disk I/O | sar -d iostat vmstat lsof |
sar -d iostat vmstat lsof |
sar -d iostat vmstat lsof |
iostat sar sam glance |
topas -D (disk) topas -F (filesystem) iostat sar -D fcstat (fibre) lvmstat filemon (trcstop to stop) fileplace # disk stat history chdev -l sys0 -a iostat=true lsattr -HEl sys0 -a iostat |
Disk I/O |
Application | truss -p <pid> | strace -p <pid> | strace -p <pid> | download and install tusc
tusc -p <pid> |
topas |
Application |
NFS | nfsstat | nfsstat | nfsstat | nfsstat | nfsstat |
NFS |
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
display loaded modules | modinfo | cat /proc/modules (more detailed) lsmod Location: |
cat /proc/modules (more detailed) lsmod Location: |
kmadmin -k |
genkex | display loaded modules |
load modules | modload -p drv/<module name> |
modprobe <module> insmod |
modprobe <module> insmod |
kmadmin -L <module name> | n/a | load modules |
unload modules | modunload -i <module number> | modprobe -r <module> rmmod |
modprobe -r <module> rmmod |
kmadmin -U <module name> |
n/a | unload modules |
set kernel parameters (tuning) | /etc/system (edit and reboot) | /etc/sysctl.conf (edit and update then reboot) sysctl -p <filename> sysctl -w param=value |
/etc/sysctl.conf (edit and update then reboot) sysctl -p <filename> sysctl -w param=value |
kcweb (11i) kctune (11i only) rebuild kernel (< 11i see below) |
chdev -l sys0 -a <parameter>=<value> tunchange, tundefault, tunsave, tunrestore, tuncheck |
set kernel parameters |
display kernel parameters | cat /etc/system sysdef -i |
sysctl -a cat /etc/sysctl.conf cat /proc/sys/kernel/sem cat /proc/sys/kernel/shmmax etc................................... |
sysctl -a cat /etc/sysctl.conf cat /proc/sys/kernel/sem cat /proc/sys/kernel/shmmax etc................................... |
kctune (11i only) sysdef kmtune kmsystem /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: |
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 |
cd /stand/build |
chdev -l sys0 -a <parameter>=<value> Note: most parameters are dynamically changed in AIX , for example memory segments are dynamically adjusted |
build kernel | |
interprocess communication | ipcs -a | ipcs -a | ipcs -a | ipcs -a | ipcs -a | interprocess communication |
Solaris 10 |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
display services |
svcs -a |
service --status-all | There is no services or chkconfig command use the old fashioned way /etc/init.d/<service> | There is no services or chkconfig command use the old fashioned way /sbin/init.d/<service> |
lssrc -a | display services |
start services | svcadm enable nfs | service nfs start | startsrc -s <subsystem> startsrc -g <group> |
start services | ||
stop services | svcadm disable nfs | service nfs stop | stopsrc -s <subsystem> stopsrc -g <group> |
stop services | ||
reload service | svcadm refresh nfs | service nfs reload | refresh -s <subsystem> | reload service | ||
restart service | svcadm restart nfs | service nfs restart | stopsrc -s <subsystem> startsrc -s <subsystem> |
restart service | ||
service status | svcs nfs | service nfs staus | lssrc -a | service status | ||
service dependencies | svcs -d network | n/a | n/a | service dependencies | ||
service dependants | svcs -D network | n/a | n/a | service dependants | ||
service logging, etc | /var/svc/log /var/svc/manifest /lib/svc/method |
n/a | /var/adm/ras /etc/syslog.conf /etc/rc.tcpip |
service logging, etc | ||
change service startup | n/a | chkconfig --levels 2345 nfs on | n/a | change service startup | ||
Add a new service | n/a |
# Create your stop/start |
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
display installed patches | showrev -p patchadd -p |
swlist -l bundle swlist -l product swlist -l patch |
instfix -ia | display installed patches | ||
adding patch | patchadd patchadd -M <dir> (multiple patches) |
patch -p1 <patch> zcat patch46.gz | patch -p1 Note: -p = # of path stripping |
Note: the swagentd daemon must be running |
instfix -k | adding patch | |
removing patch | patchrm | patch -R -p1 <patch> | swremove | installp -r | removing patch | |
display installed packages | pkginfo (all packages) pkginfo -l (single package) pkgchk -l -p <file> (file belongs) |
rpm -qa (all packages) rpm -q (single package) rpm -qf (file belongs) rpm -qi <package> (very detailed) |
dpkg -l dpkg -S <search string> (search) dpkg -S <filename> (file belongs) dpkg -s <package> (status) dpkg -p <package> (detailed) |
swlist -l bundle <bundle> swlist -l product <product> ## check a package swlist -s <full_path/software> |
lslpp -L all (all filesets) rpm -qa (all packages) |
display installed packages |
adding package | pkgadd | rpm -Uhv (updates/installs if not already) rpm -ihv (install) |
dpkg -i <package> | swinstall swinstall -s <full_path/software> |
installp -a rpm -i geninstall (generic installer: installp, RPM, etc) |
adding package |
removing packages | pkgrm | rpm -e <package> | dpkg -r <package> (do not remove config files) dpkg -P <package> (remove config files) |
swremove |
installp -u (commited packages) geninstall -u <package> |
removing packages |
verify package |
pkginfo -l |
rpm -V <package> | n/a | swverity <fileset> (see /var/adm/sw/swagent.log) | lppchk -v rpm -V <package> |
verify package |
List files in package | pkgchk -l <package> | grep -i pathname | rpm -ql <package> | dpkg -L <package> (list files) | swlist -l file <product> |
lslpp -f <fileset> rpm -ql <package> |
List files in package |
Package directory | /var/sadm | /var/lib/rpm | /var/lib/dpkg/info | /var/adm/sw |
/usr/lpp /var/lib/rpm |
Package directory |
List libraries required for binary program | ldd <file> | ldd <file> | ldd <file> | chatr <file> | ldd <file> | List libraries required for binary program |
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
display users | cat /etc/passwd logins -x |
cat /etc/passwd system-config-users (GUI) |
cat /etc/passwd | cat /etc/passwd logins -x |
cat /etc/passwd lsuser -f ALL (detailed) |
display users |
create a user | useradd | useradd system-config-users (GUI) |
useradd | useradd sam |
mkuser useradd |
create a user |
remove a user | userdel | userdel system-config-users (GUI) |
userdel | userdel sam |
rmuser userdel |
remove a user |
modify a user | usermod | usermod system-config-users (GUI) |
usermod | usermod sam |
chuser -a usermod passwd -f passwd -s chfn <username> chfn <username><shell> |
modify a user |
change user password | passwd | passwd | passwd | passwd | passwd pwdadm pwdck -t ALL |
change user password |
create a group | groupadd | groupadd | groupadd | groupadd | mkgroup <group name> | create a group |
remove a group | groupdel | groupdel | groupdel | groupdel | rmgroup <group name> | remove a group |
modify a goup | groupmod | groupmod | groupmod | groupmod | chgroup <attribute><group name> | 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 user commands | id -a whoami who w finger |
id -a whoami who w finger |
id -a whoami who w finger |
id whoami who w uptime (displays # of users logged in) finger |
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> |
useful user commands |
useful group commands | groups setpgrp newgrp |
groups | groups | groups setprivgrp |
groups setgroups lsgroup ALL |
useful group commands |
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
NFS Daemons | server: mountd, nfsd client: statd, lockd |
server: rpc.mountd,nfsd client: rpc.statd, lockd |
server: rpc.mountd,nfsd |
server: rpc.mountd, nfsd client: rpc.statd, lockd |
server: rpc.mountd, nfsd |
NFS Daemons |
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 |
NFS files |
List nfs clients that have a remote mount | /etc/rmtab | /var/lib/nfs/rmtab | /var/lib/nfs/rmtab | /etc/rmtab | /etc/xtab | List nfs clients that have a remote mount |
display nfs shares | dfshares showmount -e localhost |
showmount -e localhost | showmount -e localhost | showmount -e localhost | exportfs showmount -e localhost |
display nfs shares |
create nfs share | /etc/dfs/dfstab (edit and add share) share <path> ## 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) |
mknfsexp -d <directory> mknfsmnt shareall |
create nfs share |
uncreate nfs share | unshare <path> /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 <directory> (unshares and removes from file) exportfs -u <filesystem> unshareall |
uncreate nfs share |
start/change nfs daemons |
/etc/init.d/nfs.server start svcadm enable 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 |
mknfs chnfs startsrc -s nfsd startsrc -s rpc.mountd |
start/change nfs daemons |
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 nfsd stopsrc -s rpc.mountd |
stop nfs daemons |
nfs status | ps -ef|grep < nfs daemons> | /sbin/service nfs status | /etc/init.d/nfs-kernel-server status | ps -ef | grep <nfs daemons> | lssrc -a |grep -i nfs | nfs status |
nfs reload | shareall | /sbin/service nfs reload | exportfs -rav (export the shares) | exportfs -a | exportfs -av | nfs reload |
nfs performanace | nfsstat | nfsstat | nfsstat | nfsstat | nfsstat | nfs performanace |
nfs Options | n/a | cat /var/lib/nfs/etab | cat /var/lib/nfs/etab | n/a | nfso -a nfso -o <option>=<value> exportfs (display options) |
nfs Options |
solaris/redhat mount problems (nfs v3 to v4) | ## Make sure you use NFS version 3 mount -F nfs -o vers=3 <mount> <mountpoint> |
n/a | n/a | n/a | n/a | solaris/redhat mount problems (nfs v3 to v4) |
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
Time daemons |
xntpd |
ntpd |
ntpd | xntpd | xntpd | Time daemons |
ntp setup |
# Solaris 8 /etc/rc2.d/xntpd [start|stop] # Solaris 10 |
/etc/ntp.conf (edit with ntp servers) chkconfig --list ntpd |
/etc/default/ntp /etc/init.d/ntp [start|stop|restart] |
/etc/rc.config.d/netdaemons (set XNTPD to 1) /etc/ntp.conf |
/etc/ntp.conf startsrc -s xntpd |
ntp setup |
ntp daemon options | /lib/svc/method/xntp | /etc/sysconfig/ntpd | /etc/default/ntp | /etc/rc.config.d/netdaemons |
startsrc -s xntpd -a "-x" /etc/rc.tcpip |
ntp daemon options |
NTP Trace commands | ntpq -p ntptrace |
ntpq -p ntptrace |
ntpq -p ntptrace |
ntpq -p ntpdate (set the date) |
ntpq -p ntptrace ntpdate |
NTP Trace commands |
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 |
syslog |
/var/log/mail | /var/log/mail.* | /var/adm/syslog/mail.log | /usr/spool/mqueue/syslog |
mail | ||
cron | /var/cron/log | /var/log/cron | /var/log/cron.log | /var/adm/cron/log | /var/adm/cron/log |
cron |
boot | /var/adm/messages dmesg |
/var/log/boot dmesg |
/var/log/boot dmesg |
/var/adm/syslog/syslog.log dmesg |
/var/adm/ras alog -o -t boot alog -o -t console alog -L (list all the logs available) |
boot |
Error logging | logger | logger | logger | logger |
/usr/lib/errdemon -l (display attributes) # use with above errorlog file |
Error logging |
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) | # No reboot required /etc/default/login |
# No reboot required /etc/securetty |
# No reboot required /etc/securetty |
# No reboot required /etc/securetty Note: you may need to create this file if it does not exist |
# No reboot required /etc/security/user chsec -f /etc/security/user -s root |
console login (allow/deny) |
Solaris |
Red Hat |
Ubuntu/Debian |
HP |
AIX |
||
startup |
eeprom setenv boot-device |
grub (GUI) lilo (text based) |
grub (GUI) | setboot -p <primary path> setboot -a <alternate path> # autoboot sequnce setboot -b [on|off] |
bootlist -m normal hdisk0 hdisk1 | startup |
shutdown |
shutdown -i5 -g0 -y (power down) reboot -- -r (reboot/reconfigure) |
shutdown -h (halt) shutdown -r (reboot) shutdown -f (fast reboot no fsck) shutdown -F (force fsck) |
shutdown -h (halt) touch /forcefsck # edit /etc/default/rcS change below so |
shutdown -h now (halt) shutdown -r now(reboot) |
shutdown -F (fast shutdown) shutdown -Fr (fast shutdown and reboot) |
shutdown |
Change run level | halt init poweroff reboot shutdown telinit uadmin |
halt init poweroff reboot shutdown telinit |
halt init poweroff reboot shutdown telinit |
init reboot shutdown |
init shutdown reboot telinit halt |
Change run level |
init status 0 1 2 3 4 5 6 |
# change default |
# change default |
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 |
# change default - change the initdefault line |
# change default - change the initdefault line |
init status 0 1 2 3 4 5 6 |
Startup options | -s single user -a interactive -x no device drivers (used in clustering) -r reconfigure devices -m milestone |
single - use grub to edit kernel line single: runlevel1, local fs mounted, no network |
single - use grub to edit kernel line single: runlevel1, local fs mounted, no network |
interact with IPL? Y # Logical volume maintanence mode |
Based on 9114-275 workstation 1. switch off the machine |
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 also uses the System Resource Controller |
startup scripts |
boot prompt commands |
boot |
F10 or F12 | F10 or F12 | interact with IPL? Y |
Based on a 9114-275 workstation 1. switch off the machine |
boot prompt commands |
Boot process |
Phases:
|
Boot sequence
|
Boot sequence
|
Phases:
|
Phases:
|
Boot process |
determine the run level | who -r | runlevel who -r |
runlevel who -r |
who -r | who -r | determine the run level |
obtain default run level | 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 system | sys-unconfig | set_parms [initial|hostname|ip_address|timezone] Note: set_parms is in /sbin |
install_assist | initialize 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 |
Sysinfo Display system information i.e cpu, memory, etc
Memory and Swap Information regarding the physical memory and swap area
Disks, Filesystems and Devices Displaying disk information, filesystems
Networking Display and configuring network parameters
Crash Dump Configure, display and use the crash dump utiltities
Performance Monitoring and Diagnostics List, Monitor and trace processes
Kernel Modules and Parameters Displaying, modifying and tuning kernel parameters
Services Display, start and stop services
Patching / Packages Installing and removing patches and software packages
Accounts Setting up and removing user accounts
NFS Information on NFS i.e starting, stopping, etc
NTP Network Time Protocol
Log Files Location to common log files
Security Security information
Misc Other stuff i.e shutdown, timezone, run level, etc
AIX Logical Volume Manager (LVM)
This is a quick and dirty cheat sheet on LVM using AIX, I have highlighted many of the common attributes for each command however this is not an extensive list, make sure you look up the command.
First a quick review on some of the terminology that AIX LVM uses
Examples | What it means |
PHYSICAL VOLUME (PV) | Represents a hard disk (hdisk0). |
PHYSICAL PARTITION (PP) | The smallest allocation unit in the LVM. All PPs within a VG are the same size, usually 4 or 8 MB. |
VOLUME GROUP (VG) | A set of one or more PVs which form a single storage pool. You can define multiple VGs on each AIX system. |
LOGICAL VOLUME (LV) | One or more PPs. A file system resides on top of an LV. Only one LV is mapped to a file system. A LV can't span across a VG. Up to 255 LVs in a VG |
LOGICAL PARITITION (LP) | One or more PPs. LP represents a mirrored copy of a PP. Up to two copies of a PP can be mirrored resulting in a LP count of three (2 mirrors plus original). |
Volume Group Descriptor Area (VGDA) |
Information about all the LVs and PVs within a VG. The first 64K
of a PV is reserved for this area - defined in
<sys/bootrecord.h>. The VGDA consists of
|
Volume Group Status Area (VGSA) |
Information about which PPs that are stale and which PVs are missing within a VG. The LVM and SCSI driver reserves somewhere between 7-10% of the available disk space for LVM maps, etc. |
Physical Volume ID (PVID) |
The PVID is an amalgamation of the machine’s serial number (from the systems EPROMs) and the date that the PVID is being generated. This combination insures theextremely low chance of two disks being created with the same PVID. Finally, when a system is booted, the disk configurator goes and looks at the PVID sitting on each disk platter and then compares that to an entry in ODM. If the entry is found, then the disk is given the hdiskX name that is associated with the ODM entry for the PVID. |
Quorum | Quorum is a sort of “sanity” check that LVM uses to resolve possible data confliction and prevent data corruption. Quorum is a method by which 51% or more quorum votes must be available to a volume group before LVM actions can continue. Quorum is issued to a disk in a volume group according to how the disk was created within the volume group. When a volume group consists of one disk, there are two VGDA’s on that disk. Thus, this single disk volume group has a quorum vote of 2. When another disk is added to the volume group with an “extendvg”, then this new disk gets one VGDA, but the original, first disk still retains the two VGDA’s. When the volume group has been extended to three disks, the third disk gets the spare VGDA sitting on the first disk and then each disk has a quorum vote of 1. Every disk after the third disk is automatically given one VGDA, and thus one vote. |
Volume Group ID (VGID) | Just as the PVID is a soft serial number for a disk, the VGID is the soft serial number for the volume group. It is this serial number, not the volume group’s ascii name, which all low level LVM commands reference. Additionally, it is the basis for the LVIDs created on that VGID. |
Logical Volume Control Block (LVCB) | The logical volume control block (lvcb) consists of the first 512 bytes of a logical volume. This area holds important information such as the creation date of the logical volume, information about mirrored copies, and possible mount points in a journaled filesystem. |
Logical Volume ID (LVID) | The LVID is the soft serial number used to represent the logical volume to the LVM libraries and low level commands. The LVID is created from the VGID of the volume group, a decimal point, and a number which represents the order which the logical volume was created on the volume group. |
Now for the cheet sheet
Directory and Files | |
Directories and Files | |
Tools | |
diagnostic | diag - used to hot swap the disk cfgmgr - used mak sure the new disk is seen # to add new disk from the scsi0 controller cfgmgr -l scsi0 |
Create/Remove hard disk | cfgmgr -l scsi0 mkdev -c disk -l <pv> rmdev -dl <pv> |
Physical Volumes | |
display | lspv lspv <pv> (detailed) lspv -l <pv> (list logical volumes) lspv -p <pv> (physical partition usage) |
PVID | chdev -l <pv> -a pv=yes chdev -l <pv> -a pv=clear Note: PVID's are automatically added when the disk is placed into a vg |
adding | chdev -l <pv> -a pv=yes (new) chpv -v a <pv> (adds back the removed disk) |
removing | chpv -v r <pv> |
change physical attributes | chpv -a y <pv> (changes allocatable state to YES) chpv -a n <pv> (changes allocatable state to NO) |
moving | migratepv <old pv> <new pv> |
Volume Groups | |
display | lsvg lsvg <vg> (detailed) lsvg -l <vg> (list all logical volumes in goup) lsvg -p <vg> (list all physical volumes in group) lsvg -o (lists all varied on) lsvg -M <vg> (lists assicated disks and state) ## Details volume group info for the hard disk lqueryvg -Atp <pv> lqueryvg -p <disk> -v (Determine the VG ID# on disk) lqueryvg -p <disk> -L (Show all the LV ID#/names in the VG on disk) lqueryvg -p <disk> -P (Show all the PV ID# that reside in the VG on disk) |
varyon |
varyonvg <vg> varyoffvg <vg> Note: the varyon command activiates the volume goup which means it is available for use |
ODM related | ## Determine if the ODM and VGDA are correct (in sync) getlvodm -u <vg> ## tries to resync VGDA, LV control blocks and ODM synclvodm <vg> ## If the message 0516-366 lsvg: Volume group <vg> is locked is ever seen putlvodm -K `gtlvodm -v <vg>` |
creating | mkvg -y <vg> -s <PP size> <pv> mkvg -y datavg -s 4 hdisk1 Note: the PP size will be the size of the physical partition size you want 4MB, 8MB |
extending | extendvg <vg> <pv> |
reducing | reducevg -d <vg> <pv> ## removes the PVID from the VGDA when a disk has vanished without using the reducevg command reducevg <vg> <PVID> |
removing | varyoffvg <vg> exportvg <vg> Note: the export command nukes everything regardingthe volume goup in the ODM and /etc/filesystems |
checking |
## check to see if underlying disk has grown in size Note: use this command if you are using SAN LUN's that have increased in size |
change volume attributes | ## auto vary on a volume at system start chvg -a y # Turns on/off quorum checking on a volume group chvg -Q [y|n] <vg> |
renaming | varyoffvg <old vg name> lsvg -p <old vg name> (obtain disk names) exportvg <old vg name> import -y <new vg name> <pv> varyonvg <new vg name> mount -a |
importing | importvg -y <vg> <pv> importvg <pv> (will use rootvg as default vg) |
exporting | varyoffvg <vg> exportvg <vg> Note: if the volume has an active paging space this must be turned off before |
Logical Volumes | |
display | lslv <lv> lslv -l <lv> (list all physical volumes in logical volume) lslv -m <lv> (list ppartition mapping) ## Display lv control block information getlvcb -AT <lv> |
creating |
mklv <vg> <# of PP's> <pv> ## Create a mirrored named logical volume |
extending | extendlv <lv> <additonal # of PP's> extendlv <lv> <size of volume in B||M|G> |
reducing/resizing | see filesystem below |
removing | rmlv <lv> |
moving | migratepv -l <lv> <old pv> <new pv> |
adding a mirror to a non-mirrored volume | mklvcopy -s n <lv> <copies 2 or 3> <pv> |
removing a mirror copy from a mirrored volume | rmlvcopy <lv> <copies 1 or 2> rmlvcopy <lv> <copies 1 or 2> <pv> (specified pv) unmirrorvg <vg> <pv> |
synchronize logical volume | syncvg -p <pv> syncvg -v <vg> syncvg -l <lv> |
mirror any unmirrored volumes | mirrorvg <vg> <pv> |
change volume attributes | ## Enable the bad-block relocation policy chlv -b [y|n] <lv> |
renaming | chlv -n <new lv name> <old lv name> |
Miscellaneous | ## Initialises an LV for use as an JFSlog logform </dev/lv> |
Filesystems | |
display | lsfs lsfs -q <fs> (detailed) Note: use the '-q' to see if the logical volume size is bigger than the filesystem size |
create | ## create new filesystem, -A means to mount after restart crfs -v jfs -d <lv> -m <mountpoint> -A yes ## Create logical volume, filesystem, mountpoint, add entry to /etc/filesystems at the specified size crfs -v jfs2 -g <vg> -m <mountpoint> -a size=<size in 512k blocks|M|G) -A yes Note: there are two types of filesystems jfs and jfs2, jfs2 allows you to decrease the filesystem size , you cannot reduce a jfs filesystem |
remove | rmfs <fs> Note: if all filesystems have been removed from a logical volume then the logical volume is removed as well. |
resize |
chfs -a size=<new size> <fs> Note: this will automatically increase or decrease the underlying logical volume as well |
freeze/unfreeze | chfs -a freeze=<time in seconds> <fs> chfs -a freeze=off <fs> |
split mirrored copy | chfs -a splitcopy=<split copy mountpoint>-a copy=2 <fs> chfs -a splitcopy=/backup -a copy=2 /testfs |
change | ## Change the mountpoint chfs -m <new mountpoint> <fs> ## Do not mount after a restart chfs -A no <fs> ## Mount read-only chfs -p ro <fs> |
mount | mount mount [<fs>|<lv>] mount -a mount all |
defrag | defragfs -q <fs> (report defrag status) defragfs -r <fs> (runs in report only mode - no action) defragfs <fs> (actually defrags the filesystem) |
checking and repairing | fsck [-y|-n] <fs> (check a filesystem) fsck -p <fs> (restores primary superblock from backup copy if corrupt) |
Miscellaneous | |
Complete VG, LV and FS with mirroring example |
## Create the volume group ## Create the jfs2 log logical volume and initialize it this for the volume group |
Replaced failed mirror drive | ## break the mirror (two ways to do this) rmlvcopy <lv name> 1 <broken disk> unmirrorvg <lv> <broken pv > ## remove the disk from the vg ## remove the hdisk from ODM ## add back to volume group ## create mirror (two ways to do this) |
Accidently remove a mirrored disk or SAN LUN disappeared off the network |
## This procedure places back a mirror disk that you have accidently pulled or that a SAN LUN disappeared off the network |
References*
#http://www.datadisk.co.uk/html_docs/misc/unix_commands.htm