HP-UX System Administrator's Guide: Logical Volume Management (762803-001, March 2014)

2. Extend the logical volume. For example:
# /sbin/lvextend -L 332 /dev/vg01/lvol2
This increases the size of this volume to 332 MB.
3. Extend the file system size to the logical volume size. If the file system is unmounted, use the
extendfs command as follows:
# /sbin/extendfs /dev/vg01/rlvol2
If you did not have to unmount the file system, use the fsadm command instead. The new size
is specified in terms of the block size of the file system. In this example, the block size of the
file system /work/project5 is 1 KB. To extend the file system to 332 MB, the number of
blocks is 339968 (332 times 1024). For example:
# fsadm -b 339968 /work/project5
4. If you unmounted the file system, mount it again.
a. If you had to change to single-user state, reboot the system.
# /sbin/reboot -r
You can skip any additional steps to mount the file system and export it, since the boot
process mounts and exports any file systems.
b. Remount the file system as follows:
# /sbin/mount /dev/vg01/rlvol2 /mount_point
NOTE: If the file system will continue to be used by NFS clients, export it on the server
(exportfs -a) and remount it on the clients (mount -a).
5. Verify that the file system reflects the expansion by entering bdf, df, or fsadm -E.
6. If you are extending root file system, then you need to run the following command to update
boot records used in maintenance mode boot (MMB):
# /sbin/lvlnboot -c
WARNING! lvlnboot -c must be run after any change in size or location of root logical
volume, such as extending (lvextend), reducing (lvreduce) or moving (pvmove) the root logical
volume. Failure to do so will result in maintenance mode boot (MMB) failure if attempted
subsequently. However note that lvlnboot -c is run automatically on every regular boot.
NOTE: HP recommends you to use DRD clones to re-size the system logical volumes
(root/swap/dump) to be safer. You can apply the size changes on DRD clone disk and then
boot over it
3.7.3 Reducing the Size of a File System
You might want to shrink a file system that has been allocated more disk space than it needs,
allowing that disk space to be freed for other uses.
Reducing the size of a file system is more complicated than extending it. Because of file system
block allocation strategies, data can be scattered throughout the logical volume. Reducing the
logical volume reclaims space at the end of the logical volume, requiring file system drivers to
coalesce and rearrange data blocks ahead of time. Most types of file system are unable to do
such coalescence, so you must back up the data in the file system, reduce the logical volume,
create a new file system in the smaller logical volume, and restore the data from your backup.
The only current file system type able to do online coalescence and size reduction is OnlineJFS,
and it can fail in some cases.
102 Administering LVM