Setting up AIX file services


Setting up the hardware

For essential data it is a good idea to keep them on two separate mirrored identical disks.
Additional disks are usually automatically recognized on boot. If they are added to a running system, you have to configure them manually:
   smitty
   Devices - Install/Configure Devices Added After IPL
Just keep the menu item
   INPUT device / directory for software   [none]    
unless the new device needs extra drivers (for disks almost never).

Setting up a volume group

All physical disks must be assigned to a volume group (VG) before they can be used. If the desired VG, for example vgmisc, does not yet exist, create it as follows:
   smitty
   System Storage Management - Logical Volume Manager - 
   Volume Groups - Add a Volume Group
For all versions of AIX (at the time of this writing up to 7.1) one may accept the default settings, except:
  VOLUME GROUP name                                  [vgmisc]
  Physical partition SIZE in megabytes                                       +
* PHYSICAL VOLUME names                              []                      +
The entry Physical partition SIZE in megabytes specifies the smallest increment by which disk space is allocated to logical volumes.
Note that a partition in AIX speak has nothing to do with the partitions known from PC operating systems (their analogy would roughly be logical volumes mentioned later).
An Original VG can have up to 1016 "Physical partitions" (PPs) which have to be chosen large enough so that the whole disk can be covered. Here's a quick lookup of PP size vs disk size:

Disk PP size
36GB 32MB
146GB 256MB
300GB 512MB
450GB 512MB
600GB 1024MB

For the PHYSICAL VOLUME names you'll have the choice among all active disks not yet assigned to a VG. If you plan disk mirroring, you may choose both or just one, and add the second one later.

Setting up a logical volume

Create a new logical volume (LV), for example lvscratch:
   smitty
   System Storage Management - Logical Volume Manager - 
   Logical Volumes - Add a Logical Volume

   VOLUME GROUP name [vgmisc]
Most default settings can be left unchanged, except:

Setting up a file system

  1. Create a new file system, for example fsscratch:
  2. Mount the filesystem:
      smitty
      System Storage Management - File Systems - Mount a File Systems
       
        
      FILE SYSTEM name                                   [/dev/lvscratch]        +
      DIRECTORY over which to mount                      [/fsscratch]            +
    
    # or on the command line:
    
    /usr/sbin/mount /dev/lvscratch /fsscratch 
    
  3. Adjust the filesystem size, for example:
      smitty
      System Storage Management - File Systems -
      Add / Change / Show / Delete File Systems -
      [Enhanced] Journaled File Systems -
      Change / Show Characteristics of an [Enhanced] Journaled File System 
        
      File system name                                    /fsscratch
      NEW mount point                                    [/fsscratch]
      SIZE of file system
              Unit Size                                   Gigabytes              +
              Number of units                            [128]                    #
    
    
  4. If applicable and not yet done, follow these instructions to mirror the VG and/or the LV. At least disable the quorum for mirrored VGs:
       chvg -Q'n' vgmisc
    
    otherwise both disks would be needed to keep the VG online, which is not what you want in case just one disk fails.
  5. Set appropriate permissions, for example a group-enabled FS:
    chmod g+sw              /fsscratch
    chown ourgroup:ourgroup /fsscratch 
    
  6. For file systems which should be cleared periodically (typically some scratch or /tmp) adapt the /etc/skulker script or use some equivalent (scavenger) and place a respective entry in the crontab file, for example:
    crontab -e
    
    0 3 * * * /usr/sbin/skulker
    # or 
    0 3 * * * /opt/bin/scavenger -t+1 /fsscratch >/dev/null
    
  7. LAST BUT NOT LEAST: Don't forget to setup ADSM/TSM backup !

Enabling NFS access

If the filesystem should be accessed by other nodes (NFS clients), the following steps are necessary.
  1. Export the filesystem:
    smitty
    
    System Storage Management - File Systems - Change File Systems - 
    Network File System (NFS) - Add a Directory to Exports List
    
    You may just accept the default settings, except:
    * Pathname of directory to export                    [/fsscratch]             /
    
    * Security method 1                                  
          Hosts & netgroups allowed client access        []              
          Hosts allowed root access                      []                
    
    netgroups are defined via NIS and conveniently combine groups of hosts allowed client access under a unique name. If nothing is specified, all hosts are allowed, except the root user, which has to be enabled separately.
    If necessary, you may choose (carefully and restrictive!) hosts which should be enabled for root access.
  2. Enable NFS mounts on the client machines:


Last update: 5-Dec-2012, M.Kraemer