![]() |
![]() |
United States-English | ![]() |
|
|
![]() |
![]() |
Managing Systems and
Workgroups: A Guide for HP-UX System Administrators > Chapter 6 Administering
a System: Managing Disks and Files![]() Managing File Systems |
|
![]() |
This section presents information for managing file systems on a single system. The following topics are discussed: Additional information is available for managing distributed file systems elsewhere; see: For performance strategies helpful in making efficient use of file systems, see: For advice about file system security, see: When creating either an HFS or JFS file system, you can use SAM or a sequence of HP-UX commands. Using SAM is quicker and simpler. The following provides a checklist of subtasks for creating a file system which is useful primarily if you are not using SAM. If you use SAM, you do not have to explicitly perform each distinct task below; rather, proceed from SAM’s “Disks and File Systems” area menu. SAM will perform all the necessary steps for you. If you use HP-UX commands rather than SAM, many of the commands mentioned provide options not shown. Be sure to review the descriptions of the commands in the manpages to see the options available.
Procedure 6-7 Creating a File System You can create a file system either within a logical volume or on a non-LVM disk. However, using a logical volume is strongly encouraged. If you decide not to use a logical volume when creating a file system, skip steps 1 through 4 below, which deal with logical volumes only. Refer to the book Disk and File Management Tasks on HP-UX for more information on creating a file system within a disk section or a whole disk.
This section includes: See also: The process of incorporating a file system into the existing directory structure is known as mounting the file system. The file system can be on a disk or disks connected directly to your system, that is, a local file system, or it can be on a disk on a remote system (see “Importing a File System (HP-UX to HP-UX)”) and it can be on either a logical volume or a non-LVM disk. Mounting a file system associates it with a directory in the existing file system tree. Prior to mounting, the files, although present on the disk, are not accessible to users; once mounted, the file system becomes accessible. The directory in the existing file system where the file is attached is known as the mount point or mount directory for the new file system, and the files in the added file system become part of the existing file system hierarchy. The mount point should be an empty subdirectory on the existing file system. If you mount a file system to a directory that already has files in it, those files will be hidden and inaccessible until you unmount the file system. If you try to mount the file system to a directory whose files are in use, the mount will fail. You can either use SAM or HP-UX commands to mount file systems. If you are using SAM, proceed from SAM’s “Disks and File Systems” area menu. You can perform the necessary tasks as part of creating your file system, as already described. For help in mounting files using SAM, see SAM’s online help; instructions for using HP-UX commands follow. The mount command attaches a file system, on either a non-LVM disk or a logical volume, to an existing directory. You can also use the mountall command or mount -a to mount all file systems listed in the file /etc/fstab. (See mount(1M), mountall(1M) and fstab(4) for details.) To mount a local file system:
Refer to mount(1M) for details and examples.
To mount a file system automatically at bootup, list it in the /etc/fstab file. See the entry for fstab(4) for details on creating /etc/fstab entries. Here are some typical problems that are sometimes encountered when mounting a file system and the actions to take to correct the problem. See also “Troubleshooting NFS”. Table 6-5 Solving Mounting Problems
When you unmount a file system, you make it temporarily inaccessible. Unmounting does not remove the file system from the disk; you can make it accessible again by remounting it. Mounted file systems are automatically unmounted upon executing the shutdown command. See “Unmounting File Systems Automatically at Shutdown ”. You can use either SAM or HP-UX commands to unmount file systems at other times. For help in unmounting file systems using SAM, use SAM’s online help. If you do not use SAM to unmount a file system, you must use the umount command. Refer to umount(1M) for details. You can also use the umountall command to unmount all file systems (except the root file system) or umount -a to unmount all file systems listed in the file /etc/mnttab. (See umount(1M) and mnttab(4) for details.) You can use either SAM or the umount command to unmount file systems located on an NFS remote system. If the server unmounts, the file system disappears from the client; if the client unmounts, this does not affect access to the file system on the server. For information on unmounting NFS file systems using SAM, see SAM’s online help. For information on configuring and troubleshooting NFS mounts, see “Sharing Files and Applications via NFS and ftp ”. When you execute the shutdown command, the system attempts to unmount all of your mounted files systems except for the root file system which cannot be unmounted. For more information on shutdown, refer to “Shutting Down Systems”. If umount fails to unmount a file system, check the following:
A file system can be expanded up to a maximum size of 128GB, except one designated for root or boot which is limited to either 2 or 4GB.
Using SAMIf you use SAM to increase the size of a logical volume that contains a file system, SAM automatically runs extendfs for you. As a result, you can no longer safely reduce the size of a logical volume containing a file system once you extend it using SAM. Using HP-UX CommandsWhen using lvextend to increase the size of the logical volume container, this does not automatically increase the size of its contents. When you first create a file system within a logical volume, the file system assumes the same size as the logical volume. If you later increase the size of the logical volume using the lvextend command, the file system within does not know that its container has been enlarged. You must explicitly tell it this using the extendfs command. (If you are using JFS, see the Note below.)
Suppose the current size of a logical volume is 1024 MB (1 gigabyte). Assuming the users of the file system within this logical volume have consumed 95% of its current space and a new project is being added to their work load, the file system will need to be enlarged. To increase the size of the file system, follow these steps:
Suppose you want to copy a file system from one disk (or disk section) to another, or from one disk or logical volume to another logical volume. For example, you might need to copy a file system to a larger area. If so, here are the steps to follow:
Hardware failures, accidental power loss, or improper shutdown procedures can cause corruption in otherwise reliable file systems.
The following are symptomatic of a corrupt file system:
If you or other users cannot readily identify causes for the difficulties, check the file system for inconsistencies using fsck. fsck, the file system checker, is the primary HP-UX tool for finding and correcting file system inconsistencies. fsck examines the HFS or JFS file system listed in /etc/fstab. If the system fails, reboot the system and run fsck(1M). Additionally, if you suspect that a file system is corrupt, or to do periodic preventive maintenance, you should also check the file system. Refer to fsck(1M), fsck_hfs(1M), and fsck_vxfs(1M) for more information. To check an HFS file system, use the following procedure:
Once you have returned the files in the lost+found directory to their proper locations, restore any files that are missing from your most recent backup.
fsck checks a JFS file system by using an intent log to evaluate changes to the file system. The intent log records all pending changes to the file system structure; that is, all transactions the system intends to make to the file system prior to actually doing the changes. A “replay” of the intent log is very fast and may be no more time consuming for a large file system than a small one because it is dependent on file system activity rather than file system size. As a result, even in the event of a system failure, the system can be up and running again very quickly. In cases of disk failure, scanning the JFS intent log is insufficient; in such instances, you will need to check the entire file system. Do this by using the -o full option of fsck. For further information, refer to fsck_vxfs(1M). Although from an administrative perspective, using fsck to check and correct HFS and JFS file systems is similar, some important differences are summarized in Table 6-7 “HFS vs. JFS File Checking after System Failure ”. Table 6-7 HFS vs. JFS File Checking after System Failure
For more information on fsck, see Disk and File Management Tasks on HP-UX. How to substitute a smaller file system for an existing larger one depends on the type of file system being used and whether or not you are using logical volumes. If you have HP OnLineJFS, you can reduce the size of a file system using a single command (fsadm). (See fsadm_vxfs(1M) for syntax and also Disk and File Management Tasks on HP-UX for further information.) If you do not have OnLineJFS, the steps are identical to those shown below for HFS and depend upon whether you are using logical volumes. If an HFS file system is contained on a non-LVM disk, follow these steps to reduce its size: 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 ”). 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:
Using disk quotas allows the administrator to control disk space usage by limiting the number of files users can create and the total number of system blocks they can use. You implement disk quotas on a local file system and its users by placing soft limits and hard limits on users’ file system usage. Soft limits are limits that can only be exceeded for a specified amount of time. A hard limit can never be exceeded. If users fail to reduce usage below soft limits before the specified time limit or reach a hard limit, they will be unable to create files or increase the size of existing files. Typically, you will set disk quotas on file systems that would otherwise become full without limitations. For example, to prevent users from using /tmp or /var/tmp as storage, set the soft limits small and the time limits for remedial action short. Because disk quota statistics reside in memory, using disk quotas rarely impairs performance. However, the time required to reboot a crashed system will take longer because of the time required to run /usr/sbin/quotacheck whenever the system is booted. You cannot use SAM to perform disk quota tasks. Here are the main steps for setting up and turning on disk quotas:
When you unmount a file system, HP-UX automatically turns off disk quotas. You can turn off disk quotas for a file system without unmounting that file system by using the /usr/sbin/quotaoff command. However, using this command is not recommended because once quotas are turned off, actual disk usage may become inconsistent with the usage information stored in the quotas file, thus requiring quotacheck when quotas are re-enabled. See quotaoff(1M) for more information. After creating a file that causes a soft limit quota to be exceeded, a user on locally mounted file systems will see a message similar to this:
The user has a limited time to remove unnecessary files. The user will receive no further warnings until he attempts to exceed hard limits or allows the time to expire without reducing usage to normal levels. Once a user corrects his usage levels, the system removes any time constraints.
When users reach a hard limit or fail to reduce their usage below soft limits within the allotted time, an error message appears on their terminal. If a user reaches a block limit, the following message appears:
If he reaches a file limit, he sees:
How to recover from reaching a hard limit depends on whether or not the user was using an editor when the message was received. The next sections describe both cases. When Not Using an EditorWhen not using an editor, follow these steps:
When Using an EditorWhen using an editor, the user needs to remove files to a level below the quota limits and still preserve the recent changes made to the file being edited. If possible, a user can do this by opening a new window or by logging in from a remote node. This way, the user can get a shell prompt without aborting the editor. Alternatively, the user can follow these steps:
Or, when using a job-control shell:
Mirroring allows you to simultaneously maintain identical copies of a logical volume containing a file system. As a result, if a disk fails, or if media errors occur to part of a disk, you will still have access to the file system within the mirrored logical volume. It is also possible to mirror a logical volume containing raw data, such as from a database. If you would like to learn more about basic mirroring tasks, it is suggested that you refer to the book Disk and File Management Tasks on HP-UX published by Prentice Hall PTR, 1997. To use mirroring, you will need to purchase MirrorDisk/UX, product number B2491A, for servers. This software product is not bundled with HP-UX and is not supported on workstations. (Mirroring is not supported on HP-IB disks.) You can configure mirroring by using either SAM or HP-UX commands. Whenever possible, use SAM. Using SAMSAM will perform the following mirroring set-up and configuration tasks:
Using HP-UX CommandsTable 6-8 “HP-UX Commands Needed to Create and Configure Mirroring ” summarizes the commands you will need to do mirror set-up and configuration tasks when you do not use SAM. Consult Section 1M of the HP-UX Reference for the appropriate command line options to use. Table 6-8 HP-UX Commands Needed to Create and Configure Mirroring
You can split a mirrored logical volume into two logical volumes to perform a backup on an offline copy while the other copy stays online. When you complete the activity on the offline copy, you can merge the two logical volumes back into one. In order to bring the two copies back in sync, LVM updates the physical extents in the offline copy based on changes made to the copy that remained in use. You can use SAM to split and merge logical volumes, or use lvsplit and lvmerge. After splitting a logical volume that contains a file system, you must
See lvsplit(1M) and lvmerge(1M) for more details. To achieve I/O channel separation, you can either use SAM to create physical volume groups from a subset of LVM disks within a volume group, or use the following commands after completing steps 1 through 3 under “Example: Creating a Logical Volume Using HP-UX Commands”.
To create a mirrored logical volume across physical volume groups completing I/O channel separation, you set strict allocation to apply to the disks that have been separated into physical volume groups. You set the allocation policy when you create the logical volume, either with SAM or with the lvcreate(1M) command.
By using mirror copies of the root, boot, or primary swap logical volumes on another disk, you will be able to use the copies to keep your system in operation if any of these logical volumes fail. To mirror the root file system, you must first add a bootable LVM disk:
Once you have created mirror copies of the root, boot, and primary swap logical volume, should any of these logical volumes fail, the system can use the mirror copy on the other disk and continue. When the failed disk comes back online, it will be automatically recovered, provided the system has not been rebooted. If the system is rebooted before the disk is back online, you will need to reactivate the disk and update the LVM data structures that track the disks within the volume group. You can use vgchange -a y even though the volume group is already active. For example, you can reactivate the disk using:
As a result, LVM scans and activates all available disks in the volume group, vg00, including the disk that came online after the system rebooted. The following diagram shows the disk layout of a boot disk. The disk contains a Master Boot Record (MBR) and Extensible Firmware Interface (EFI) partition tables that point to each of the partitions. The idisk command is used to create the partitions (see idisk(1M)). Before starting the procedure, make sure that add-on product HP MirrorDisk/UX (B5403BA) is installed. This product is an extra-cost product available on the HP-UX 11i application release media. For example:
Certain mirroring tasks cannot be performed by SAM. For the tasks described below, you will have to use the appropriate HP-UX commands. Suppose you have a mirrored logical volume (/dev/vg01/lvol4). The mirror copy is on a disk that you want to remove from the system (/dev/dsk/c7t0d0). There is room on another disk (/dev/dsk/c5t0d0) in the same volume group for the mirror copy. You can move a logical volume’s mirror copy from one disk to another by using the pvmove command (see pvmove(1M)). To move the copy, you issue the following command:
At times, the data in your mirrored copy or copies of a logical volume can become out of sync, or “stale”. For example, this might happen if LVM cannot access a disk as a result of disk power failure. Under such circumstances, in order for each mirrored copy to re-establish identical data, synchronization must occur. Usually, synchronization occurs automatically, although there are times when it must be done manually. Automatic SynchronizationIf you activate a volume group that is not currently active, either automatically at boot time or later with the vgchange command, LVM automatically synchronizes the mirrored copies of all logical volumes, replacing data in physical extents marked as stale with data from nonstale extents. Otherwise, no automatic synchronization occurs and manual synchronization is necessary. LVM also automatically synchronizes mirrored data in the following cases:
Manual SynchronizationIf you look at the status of a logical volume using lvdisplay -v, you can see if the logical volume contains any stale data. You can then identify which disk contains the stale physical extents. You manually synchronize the data in one or more logical volumes using either the lvsync command or all logical volumes in one or more volume groups using the vgsync command. See lvdisplay(1M), vgsync(1M), and lvsync(1M) for more information. In the event you need to replace a nonfunctional mirrored disk, you should perform the following steps to ensure that the data on the replacement disk are both synchronized and valid:
Consult the HP-UX Reference for additional information on any of the above commands.
Normally, if a mirrored disk fails, in order to maintain mirroring you will need to immediately deactivate its volume group and follow the steps above to replace the disk. During this interval, your file system will be unavailable and your data will not have an extra mirrored copy unless you set up double mirroring. Even with double mirroring, your level of safety will be reduced due to the loss of one of your two mirror copies. To prevent this possibility, you can use one or more spare disks within each of your volume groups to serve as substitute devices in the event of disk failure. Once you have done this, LVM will automatically “reconfigure” the volume group so that the spare physical volume will take the place of a failed device without any intervention required. That is, a copy of the data from all the logical volumes currently on the failed disk will be made on the substitute physical volume. This process is referred to as automatic sparing, or just sparing. This occurs while the file system remains available to users. You can then schedule the replacement of the failed disk at a time of minimal inconvenience to you and your users. At such time, you would then copy the data from the spare disk back to the original disk or its replacement and return the spare disk to its role as a “standby” empty disk. Follow the steps below to configure one or more spare physical volumes into each volume group for which you want protection against disk failure. These steps must be performed prior to a disk failure actually occurring.
In order for sparing to occur:
A spare physical volume’s disk space will not be available for extent allocation for any other purpose than in the event of serving as a substitute disk in the event of disk failure. Therefore, its physical extents will not be included in the counts shown under Total PE or Free PE when examining the output of the pvdisplay and vgdisplay commands.
The pvdisplay and vgdisplay commands will provide information on whether a given physical volume is an empty standby spare or currently holding data as a spare in use, along with information on any physical volume that is currently unavailable but whose data has been spared. Once the failed disk has been repaired or a decision has been made to replace it, follow the steps below to reinstate it and return the spare disk back to its former standby status:
To maintain performance, particularly on file systems with very large files, JFS provides the means to reorder disk space to regain contiguous areas on which to write files. This process of defragmentation should be performed periodically.
For more information, consult SAM’s online help. Execute the following to perform both directory and extent reorganization and to generate reports before and after reorganization:
For detailed information, consult fsadm_vxfs(1M). To maintain optimal performance on busy file systems, it may be necessary to defragment them nightly. For example, to defragment every evening at 9 p.m. all the extents and directories within the file system mounted at /home, include the following entry in a file used by cron(1M):
There are three ways to convert an HFS file system to a JFS (vxfs) file system. In choosing which method to use, consider the relative importance of the following factors for your system:
The three methods are:
Use the following table to help evaluate which method best suits your needs. Table 6-9 File System Conversion Methods Comparison
Method 1:
|
![]() |
|
![]() |
Unmount both the old HFS file system and the new JFS file system.
umount /dev/vg00/lvol4 /dev/vg00/lvol5
Mount the new JFS file system in place of the old HFS file system.
mount -F vxfs /home
Use this method to convert an HFS file system to a JFS file system when you want to minimize the space you need to do the conversion and you can afford significant downtime.
Back up your file system data using your favorite backup tool. (See “Backing Up Data” for procedural logistics.) For example, to backup to a DDS (DAT) tape:
![]() |
|
![]() |
Consider how the file system will be used and select mkfs and mount options based on your needs. See mkfs_vxfs(1M) and mount_vxfs(1M) for details. Also see “JFS and the mount Command ” for information about JFS mount options.
Copy the /etc/fstab file to a safe location:
![]() |
|
![]() |
Edit /etc/fstab and comment out the HFS entry for the file system to be converted and add an entry for the new JFS (vxfs) entry. For example:
![]() |
|
![]() |
![]() |
|
![]() |
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: Make a note of which volume group and logical volumes your data resides on (in this example, /opt). You’ll need this information when you create and mount the new file systems. |
![]() | |
![]() |
![]() |
![]() |
If there are ACLs to be converted, record the HFS ACLs and save the information in a file on a different file system. See “Managing Access to Files and Directories” for more information about HFS and JFS ACLs.
In an NFS environment, tell remote users to unmount the affected file system to avoid having stale NFS mounts later.
Warn all users that the system is shutting down.
Bring the system down to single-user mode by using the shutdown command with no parameters:
![]() |
|
![]() |
Create the JFS file system using the mkfs command:
![]() |
|
![]() |
Mount the new file system:
mount -F vxfs /dev/vg00/lvol5 /opt
Restore the file system data from the backup archive created in Step 1 to the file system. For example:
![]() |
|
![]() |
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: Although fbackup saves ACLs, frecover will not retain the ACLs when restoring an HFS backup to a JFS file system. If you have ACLs, you must write and run a script to restore them. |
![]() | |
![]() |
![]() |
![]() |
If there are ACLs to be converted, use the HFS ACL information saved in Step 5 and apply corresponding JFS ACLs to files in the new JFS file system. You may want to write a script to do this. See “Managing Access to Files and Directories” for more information about HFS and JFS ACLs.
Put the system back into multi-user mode:
![]() |
|
![]() |
or
![]() |
|
![]() |
In an NFS environment, tell users of other systems that they can remount the file systems to their systems.
After you have verified that the new JFS file systems are accessible, you can remove the /etc/fstab.save file and edit the /etc/fstab file to remove the commented out lines.
For more information on the commands used in this procedure, see cpio(1), fbackup(1M), frecover(1M), fstab(4), lvcreate(1M), mount_vxfs(1M), mkfs_vxfs(1M), shutdown(1M), and tar(1).
Use this method to convert an HFS file system to a JFS file system when you want automatic ACL conversion (if you have no incompatible ACLs).
![]() | |
![]() |
![]() |
![]() | |
![]() |
WARNING! Do not use vxfsconvert without doing a complete backup of your file system. vxfsconvert is not guaranteed to work on every file system. If the conversion should fail, you will lose your data if you don’t have a backup copy. |
![]() | |
![]() |
![]() |
![]() |
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: vxfsconvert converts HFS access control list (ACL) entries to JFS ACL entries. However, only the entries that comply with the POSIX ACL standard are converted. The compliant entries are those that specify permissions for either a user or a group, but not both. For example, entries of format (user.%) and (%.group) will be converted, while entries of format (user.group) will be omitted. For files with both supported and unsupported entries, all supported entries will be converted, but unsupported entries will be omitted. If the HFS file system you are converting contains unsupported entries, you must write a script to find and convert such entries to supported entries, so that vxfsconvert will convert them to JFS ACLs. |
![]() | |
![]() |
![]() |
![]() |
In an NFS environment, tell remote users to unmount the affected file systems to avoid having stale NFS mounts later.
Unmount the HFS file system. For example:
![]() |
|
![]() |
Make sure the file system is clean. vxfsconvert cannot convert a dirty file system. For example:
![]() |
|
![]() |
If the file system contains non-POSIX ACLs (unsupported in JFS) to be converted, run a script to convert them to supported POSIX ACLs.
Back up your file system data using your favorite backup tool. (See “Backing Up Data” for procedural logistics.) For example:
![]() |
|
![]() |
Run vxfsconvert. For example:
![]() |
|
![]() |
vxfsconvert sets up VxFS metadata and inodes, and converts ACLs. See vxfsconvert(1M) for details.
If you did not specify the -y, -n, or -e option, vxfsconvert prompts you whether to commit the conversion. Respond y to complete the conversion; respond n to stop it.
If you respond y, vxfsconvert replaces the original superblock with the JFS superblock. At this point the file system is a JFS file system and the original HFS file system is no longer accessible. Continue with Step 8.
If you respond n, vxfsconvert does not complete the conversion. You may need to run fsck on the HFS file system.
If vxfsconvert fails, restore the HFS file system from backup. You can then use one of the other conversion methods.
Run fsck to complete the conversion.For example:
![]() |
|
![]() |
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: During pass 4, fsck displays several error messages that require a yes response to complete the conversion. These errors occur because vxfsconvert does not create all metadata files; fsck does. |
![]() | |
![]() |
![]() |
![]() |
Mount the file system.For example:
mount -o rw,suid,delaylog -F vxfs /dev/vg00/lvol5 /opt
If you have the HP OnLineJFS product, run fsadm to reorganize and optimize the file system. For example:
![]() |
|
![]() |
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: If you do not run fsadm to optimize the file system, performance of existing files may degrade. |
![]() | |
![]() |
![]() |
![]() |
In an NFS environment, tell users of other systems that they can remount the file systems to their systems.
For more information on the commands used in this procedure, see cpio(1), fsck_vxfs(1M), mount(1M), tar(1), and vxfsconvert(1M)
JFS file systems can be resized, though the method used depends on whether or not you have the optional HP OnLineJFS product installed.
Using OnLineJFS, you can perform these actions while the file system is in use; that is, without unmounting it.
This procedure assumes that your disk space is managed by LVM. If the file system is not on a logical volume, the disk must have unused space available.
Before proceeding to resize a JFS file system, defragment its directory tree and extents.
fsadm -d -D -e -E /mount_point
Determine how much to increase the size of the file system.
Allocate space for the file system.
Extend the logical volume using SAM or lvextend(1M). Be sure to specify the new size of the logical volume, not the amount of increment.
For example, suppose the file system /home resides in the logical volume /dev/vg4/users_lv. Its current size is 50 MB, as verified by running bdf. You want the new file system (as well as logical volume size) to be 72 MB. Enter:
lvextend -L 72 /dev/vg4/users_lv
Read SAM’s online help or lvextend(1M) for further details.
Resize the JFS file system.
fsadm -b newsize /mount_point
newsize is specified in blocks. Determine the correct number of blocks based on the appropriate file system block size.
In this example, the block size of the file system /home is 1KB. The -b specification is 72 times 1024 = 73728. Thus, the command line would be:
fsadm -b 73728 /home
Verify that the file system’s superblock reflects the expansion. You can do this by executing bdf, df, or fsadm -E.
If newsize is larger than the current size of the file system, the file system will expand to newsize sectors.
If newsize is smaller than the current size of the file system, JFS will attempt to contract the file system to newsize sectors.
Reducing the size of a file system might fail if file system resources occupy the sectors being removed. If this occurs, defragment the file system again; this action might free the resources and allow a subsequent reduction in file system size.
The following procedure will resize a JFS file system without the benefit of the optional HP OnLineJFS product.
Determine how much to increase the size of the file system.
Allocate space for the file system.
Extend the logical volume using SAM or lvextend(1M). Be sure to specify the new size of the logical volume, not the amount of increment.
For example, suppose the file system /home resides in the logical volume /dev/vg4/users_lv. Its current size is 50MB, as verified by running bdf. You want the new file system (as well as logical volume size) to be 72MB. Enter:
lvextend -L 72 /dev/vg4/users_lv
Read SAM’s online help or lvextend(1M) for further details.
Back up the JFS file system, using any backup utility you prefer. Refer to “Backing Up Data” for detailed information on backup logistics.
Run mkfs with the -F vxfs option to recreate a JFS file system of the new size. Refer to mkfs_vxfs(1M) for details.
Restore the JFS file system onto the newly created file system.
See:
Large files (greater than 2 GB) are supported on HP-UX Releases 10.20 and later. When working with large files be aware of these issues:
You cannot perform interactive editing on large files. For example, if you try to run vi on a large file, the following error message appears:
![]() |
|
![]() |
You cannot mail a large file.
You cannot print a large file.
If you want a file system to support large files (greater than 2 GB), then large files must be explicitly enabled, since the default on a system is small files. (A system will not support large files just because it has been updated to a release of HP-UX that supports large files.) An advantage to this is that, if you do not need large files you do not need to enable them on your system, and everything will continue to work as it has in the past.
You can create a large-files file system using the mkfs command or the newfs command. As of the HP-UX 11.0 release, the default behavior of these commands creates a no-large-files file system. However, this default may be changed in a future release of HP-UX. Therefore, it is a good idea to explicitly set either the largefiles or nolargefiles option.
The following examples show different ways to create a large-files file system.
![]() |
|
![]() |
![]() |
|
![]() |
![]() |
|
![]() |
![]() |
|
![]() |
The following examples show different ways to create a file system that will not support large files.
![]() |
|
![]() |
![]() |
|
![]() |
![]() |
|
![]() |
![]() |
|
![]() |
You can change a file system back and forth between large files and no large files using the fsadm command. It is important to realize that the conversion of these file systems must be done on an unmounted file system, and fsck will be called after a successful conversion.
The following example shows how to convert a no-large-files file system to a large-files file system.
![]() |
|
![]() |
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: While converting a no-large-files file system to a large-files file system should always succeed, the same is not true for converting a large-files file system to a no-large-files file system. The latter will succeed only if there are no large files on the file system. If even one large file is detected on the file system being converted, then the fsadm command will not convert the file system. Therefore, to convert a large-files file system that actually has large files on it to a no-large-files file system, you must first remove the large files. |
![]() | |
![]() |
![]() |
![]() |
As of HP-UX Release 10.20 and later all of the file system administration commands for HFS and JFS support large files (greater than 2 GB). All file system user commands support large files.
If a command that does not support large files encounters a large file, the command will return an EOVERFLOW error and print a message like the following:
Value too large to be stored in data type
The fsck(1M) command repairs damaged file systems. Typically, large files should not appear in a no-large-files file system. There are two ways fsck recovers from this situation if a large file does appear.
In the first scenario, you use fsck in the interactive mode. fsck finds a large file on a no-large-files file system, marks the file system dirty and stops. You can then correct the situation using the fsadm command with the -o largefiles option. The fsck command repairs the file system, which you are then able to mount. This scenario would preserve the large file, if fsck did not find it corrupt in any other way.
In the second scenario, using noninteractive mode, fsck purges the large file on a no-large-files file system. fsck assumes the superblock to be accurate based on its accuracy checks since the probability of a superblock being corrupt is insignificant when compared to the instance of a large file manifesting in a no-large-files file system. Consequently, fsck will remove the large file from a file system it believes should not contain large files.
The mount command supports large-files file systems and provides you with a method of ensuring that no large-files file systems are mounted on the system.
The mount command uses the same two options as the mkfs, newfs, and fsadm commands (largefiles and nolargefiles). mount will not mount a large-files file system if the -o nolargefiles option is specified. Conversely, the mount command will not mount a no-large-files file system if the -o largefiles option is specified. If no option is provided to mount, it will use the state of the file system itself to determine if it is mounted as largefiles or nolargefiles.
Refer to:
HP-UX Large Files White Paper Version 1.4
The /etc/ftpd/ftpaccess configuration file is the primary configuration file for defining how the ftpd daemon operates. The /etc/ftpd/ftpaccess file allows you to configure a wide variety of FTP features, such as the number of FTP login tries permitted, FTP banner displays, logging of incoming and outgoing file transfers, access permissions, use of regular expressions, etc. (For complete details on this file, see the ftpaccess(4) manpage.)
To enable the /etc/ftpd/ftpaccess file, specify the -a option for the ftp entry in the /etc/inetd.conf file. For example,
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -a -l -d
(The -l option logs all commands sent to the ftpd server into syslog. The -d option logs debugging information into syslog.)
To disable the /etc/ftpd/ftpaccess file, specify the -A option for the ftp entry in the /etc/inetd.conf file. For example,
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -A -L -d
There are several FTP configuration files that enable you to define how ftp works, as described in the following table.
Table 6-10 FTP Configuration Files
/etc/ftpd/ftpaccess | The primary configuration file defining the operation of the ftpd daemon. For more information see ftpaccess(4). |
/etc/ftpd/ftpconversions | Defines options for compression/decompression and tar/untar operations. For more information see ftpconversions(4). |
/etc/ftpd/ftphosts | Lets you allow/deny FTP account access according to source IP addresses and host names. For more information see ftphosts(4). |
/etc/ftpd/ftpusers |
Restricts FTP access for specified users. For more information see ftpusers(4). |
/etc/ftpd/ftpgroups | The group password file for use with the SITE GROUP and SITE GPASS commands. For more information see ftpgroups(4). |
To verify the path names of all FTP configuration files, enter:
![]() |
|
![]() |
For more information see the ckconfig(1) manpage.
To display the current number of users for each class and the limit for each class of users as defined in the /etc/ftpd/ftpaccess file, enter:
![]() |
|
![]() |
To display the current process information for each user logged into the FTP server, enter:
![]() |
|
![]() |
See the ftpcount(1) and ftpwho(1) manpages for more information
The ftpshut command allows you to create a shutdown message file that warns users before FTP shuts down. The FTP daemon checks this file at intervals to determine the shutdown time. (You must be superuser to execute ftpshut.)
After the shutdown has occurred, you must enter the ftprestart command to remove all the shutdown message files from the real, anonymous, and virtual user accounts. These message files are created by the ftpshut utility.
For details on creating a FTP shutdown message, see the ftpshut(1) and the ftprestart(1) manpages and also Chapter 2 of the Installing and Administering Internet Services manual.
You can specify FTP session logging using the log commands keyword in the /etc/ftpd/ftpaccess file.
log commands |
Enables/disables logging of an FTP session to syslog, including commands, logins, login failures, and anonymous FTP activity. (This entry overrides the -L option specified for the ftp entry in /etc/inetd.conf.) |
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: To enable the /etc/ftpd/ftpaccess file, you must specify the -a option in the ftp entry of the /etc/inetd.conf file. |
![]() | |
![]() |
![]() |
![]() |
For details on the log commands keyword, see the ftpaccess(4) manpage.
You can log file transfer information from the FTP server daemon to the /var/adm/syslog/xferlog log file. The xferlog file records file transfer information such as current time, file transfer time, remote host, file name, file size, whether the file transfer was in ascii or binary format.
To log incoming and outgoing FTP file transfers edit the /etc/ftpd/ftpaccess file, using the log transfers keyword.
log transfers |
Enables/disables logging of file transfers for real or anonymous FTP users to /var/adm/syslog/xferlog. Logging of transfers to the server (incoming) can be enabled separately from transfers from the server (outgoing). |
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: To enable the /etc/ftpd/ftpaccess file you must specify the -a option in the ftp entry of the /etc/inetd.conf file. |
![]() | |
![]() |
![]() |
![]() |
For more information, see the ftpaccess(4) manpage and the xferlog(5) manpage.
Virtual FTP support allows you to manage an FTP server for two separate domains on the same machine.
Using virtual FTP, you can configure systems so that user1 connecting via ftp to ftp.domain1.com gets one FTP banner and FTP directory, while user2 connecting via ftp to ftp.domain2.com gets another banner and directory. (This occurs even though the users are on the same machine and are using the same ports).
For detailed information on setting up virtual FTP support, see Chapter 2 of the Installing and Administering Internet Services manual.
![]() | |
![]() |
![]() |
![]() | |
![]() |
NOTE: Setting up a virtual FTP server requires IP address aliasing. This is supported in HP-UX 10.30 and later. |
![]() | |
![]() |
![]() |
![]() |
![]() |
![]() | |
![]() |
![]() |
![]() | |||||||||||||||
|