From Wiki-UX.info

Wiki-UX / File Systems / How to extend a file system
Jump to: navigation, search

How to extend a file system


Abstract

This article describes how to extend a file system on HP-UX 11i Operating Environment. The extendfs command should be used to extend HFS or JFS (VxFS) file systems that are not mounted. The Veritas OnlineJFS extends the functionality of the JFS product to extend a file system in using the fsadm command.

Most often, the file systems that require to be extended use LVM Logical Volumes as they backing storage, but the same approach can be used for VxVM volumes, or LUN expansion of Storage Attached Networks (SAN) Logical Units (LUN).

In this example, the file system /dev/vg01/lvol1 mounted on /test will be increased to use additional physical extents available on /dev/vg01 volume group.

Extend the file system

If you use the fsadm command to extend a file system you need to know the target size in Megabytes to provied to the -b comman option. The extendfs don't required to previously know the new size.

Extending file system with fsadm

1. Verify that OnlineJFS license is installed on the system.

HP-UX 11i v1
# vxlicense -t HP_OnlineJFS
 
vrts:vxlicense: INFO: Feature name: HP_OnlineJFS [50]
vrts:vxlicense: INFO: Number of licenses: 1 (non-floating)
vrts:vxlicense: INFO: Expiration date: No expiration date
vrts:vxlicense: INFO: Release Level: 22
vrts:vxlicense: INFO: Machine Class: All
vrts:vxlicense: INFO: Site ID: 0
HP-UX 11i v2 | v3
# vxlicrep | grep Online
   HP_OnlineJFS                        = Enabled

2. Extend the file system.

# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/ri       1835008   17942 1703507    1% /test
# vgdisplay -v vg01
...
PE Size (Mbytes)            8
Total PE                    4341
Alloc PE                    4096
Free PE                     245
...
LV Name                     /dev/vg01/lvol1
LV Status                   available/syncd
LV Size (Mbytes)            1792
Current LE                  224
Allocated PE                224
Used PV                     1
...
# lvextend -l 300 /dev/vg01/lvol1
Logical volume "/dev/vg01/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg01.conf
# vgdisplay -v vg01
...
PE Size (Mbytes)            8
Total PE                    4341
Alloc PE                    4172
Free PE                     169
...
LV Name                     /dev/vg01/lvol1
LV Status                   available/syncd
LV Size (Mbytes)            2400
Current LE                  300
Allocated PE                300
Used PV                     1
...
# bdf /test
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg01/lvol1       1835008   17942 1703507    1% /test
# fsadm -F vxfs -b 2400M /test
UX:vxfs fsadm: INFO: V-3-25942: /dev/vg01/rlvol1 size increased from 1835008 sectors to 2457600 sectors
# bdf /test
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg01/lvol1    2457600   18095 2287043    1% /test

Extending file system with extendfs

# bdf /test
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg01/lvol1    1835008   17942 1703507    1% /test
# vgdisplay -v vg01
...
PE Size (Mbytes)            8
Total PE                    4341
Alloc PE                    4096
Free PE                     245
...
LV Name                     /dev/vg01/lvol1
LV Status                   available/syncd
LV Size (Mbytes)            1792
Current LE                  224
Allocated PE                224
Used PV                     1
...
# lvextend -l 300 /dev/vg01/lvol1
Logical volume "/dev/vg01/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg01.conf
# vgdisplay -v vg00
...
PE Size (Mbytes)            8
Total PE                    4341
Alloc PE                    4172
Free PE                     169
...
LV Name                     /dev/vg00/ri
LV Status                   available/syncd
LV Size (Mbytes)            2400
Current LE                  300
Allocated PE                300
Used PV                     1
...
# bdf /test
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/ri       1835008   17942 1703507    1% /test
# umount /test
 
# extendfs /dev/vg01/rlvol1
 
# mount /test
# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg01/lvol1    2457600   18095 2287043    1% /test

Reference

Authors

This page was last modified on 17 July 2010, at 02:35. This page has been accessed 8,947 times.