Moving a JFS File System to a New Volume Group


Contents

About This Document
    Related Documentation
Moving File Systems from One Volume Group to Another
Logical Volumes Specific to rootvg
Recommended Fixes

About This Document

This document describes how to move a JFS file system from one volume group to another. Information in this document applies to AIX Versions 4.x.

Related Documentation

For more in-depth coverage of this subject, the following IBM publications are recommended:

IBM documentation can also be found online at the following URL:

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

Moving File Systems from One Volume Group to Another

ATTENTION: MAKE SURE A FULL BACKUP EXISTS OF ANY DATA YOU INTEND TO MIGRATE BEFORE USING THESE PROCEDURES.

In AIX, storage allocation is performed at the volume group level. Storage cannot span volume groups. If space within a volume group becomes constrained, then space that is available in other volume groups cannot be used to resolve storage issues.

The solution to this problem is to add more physical volumes to the relevant volume group. This may not be an option in all environments. If other volume groups contain the required free space, the alternative is to move the required logical volumes to the desired volume group and expand them as needed.

The source logical volume can be moved to another volume group with the cplv command. The following steps achieve this.

ATTENTION: The logical volume should be inactive during these steps to prevent incomplete or inconsistent data. If the logical volume contains a mounted filesystem, then that filesystem should be unmounted first. If this logical volume is being used as a RAW storage device, then the application using this logical volume should close the device or be shut down.

  1. Copy the source logical volume to the desired volume group with the cplv command.

    For example, where "myvg" is the new volume group and "mylv" is the name of the user's logical volume, execute:

        cplv -v myvg mylv 
    
    This will return the name of the new LV, such as lv00.

  2. Remove the source logical volume command with the rmlv command.

    For example, where "mylv" is the name of the user's logical volume, execute:

        rmlv mylv
    
  3. Rename and reset any needed attributes on the new logical volume with the chlv or chmod commands.

    For example, where "mylv" is the name of the user's logical volume, execute:

        chlv -n mylv lv00
    

If this logical volume was being used for RAW storage, then the migration is complete, and any application using this logical volume may resume. If this is a JFS filesystem, then proceed. Please note that RAW storage devices should NOT use the first 512 bytes of the RAW device. This is reserved for the LVCB or Logical Volume Control Block. cplv will not copy the first 512 bytes of the RAW logical volume, but will update fields in the new LV's LVCB.

  1. All JFS filesystems require a log device. This will be a logical volume with a type of jfslog. Run the command lsvg -l <VGNAME> on your destination volume group. If a JFS log does not already exist on the new volume group, then create one by using the mklv and logform commands.
  2. For example, where "myvg" is the name of the new volume group, execute:

                 mklv -t jfslog  myvg 1
    

    This will return a new JFS log lv such as loglv00. This will need to be formatted with the logform command to function as a JFS log.

    For example:

                 logform /dev/loglv00
    
  3. Change the file system to reference a log device that exists in the new volume group with the chfs command.
  4. For example, where "myfilesystem" is the name of the user's filesystem, execute:

                 chfs -a log=/dev/loglv00 /myfilesystem
    
  5. Mount the file system.
  6. For example, where "myfilesystem" is the name of the user's file system, execute:

                 mount /myfilesystem
    

    At this point, the migration is complete, and any applications or users can now access the data in this filesystem.


Logical Volumes Specific to rootvg

The following logical volumes and filesystems are specific to the rootvg volume group and cannot be moved to other volume groups:

    Logical Volume          Filesystem or Description 
    ------------------------------------------------------ 
    hd2                     /usr 
    hd3                     /tmp 
    hd4                     / 
    hd5                     <boot logical volume> 
    hd6                     <primary paging space> 
    hd8                     <primary JFS log> 
    hd9var                  /var 

Recommended Fixes

APAR     Description                                     AIX Level 
----     -----------                                     --------- 
IX56130  CPLV FAILS WHEN COPYING 2GB LV FROM 8MEG PP VG  4.1 
         TO 4MEG PP VG 
IX51236  ODM CONTENTION CAUSES PARTIAL LVM UPDATES OR    4.1 
         CORRUPTION OF ODM 
IX54318  UNABLE TO RENAME A LOGICAL VOLUME               4.1 

Moving a JFS File System to a New Volume Group: move.jfs.4x.krn ITEM: FAX
Dated: 99/02/12~00:00 Category: krn
This HTML file was generated 99/06/24~12:42:00
Comments or suggestions? Contact us