[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 1


chfs Command

Purpose

Changes attributes of a file system.

Syntax

chfs [ -n NodeName ] [ -m NewMountPoint ] [ -u MountGroup ] [ -A { yes | no } ] [ -p { ro | rw } ] [ -t { yes | no } ] [ -a Attribute=Value ] [ -d Attribute ] FileSystem

Description

The chfs command changes the attributes of a file system. The new mount point, automatic mounts, permissions, and file system size can be set or changed. The FileSystem parameter specifies the name of the file system, expressed as a mount point.

Some file system attributes are set at the time the file system is created and cannot be changed. For the Journaled File System (JFS), such attributes include the fragment size, block size, number of bytes per i-node, compression, and the minimum file system size. For the Enhanced Journaled File System (JFS2), the block size cannot be changed.

You can use the File Systems application in Web-based System Manager (wsm) to change file system characteristics. You could also use the System Management Interface Tool (SMIT) smit chfs fast path to run this command.

Implementation Specifics

JFS applies to the POWER-based platform only, and JFS2 is common to both platforms.

Flags

-a Attribute=Value
Specifies the Attribute=Value pairs; dependent on virtual file system type. To specify more than one Attribute=Value pair, provide multiple -a Attribute=Value parameters.

The following attribute/value pairs are specific to the Journaled File System (JFS):

-a Size=NewSize
Specifies the size of the Journaled File System in 512-byte blocks. If Value begins with a + it is interpreted as a request to increase the file system size by the specified amount. If the specified size is not evenly divisible by the physical partition size, it is rounded up to the closest number that is evenly divisible.

The maximum size of a JFS file system is a function of its fragment size and the nbpi value. These values yield the following size restrictions:

nbpi Fragment size in bytes Maximum size in 512-byte blocks
512 512, 1024, 2048, 4096 16777216
1024 512, 1024, 2048, 4096 33554432
2048 512, 1024, 2048, 4096 67108864
4096 512, 1024, 2048, 4096 134217728
8192 512, 1024, 2048, 4096 268435456
16384 512 268435456
16384 1024, 2048, 4096 536870912
32768 512 268435456
32768 1024 536870912
32768 2048, 4096 1073741824
65536, 131072 512 268435456
65536, 131072 1024 536870912
65536, 131072 2048 1073741824
65536, 131072 4096 2147483648
AIX 4.1 is limited to NBPI values from 512 to 16384.
In AIX 4.3, you can have NBPI values from 512 to 128K, with corresponding maximum file system sizes.

The volume group in which the file system resides defines a maximum logical volume size and also limits the file system size.

-a Log=LVName
Specifies the full path name of the filesystem logging logical volume name of the existing log to be used. The log device for this filesystem must reside on the same volume group as the filesystem

-a splitcopy=NewMountPointName
Splits off a mirrored copy of the file system and mounts it read-only at the new mount point. This provides a copy of the file system with consistent JFS meta-data that can be used for backup purposes. User data integrity is not guaranteed, so it is recommended that file system activity be minimal while this action is taking place.

-a copy=Copy#
Specifies which mirror copy to split off when used in conjunction with the splitcopy attribute. The default copy is the second copy. Valid values are 1, 2, or 3.

The following attribute/value pairs are specific to the Enhanced Journaled File System (JFS2):

-a size=NewSize
Specifies the size of the Enhanced Journaled File System in 512-byte blocks. If Value begins with a +, it is interpreted as a request to increase the file system size by the specified amount. If the specified size is not evenly divisible by the physical partition size, it is rounded up to the closest number that is evenly divisible. The volume group in which the file system resides defines a maximum logical volume size and limits the file system size.

Note: JFS2 does not have nbpi or fragment size values to affect the resulting size of the file system.

-a logname=LVName
Specifies the full path name of the filesystem logging logical volume name of the existing log to be used. The log device for this filesystem must reside on the same volume group as the filesystem. Keyword INLINE can be used to place the log in the logical volume with the JFS2 file system. The INLINE log defaults to .4% of the logical volume size if logsize is not specified.

-a logsize=Value
Specifies the size for an INLINE log in MBytes. Ignored if INLINE log not being used. Cannot be greater than 10% of the size of the filesystem.

 

-A
Specifies the attributes for auto-mount.

yes
File system is automatically mounted at system restart.

no
File system is not mounted at system restart.

-d Attribute
Deletes the specified attribute from the /etc/filesystems file for the specified file system.

-m NewMountPoint
Specifies the new mount point.

-n NodeName
Specifies a node name for the specified file system. The node name attribute in the /etc/filesystems file is updated with the new name. The node name attribute is specific to certain remote virtual file system types, such as the NFS (Network File System) virtual file system type.

-p
Sets the permissions for the file system.

ro
Specifies read-only permissions.

rw
Specifies read-write permissions.

 

-t
Sets the accounting attribute for the specified file system:

yes
File system accounting is to be processed by the accounting subsystem.

no
File system accounting is not to be processed by the accounting subsystem; this is the default.

 

-u MountGroup
Specifies the mount group. Mount groups are used to group related mounts, so that they can be mounted as one instead of mounting each individually. For example, if several scratch file systems always need to be mounted together when performing certain tests, they can each be placed in the test mount group. They can then all be mounted with a single command, such as the mount -t test command.

Security

Access Control: Only the root user can run this command.

Examples

  1. To change the file system size of the /test Journaled File System, enter:
    chfs -a size=24576 /test
    This command changes the size of the /test Journaled File System to 24576 512-byte blocks, or 12MB (provided it was previously no larger than this).
  2. To increase the size of the /test Journaled File System, enter:
    chfs -a size=+8192 /test
    This command increases the size of the /test Journaled File System by 8192 512-byte blocks, or 4MB.
  3. To change the mount point of a file system, enter:
    chfs -m /test2 /test
    This command changes the mount point of a file system from /test to /test2.
  4. To delete the accounting attribute from a file system, enter:

    chfs -d account /home
    

    This command removes the accounting attribute from the /home file system. The accounting attribute is deleted from the /home: stanza of the /etc/filesystems file.

  5. To split off a copy of a mirrored file system and mount it read-only for use as an online backup, enter:

    chfs -a splitcopy=/backup -a copy=2 /testfs
    

    This mount a read-only copy of /testfs at /backup.

File


/etc/filesystems Lists the known file systems and defines their characteristics.

Related Information

The crfs command, mkfs command, mklv command.

The Accounting Overview in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices explains the file system accounting subsystem.

The File Systems Overview for System Management in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices explains file system types, management, structure, and maintenance.

For information on installing the Web-based System Manager, see Chapter 2: Installation and System Requirements in AIX 5L Version 5.1 Web-based System Manager Administration Guide.

The System Management Interface Tool (SMIT): Overview in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices explains SMIT structure, main menus, and tasks.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]