Previous  |  Next  >  
Product: File System Guides   
Manual: File System 4.1 Administrator's Guide   

Resizing a File System

You can extend or shrink mounted VxFS file systems using the fsadm command. Use the extendfs command to extend the size of an unmounted file system. A file system using the Version 4 disk layout can be up to two terabytes in size. A file system using the Version 5 disk layout can be up to 32 terabytes in size. A file system using the Version 6 disk layout can be up to 256 terabytes in size. The size to which a Version 5 or Version 6 disk layout file system can be increased depends on the file system block size (as shown in the tables under VxFS Version 5 Disk Layout and VxFS Version 6 Disk Layout). See the following manual pages for more information about resizing file systems:

extendfs(1M)
fsadm_vxfs(1M)

How to Extend a File System Using fsadm

If a VxFS file system is not large enough, you can increase its size. The size of the file system is specified in units of 1024-byte blocks (or sectors).


Note   Note    If a file system is full, busy, or too fragmented, the resize operation may fail.

To extend a VxFS file system, use the syntax:

fsadm [-F vxfs] [-b newsize] [-r rawdev] mount_point

vxfs

The file system type.

newsize

The size (in sectors) to which the file system will increase.

mount_point

The file system's mount point.

-r rawdev

Specifies the path name of the raw device if there is no entry in /etc/fstab and fsadm cannot determine the raw device.


Note   Note    The device must have enough space to contain the larger file system. See the format(1M) manual page or the VERITAS Volume Manager Administrator's Guide for more information.

Example

To extend the VxFS file system mounted on /ext to 22528 sectors, enter:


 # fsadm -F vxfs -b 22528 /ext 

How to Shrink a File System

You can decrease the size of the file system using fsadm, even while the file system is mounted.


Note   Note    In cases where data is allocated towards the end of the file system, shrinking may not be possible. If a file system is full, busy, or too fragmented, the resize operation may fail.

To decrease the size of a VxFS file system, use the syntax:


 fsadm [-F vxfs] [-b newsize] [-r rawdevmount_point 

vxfs

The file system type.

newsize

The size (in sectors) to which the file system will shrink.

mount_point

The file system's mount point.

-r rawdev

Specifies the path name of the raw device if there is no entry in /etc/fstab and fsadm cannot determine the raw device.


Example

To shrink a VxFS file system mounted at /ext to 20480 sectors, enter:


 # fsadm -F vxfs -b 20480 /ext 
Caution  Caution    After this operation, there is unused space at the end of the device. You can then resize the device, but be careful not to make the device smaller than the new size of the file system.

How to Reorganize a File System

You can reorganize (or compact) a fragmented file system using fsadm, even while the file system is mounted. This may help shrink a file system that could not previously be decreased.


Note   Note    If a file system is full or busy, the reorg operation may fail.

To reorganize a VxFS file system, use the syntax:


 fsadm [-F vxfs] [-e] [-d] [-E] [-D] [-r rawdevmount_point

vxfs

The file system type

-d

Reorders directory entries to put subdirectory entries first, then all other entries in decreasing order of time of last access. Also compacts directories to remove free space.

-D

Reports on directory fragmentation.

-e

Minimizes file system fragmentation. Files are reorganized to have the minimum number of extents.

-E

Reports on extent fragmentation.

mount_point

The file system's mount point.

-r rawdev

Specifies the path name of the raw device if there is no entry in /etc/fstab and fsadm cannot determine the raw device.


Example

To reorganize the VxFS file system mounted at /ext, enter:


 # fsadm -F vxfs -EeDd /ext

How to Extend a File System Using extendfs

If a VxFS file system is not mounted, you can use the extendfs command to increase the size of the file system.

To extend a VxFS file system, use the syntax:


  extendfs [-F vxfs] [-q] [-v] [-s sizespecial

vxfs

The file system type

-q

Displays the size of special without resizing it

-v

Specifies verbose mode

-s size

Specifies the number of blocks to add to the file system (maximum if not specified)

special

Either a logical volume or a disk partition


Note   Note    The device must have enough space to hold the new larger file system.

When the file system size is grown with the extendfs command, the intent log size is not automatically increased. This issue is most visible when upgrading file systems with disk layout Versions prior to 3 and of a size smaller than 8 MB. When such a file system is upgraded to disk layout Version 4 and then extended to a size greater than 8 MB with the extendfs command, the file system cannot be mounted since the minimum allowed intent log size is 256K.


Example

To increase the capacity of a file system on a VM volume, enter:


# umount /dev/vg00/lvol7
# lvextend -L larger_size /dev/vg00/lvol7
# extendfs -F vxfs /dev/vg00/rlvol7
# mount -F vxfs /dev/vg00/lvol7 mount_point
 ^ Return to Top Previous  |  Next  >  
Product: File System Guides  
Manual: File System 4.1 Administrator's Guide  
VERITAS Software Corporation
www.veritas.com