Thursday, October 4, 2012

Add swap solaris 10 using ZFS

When pca wanted to install 144500-19, patchadd aborted with:
Running patchadd
Validating patches...
Loading patches installed on the system...
Done!
Loading patches requested to install.
[...]
Checking patches that you specified for installation.

Done!
Unable to install patch. Not enough space in /var/run to copy overlay objects.
 401MB needed, 220MB available.

Failed (exit code 1)
Well, this Sun Enterprise 250 only has 768 MB memory, not too much in these days. Let's add some virtual memory then: 
 
# mkfile 1g /var/tmp/swap.tmp
# swap -a /var/tmp/swap.tmp
/var/tmp/swap.tmp: Invalid operation for this filesystem type
Oh, right - we're on ZFS already. Let's try again:
# rm /var/tmp/swap.tmp
# zfs create -V 1gb rpool/tmpswap
# swap -a /dev/zvol/dsk/rpool/tmpswap 
# df -h /var/run 
Filesystem             size   used  avail capacity  Mounted on
swap                   1.4G   107M   1.3G     8%    /var/run
Now we should be good to go :-)

Oh, and regarding those "overlay objects in /var/run" mentioned above: once patchadd(1M) is running, take a look:
# df -h | grep -c /var/run
991


No comments: