Managing Systems and Workgroups: A Guide for HP-UX System Administrators

Administering a System: Managing Disks and Files
Managing File Systems
Chapter 6620
2. Unmount the file system.
3. Create the new smaller file system using newfs. Indicate the new
smaller file system size using the -s
size
option of newfs.
4. Re-mount the file system.
5. Restore the backed up file system data to the newly created file
system.
If You Are Using Logical Volumes
If an HFS file system is contained within a logical volume, the logical
volume resembles a container with the file system as its contents.
Once a particular file system has been created, you cannot simply issue
one command to reduce its size, as you can to extend the file system
(described in “Extending the Size of a File System Within a Logical
Volume” on page 611). First, you must reduce the size of its logical
volume. However, reducing the size of a container too much, that is, to a
size smaller than its file system contents, will destroy part of the file
system’s contents. Once the container is reduced, you must subsequently
recreate a new file system within the container using newfs or SAM, or
else if you attempt to access the original file system, you may crash your
system. The steps you need to follow are shown below:
1. Back up the file system.
2. Unmount the file system.
3. Use lvreduce to reduce the size of the logical volume to the same
size desired for the smaller file system.
4. Create the new smaller file system using newfs. How to do this is
covered earlier in “Creating a File System” on page 603.
5. Re-mount the file system.
6. Restore the backed up file system data to the newly created file
system. (Note that you may no longer have enough space to restore
all your original files.)
Managing Disk Space Usage with Quotas
“Setting Up and Turning On Disk Quotas” on page 621
“Turning Off Disk Quotas” on page 625
“What To Do When Exceeding a Soft Limit” on page 625