Reducing the Size of the /var or /tmp File System


Contents

About This Document
    Related Documentation
Procedure

About This Document

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.

Related Documentation

The AIX and RS/6000 product documentation library is also available:

http://www.rs6000.ibm.com/resource/


Procedure

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.)

  1. Turn the key to the Service position. If you are using a machine without a key, contact your AIX support center.

  2. With BOOTABLE MEDIA OF THE SAME VERSION AND LEVEL AS THE SYSTEM, boot the system.

    The bootable media can be ANY ONE of the following:

    • Bootable CD-ROM (AIX Version 3.2 or later versions)
    • NON_AUTOINSTALL mksysb (all AIX versions)
    • Bootable Install Tape (all AIX versions)
    • BOSboot diskettes (AIX Version 3.1 or 3.2)

    NOTES:

    1. For information on BOSboot diskettes, refer to InfoExplorer or the product documentation.
    2. If you are booting from diskettes, when you see LED c07, insert the next diskette. This may be the optional display extensions diskette (required for AIX Version 3.2.5) or the display diskette.
    3. If you have AIX Version 3.2.5, use a fddi network install, and select that option for the install device; you will need the communications extensions diskette. If this diskette is not available, you can build it from another system with fddi installed or call your branch office for assistance.

    Follow the prompts to the installation/maintenance menu.

  3. For AIX Versions 3.x, choose the limited function maintenance shell (option 5 for AIX Version 3.1, option 4 for AIX Version 3.2).
    For AIX Versions 4.x, skip to
    step 7.

  4. Determine the hdisk to use with the getrootfs or /etc/continue command. If you have only one disk, then hdisk0 is the proper hdisk to use. If you have more than one disk, do the following:

  5. Now access the rootvg volume group by running /etc/continue (for AIX Version 3.1) or getrootfs (for AIX Version 3.2). (For AIX Version 3.2.4 or later, skip to step 6.) The number sign, #, represents the number of the fixed disk determined in step 4.
        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:

  6. For AIX Version 3.2.4 or later, enter the following command:
        ODMDIR=/dev/objrepos 
    

    Follow the prompts to the "Welcome to Base OS" menu, and then skip to step 8.

  7. For AIX Versions 4.x, choose "Start Maintenance Mode for System Recovery" (Option 3).

    The next screen displays the following menu.

    "Maintenance"

    • Choose "Access a Root Volume Group" (Option 1).
    • Choose "0 continue" and Select Volume group by number.

      At this stage the console displays information about rootvg and a menu with two options.

    • Choose "Access this volume group and start a shell" (Option 1).

      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:

      • local branch office
      • your point of sale
      • your AIX support center

      If no errors occur, proceed with the following steps.

  8. Unmount the file system. (The following examples use /var. If you intend to reduce the /tmp file system, substitute /tmp for /var in the commands.) Execute:
        umount /var
    
  9. Remove the file system by executing:
        rmfs /var
    
  10. Create the logical volume with one of these commands:
        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.

  11. Create the file system with the following command:
        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.

  12. Mount the file system:
        mount /var     (OR mount /tmp) 
    
  13. If you are recreating /var, now create the /var/tmp directory for the vi editor. Execute:
        mkdir /var/tmp 
    
  14. Set your TERM variable and export it. If you are using a megapel display, try setting TERM=hft. If you are using an ASCII terminal (such as an IBM 3151), set your TERM to the appropriate terminal type. For example:
        TERM=hft 
        export TERM 
    
  15. Edit /etc/filesystems. If you have been recreating /tmp, invoke the vi editor by executing the following command:
        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.

  16. Change the ownership and permissions to the proper values, as follows:
        chmod g-s /var 
        chmod 755 /var 
        chown bin.bin /var
     
             or
     
        chmod g-s /tmp 
        chmod 1777 /tmp 
        chown bin.bin /tmp 
    
  17. Restore the files from your backup. If you used the backup method given earlier in this document, execute:
        cd / 
        tar -xvf /dev/rmt0 
    
  18. Remove the bootable media if you have not already done so, switch the key to the Normal position, shut down, and reboot the system.


Reducing the Size of the /var or /tmp File System: reduce.var.tmp.all.krn ITEM: FAX
Dated: 98/12/17~00:00 Category: krn
This HTML file was generated 99/06/24~12:42:08
Comments or suggestions? Contact us