Increase /tmp file system size dynamically in Solaris zone

Hi

Please let me know how to increase the size of /tmp file system from 512m to 1024m dynamically without reboot in solaris zone

# df -h
Filesystem             size   used  avail capacity  Mounted on
zones/zone1             11G   1.0G  10.0G    10%    /
/dev                    11G   1.0G  10.0G    10%    /dev
/lib                    45G    13G    32G    30%    /lib
/platform               45G    13G    32G    30%    /platform
/sbin                   45G    13G    32G    30%    /sbin
/usr                    45G    13G    32G    30%    /usr
proc                     0K     0K     0K     0%    /proc
ctfs                     0K     0K     0K     0%    /system/contract
mnttab                   0K     0K     0K     0%    /etc/mnttab
objfs                    0K     0K     0K     0%    /system/object
swap                   2.0G   186M   1.8G    10%    /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
                        45G    13G    32G    30%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   512M    32K   512M     1%    /tmp
swap                   2.0G   186M   1.8G    10%    /var/run
# 
#
# cat /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
/proc           -               /proc           proc    -       no      -
ctfs            -       /system/contract        ctfs    -       no      -
objfs           -       /system/object  objfs   -       no      -
sharefs         -       /etc/dfs/sharetab       sharefs -       no      -
fd              -               /dev/fd         fd      -       no      -
swap            -               /tmp            tmpfs   -       yes     size=512m

#

What is your Solaris release ?

Can you provide output of following :
zonecfg -z <your_zone> info

Depending on your configuration and available memory on the system, same could be achieved using prctl command.

It also looks like the size in enforced inside zone in /etc/vfstab

swap            -               /tmp            tmpfs   -       yes     size=512m

I'm not sure there is a way without reboot of the zone to increase that value, if configured in above manner.

Keep in mind if you are installing Oracle software, there are variables TMP and TMPDIR which can point to any directory having more space, for install to work.

Regards
Peasant.

Hi Peasant

Thanks for the input.

Please find below output:

bash-3.2# zonecfg -z zone1 info
zonename: zone1
zonepath: /zones/zone1
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
net:
        address: 192.168.11.71
        physical: e1000g0
        defrouter not specified
capped-memory:
        physical: 3G
        [swap: 2G]
        [locked: 2G]
rctl:
        name: zone.max-swap
        value: (priv=privileged,limit=2147483648,action=deny)
rctl:
        name: zone.max-locked-memory
        value: (priv=privileged,limit=2147483648,action=deny)
bash-3.2#
bash-3.2# uname -a
SunOS sun 5.10 Generic_150401-30 i86pc i386 i86pc
bash-3.2#

Yes I know that changing the value in vfstab from 512 to 1024 and reboot of zone will solve the issue. Here I am doing it in my test VM as we got this request once in every month. Please let us know how can we do it from prctl ( here we want to limit the use of /tmp mean swap) command and also let us know how to do it through TMP and TMPDIR if we get the request for Oracle Database Software from DB team

Regards

Unfortunately you cannot do it live with vfstab entry.
The zone currently has 3 GB memory and 2 GB swap, with /tmp limited via vfstab entry inside the zone to 512 MB.

Otherwise (if no limit is imposed in vfstab), prctl / rctladm commands can be used against zone.max-swap during runtime.

This will increase it during runtime, but you still need to add using zonecfg so it is set during next reboot.
Since you will need to reboot, best to do it via zonecfg exclusively.

As for Oracle DB install, just issue export TMP=/some/path and export TMPDIR=/some/path where /some/path is any location on the system which has at least 1 GB of free space, following by installer run in the same shell session.

Regards
Peasant.

thanks for your valuable input Peasant

I have Question that is setting TMP and TMPDIR variable as a Oracle user with some path on which they have access so that when oracle installer software will run it will use that path for temporary files within same shell. After installation complete unset these variable .

I know how to use prctl command . Could you let me know rctladm command usage for dynamic changes.

Further change done by prctl or rctladm command is not permanent and will gone after reboot till we add those change through zonecfg command.

Yep, only current shell session will use those variables.
But be advised, oracle software will require some /tmp space to function properly.
Some being written in software documentation, being requirements for that software.

As for prctl and other commands, one should exercise in virtual environment, due to those commands being (mostly) universal on all solaris architectures (x86 or sparc).

No post will replace experience which a virtual solaris instance can provide on laptop / pc using one of many virtualization techs present.

Regards
Peasant.

2 Likes

This is a wonderful concept:

It means create a toy system, a sandbox - a system you can play with and not cause damage.
or heartburn or for anybody.