HP-UX System Administrator's Guide: Routine Management Tasks
Though you should have made a backup of your data in the previous step for
safety, fsadm usually eliminates the need to use that backup to restore lost data.
2
In this example:
fsadm -b 512000 /work/project5
NOTE: For VxFS file systems, the fsadm command uses DEV_BSIZE-byte sectors
as the units for the -b option. In this example (and probably on your system)
3
,
DEV_BSIZE=1024. Therefore, -b 512000 represents 500MB in the above
command.
4. Determine the new size for the logical volume, based on the new (smaller) size of
the file system.
If the logical volume contains a file system (as in this example), the new size of
the logical volume should be at least as large as the file system that it will contain.
To determine the current size of a file system, use the bdf command. bdf will
show you the size of all mounted volumes (in kilobytes). The kbytes column of
bdf's output shows the space currently allocated to each file system.
#bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 1048576 310784 732088 30% /
/dev/vg00/lvol1 1835008 150288 1671656 8% /stand
/dev/vg00/lvol8 4587520 603288 3956664 13% /var
/dev/vg00/lvol7 4423680 2976080 1436312 67% /usr
/dev/vg00/lvol4 524288 72672 448096 14% /tmp
/dev/vg00/lvol6 7274496 4211304 3039272 58% /opt
/dev/vg00/lvol5 114688 5792 108056 5% /home
/dev/vg01/lvol2 512499 49142 412107 11% /work/project5
#
5. Unmount the file system. lvreduce will not reduce the size of a logical volume
containing a mounted file system.
umount /work/project5
6. Reduce the size of the logical volume:
lvreduce -L 500 /dev/vg01/lvol2
This reduces the logical volume/dev/vg01/lvol2 to 500MB.
7. Mount the file system:
mount /dev/vg01/lvol2 /work/project5
This mounts the file system back to the directory where it was previously mounted.
2. This requires Version 3 or above disk layout. In older disk layouts, file system structural components are
fixed, so reducing the size of a file system fails if there are file system resources in use in the sectors being
removed. See fsadm_vxfs(1M) for additional details.
3. DEV_BSIZE is defined in the file /usr/include/sys/param.h (<sys/param.h>)
Managing Disks - Quick Reference Examples 105