HP-UX System Administrator's Guide: Routine Management Tasks
1. Make sure no one has files open in any file system on the logical volume and
that no one’s current working directory is contained within the file system:
fuser -cu /work/project5
NOTE: If the file system is shared with other systems, check on those other
systems that no one is using it (fuser works on NFS-mounted file systems as well
as local ones). Then unmount it from the remote client systems before unmounting
it from the server.
2. Back up the data in the file system:
Using a utility like tar or pax, backup the data contained in the logical volume
you are about to reduce. If your logical volume contains a database, use a backup
method appropriate for that database. In this example, to back up
/work/project5 to a tape device:
cd /work/project5
pax -w -f /dev/rtape/tape4QIC150 .
Or, copy the contents of the file system to a temporary location not within the
logical volume you are attempting to reduce:
pax -rw /work/project5 /somewhere_else/project5
IMPORTANT: However you do it, backup your data! You will need to restore the
data from this backup later in this procedure!
3. Unlike with VxFS file systems, you cannot use the -b option to the fsadm command
to reduce the size of an HFS file system. Instead, unmount the HFS file system:
umount /work/project5
4. Reduce the size of the logical volume:
lvreduce -L 500 /dev/vg01/lvol2
This reduces the logical volume/dev/vg01/lvol2 to 500MB. It also probably
destroyed the integrity of the previously existing file system by truncating a portion
of its data and file system structures. This is why you made the backup in Step 2.
5. Use newfs to make a fresh file system structure on the newly reduced logical
volume:
# newfs -F hfs /dev/vg01/rlvol2
mkfs (hfs): Warning - 208 sector(s) in the last cylinder are not allocated.
mkfs (hfs): /dev/vg01/rlvol2 - 524288 sectors in 1561 cylinders of 12 tracks, 28 secs
536.9Mb in 98 cyl groups (16 c/g, 5.51Mb/g, 832 i/g)
Super block backups (for fsck -b) at:
16, 5424, 10832, 16240, 21648, 27056, 32464, 37872, 43280, 48688,
54096, 59504, 64912, 70320, 75728, 81136, 86032, 91440, 96848, 102256,
107664, 113072, 118480, 123888, 129296, 134704, 140112, 145520, 150928, 156336,
161744, 167152, 172048, 177456, 182864, 188272, 193680, 199088, 204496, 209904,
215312, 220720, 226128, 231536, 236944, 242352, 247760, 253168, 258064, 263472,
268880, 274288, 279696, 285104, 290512, 295920, 301328, 306736, 312144, 317552,
322960, 328368, 333776, 339184, 344080, 349488, 354896, 360304, 365712, 371120,
376528, 381936, 387344, 392752, 398160, 403568, 408976, 414384, 419792, 425200,
Managing Disks - Quick Reference Examples 107