WPAR¶
Create a WPAR¶
mkwpar -A -g testvg -n kristianwpar01 -r -N address=1.2.3.4
-A
(Start the WPAR each time /etc/rc.wpars runs which is added to /etc/inittab in Global)-g
(Volume group to put filesystems in)-n
(Name of WPAR)-r
(Duplicates network config files from Global (see man wpar))-N
address= (Sets the IP address of WPAR, rest of the values will be taken from Global)
Extra logging/verbosity for mkwpar
¶
export WPAR_SCREEN_LVL=D
export WPAR_LOGFILE_LVL=D
Create a filesystem within WPAR¶
crfs -v jfs2 -g testvg -m /wpars/kristianwpar01/test -A no -a size=1G -a logname=INLINE -u kristianwpar01
-u
(Mount group which is the name of the WPAR. Tells the filesystem to mount when the WPAR starts)
Share a Global filesystem with a WPAR¶
crfs -v namefs -d /sharefs -m /wpars/kristianwpar01/sharefs -u kristianwpar01
-d
(Name of filesystem in Global e.g. /sharefs)
Detailed WPAR status¶
lswpar -L <wpar>
Console log into WPAR¶
clogin <wpar> -l root
Stop WPAR¶
stopwpar -v <wpar>
Start WPAR¶
startwpar -v <wpar>
Remove WPAR¶
rmwpar -Fsv <wpar>
List all WPAR network details¶
lswpar -N
Log into WPAR from GLOBAL when root rlogin=false
¶
GLOBAL# clogin 750wpar1
Remote logins are not allowed for this account.
GLOBAL# chroot /wpars/750wpar1 /usr/bin/ksh
WPAR# chuser rlogin=true root
WPAR# exit
GLOBAL# clogin 750wpar1
fsck JFS filesystems¶
JFS filesystems cannot be fsck'd from within the WPAR. They need to be mounted in the GLOBAL LPAR.
1. Shutdown WPAR¶
stopwpar -Fv <wpar>
2. Make available all the WPAR LUN's in the GLOBAL¶
lswpar -D | awk '/disk/ && !/yes/{ print $2 }' | while read -r LUN; do mkdev -l "${LUN}"; done
3. Import all volume groups¶
Hack loop through array, will throw some errors.
set -A wpar_disk $(lswpar -D | awk '/disk/ && !/yes/{ print $2 }')
count=0; while (( $count < ${#wpar_disk[*]} )); do echo importvg -y <wpar_name>_${count} ${wpar_disk[$count]}; let count="count + 1"; done
4. Run mount in a loop and see which ones fail¶
lsvg | lsvg -li | awk '/jfs/{ print $NF }' | while read -r FS; do mount "${FS}"; done
5. Run fsck in a loop against all jfs filesystems that have failed¶
Run in tmux/screen session, as it might take a while.
for FS in <list failed filesystems here>; do fsck -y ${FS}; done
6. Unmount, varyoff and export all the WPAR volume groups¶
lsvg | lsvg -li | awk '/jfs/{ print $NF }' | while read -r FS; do umount "${FS}"; done
lsvg | grep <wpar> | while read -r VG; do varyoffvg "${VG}"; exportvg "${VG}"; done
7.Start WPAR¶
startwpar -v <wpar>