The information contained in this document concerns reducing the size of the
/var or /tmp file system.
This document applies to all versions of AIX.
http://www.rs6000.ibm.com/resource/
The following steps reduce the size of the /var or /tmp file system in all versions of AIX. Note that the /var file system does not exist at AIX Version 3.1. If either file system on your machine is 8192KB in size or smaller, you probably should not reduce it. The default size of the /var file system (on installation) is 4096KB, which fills up rather quickly; if you can afford the space, it is better to have /var be 8192KB total. The default size of the /tmp file system (upon installation) is 8192KB.
NOTE: BACK UP THE DATA before proceeding. One way to do this is by executing the following sequence of commands on either /var or /tmp:
cd / tar -cvf /dev/rmt0 /var
(/dev/rmt0 can be replaced with /dev/fd0 or the full path of a file NOT in the same file system.)
The bootable media can be ANY ONE of the following:
NOTES:
Follow the prompts to the installation/maintenance menu.
getrootfs
The output indicates the disk that should be used with getrootfs in step 5.
lqueryvg -Atp hdisk# | grep hd5Execute this command for each hdisk# (hdisk0, hdisk1, and so on) until you get output that looks like the following:
00005264feb3631c.2 hd5 1
The exact output you get will be different but will have this form:
large_number.x hd5 1
You may find that more than one disk has this output. These will all be disks that belong to the rootvg volume group. In the following step you may use any of the disks identified to be in rootvg.
For AIX Version 3.1 only: /etc/continue hdisk# For AIX Version 3.2 only: getrootfs hdisk#
If you get errors from /etc/continue or getrootfs, do not continue with the rest of this procedure. Correct the problem causing the error. If you need assistance correcting the problem causing the error, contact one of the following:
ODMDIR=/dev/objrepos
Follow the prompts to the "Welcome to Base OS" menu, and then skip to step 8.
The next screen displays the following menu.
"Maintenance"
At this stage the console displays information about rootvg and a menu with two options.
If you get errors from the preceding option, do not continue with the rest of this procedure. Correct the problem causing the error. If you need assistance correcting the problem causing the error, contact one of the following:
If no errors occur, proceed with the following steps.
umount /var
rmfs /var
mklv -y hd9var rootvg [x] (for /var) mklv -y hd3 rootvg [x] (for /tmp)[x] is the number of logical partitions you want to allocate. Partitions are 4MB by default, and are usually 8MB for disks that are 4.5GB or larger. For example:
mklv -y hd9var rootvg 2
This command makes a logical volume hd9var of size 8MB (two 4MB partitions) in the rootvg volume group.
NOTE: The hd3 is the logical volume name used for the /tmp file system, and hd9var is the logical volume name used for /var. These names MUST be used.
crfs -v jfs -d hd9var -m /var -a check=false -a free=false -a vol=/var
NOTE: Substitute hd3 for hd9var and /tmp for /var if needed.
mount /var (OR mount /tmp)
mkdir /var/tmp
TERM=hft export TERM
vi -c "set dir=/" /etc/filesystems
If you have not been recreating /tmp, execute:
vi /etc/filesystems
Skip down to the stanza for either /var or /tmp. Within that stanza go to the line that says mount = false and change the word false to automatic. Save the file.
chmod g-s /var chmod 755 /var chown bin.bin /var or chmod g-s /tmp chmod 1777 /tmp chown bin.bin /tmp
cd / tar -xvf /dev/rmt0