HP-UX System Administrator's Guide: Routine Management Tasks
NOTE: If the reason you are reducing the size of the logical volume is to use it
for a different purpose, you might want to mount it to a different directory. This
is fine.
8. Verify that the data (if any) contained in the newly resized and remounted file
system has not been damaged. If necessary restore any damaged data (or to be
safe, the entire file system) from the backup you previously made. For example:
cd /somewhere_else
pax -rw . /work/project5
recovers the files from the alternate location somewhere_else, created using the
second pax command in Step 2.
9. If /work/project5 was previously, and will continue to be, used by NFS clients,
re-share it from the server:
share -F nfs /work/project5
and remount it on the clients:
mount -F nfs serversys:/work/project5 /work/localproject5
Example: Reducing the size of a logical volume containing an HFS file system
HFS file systems cannot be manipulated while mounted an online to the extent that
VxFS file systems can. Therefore, the procedure to reduce a logical volume that contains
a mounted HFS file system is a bit different than the previous example.
If the file system mounted to /work/project5 is an HFS file system (and if the size
of that file system needs to be reduced to accommodate the pending reduction of its
surrounding logical volume) you need to remove the existing file system and make a
new (smaller) file system in its place:
Procedure summary:
• Make sure no one is actively using the file system during the procedure
• Backup the data (for later restoration)
• Unmount the file system
• Use lvreduce to reduce the size of the surrounding logical volume
• Use newfs to make a new HFS file system on the newly resized logical volume
• Mount the new file system
• Restore the data from the backup you previously made
To reduce the size of the logical volume/dev/vg01/lvol2 containing an HFS file
system that is currently mounted to the directory /work/project5 where the new
(smaller) size of the logical volume is to be 500MB:
106 Managing Systems