Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Managing Systems and Workgroups: A Guide for HP-UX System Administrators > Chapter 6 Administering a System: Managing Disks and Files

Managing File Systems

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

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:

Creating a File System

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.

NOTE: Make sure the disk or disks containing the file system are connected to your computer and configured into HP-UX; refer to Configuring HP-UX for Peripherals if you need further information.

If you create a new file system of a type other than HFS, you might need to reconfigure the new type into the kernel. (Normally, JFS will already have been configured into the kernel as part of the default configuration. See “Reconfiguring the Kernel (Prior to HP-UX 11i Version 2)” if reconfiguration becomes necessary.)

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.

  1. Estimate the Size Required for the Logical Volume

    To estimate the size needed for a logical volume that will contain a file system, see “Setting Up Logical Volumes for File Systems”.

  2. Determine If Sufficient Disk Space Is Available

    To determine if there is sufficient disk space available for the logical volume within its volume group, use the vgdisplay command to calculate this information. vgdisplay will output data on one or more volume groups, including the physical extent size (under PE Size (Mbytes)) and the number of available physical extents (under Free PE). By multiplying these two figures together, you will get the number of megabytes available within the volume group. See vgdisplay(1M) for more information.

  3. Add a Disk to a Volume Group

    If there is not enough space within a volume group, you will need to add a disk to a volume group.

    NOTE: For information on configuring the disk to your system and determining the physical address of the disk, see Configuring HP-UX for Peripherals.

    To add a disk to an existing volume group, use pvcreate(1M) and vgextend(1M). You can also add a disk by creating a new volume group with pvcreate(1M) and vgcreate(1M).

  4. Create the Logical Volume

    Use lvcreate to create a logical volume of a certain size in the above volume group. See lvcreate(1M) for details.

  5. Create the New File System

    Create a file system using the newfs command. Note the use of the character device file. For example:

    newfs -F hfs /dev/vg02/rlvol1

    If you do not use the -F FStype option, by default, newfs creates a file system based on the content of your /etc/fstab file. If there is no entry for the file system in /etc/fstab, then the file system type is determined from the file /etc/default/fs. For information on additional options, see newfs(1M).

    When creating a JFS file system, file names will automatically be long.

    For HFS, use the -S or -L option to specify a file system with short or long file names, respectively. By default, the length of file system names will be consistent with those of the root file system. Short file names are 14 characters maximum. Long file names allow up to 255 characters. Generally, you use long file names for flexibility; files created on other systems that use long file names can be moved to your system without being renamed.

    NOTE: Floppy disk drives are installed on some HP-UX systems. Unlike virtually all HP hard disks, which are initialized before shipping, you need to initialize floppy-disk media using mediainit(1) on the character device file.

    If you decide to put your file system on a floppy disk, invoke the diskinfo command with the character device file to identify the model number of the floppy disk drive; for more information, see diskinfo(1M). Then use the model number as input to the newfs command. (Floppy disk drives do not support the use of LVM.)

    Once you have created a file system, you will need to mount it in order for users to access it.

Mounting File Systems

This section includes:

See also:

Overview

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.

Mounting File Systems Using HP-UX Commands

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.)

Mounting Local File Systems

To mount a local file system:

  1. Choose an empty directory to serve as the mount point for the file system. Use the mkdir command to create the directory if it does not already exist. For example, enter:

    mkdir /joe

  2. Mount the file system using the mount command. Use the block device file name of the file system followed by the name of the mount point, as arguments to the mount command.

    For example, enter

    mount /dev/vg01/lvol1 /joe

Refer to mount(1M) for details and examples.

NOTE: If you are not using logical volumes, run ioscan -fn -H hw_path to determine the block device file name to use.

You can use lssf to display the location associated with the device file and compare it with the actual hardware address of the disk. You can also use ioscan to display the devices connected to your system and their hardware path.

If the block device file does not exist, create it using insf or mksf.

See Configuring HP-UX for Peripherals, lssf(1M), ioscan(1M), insf(1M), and mksf(1M) for more information on these commands.

Mounting File Systems Automatically at Bootup

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.

Solving Mounting Problems

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

Problem

Solution

The mount fails and you get an error message indicating Device busy.

Make sure that another file system is not already mounted to the directory (only one file system can be mounted to a single mount point.) You will also get this message if the mount directory is being used as someone’s working directory or if a user has an open file within the mount directory. (You can use fuser(1M) to check who has an open file within the mount directory.)

The mount fails with the message No such file or directory.

  • The device associated with the device file you’re trying to mount doesn’t exist, is not physically attached, or is not in a “ready” state. If you have never mounted this device before, check your block device file name to be sure that it has the proper characteristics.

  • Verify that the local directory exists on the client. If it does not exist, create it using mkdir. For example:

    mkdir /opt/adobe

/etc/mnttab is out-of-date with kernel data structures.

Update /etc/mnttab using the mount command without any options.

You get an error indicating /etc/mnttab does not exist or that mount had an “interrupted system call” when you try to mount a file system.

/etc/mnttab is normally created, if it does not already exist, within /sbin/init.d/localmount when you boot up your computer. If you get one of these messages, /etc/mnttab does not exist. Recreate it using the mount command without any options.

On a T-class system, after adding many file systems to /etc/fstab and executing mount -a, you get a message including the words table is full.

See “Reconfiguring the Kernel (Prior to HP-UX 11i Version 2)”.

 

Unmounting File Systems

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.)

Unmounting NFS File Systems

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 ”.

Unmounting File Systems Automatically at Shutdown

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”.

Solving Unmounting Problems

If umount fails to unmount a file system, check the following:

  • Are all files closed on the particular file system to be unmounted? Attempting to unmount a file system that has open files (or that contains a user’s current working directory) causes umount to fail with a Device busy message.

    For example,

    fuser -cu /work

    displays process IDs and users with open files in /work, and whether it is anyone’s working directory.

    To kill the processes, enter

    fuser -ku /work

    You can also use ps -ef to check for processes currently being executed and map fuser output to a specific process.

    See fuser(1M) and ps(1) for more information.

  • Are you attempting to unmount the root (/) file system? You cannot do this.

  • Are you attempting to unmount a file system that has had file system swap enabled on that disk using SAM or swapon? You cannot do this either. To solve this problem, you will need to remove the file system swap and reboot. To display file system swap, run swapinfo and look under the column labeled Type for designation fs. Any entry labeled as such is file system swap, which must be removed before you can unmount the file system. See swapinfo(1M) or “Adding, Modifying, or Removing File System Swap ” for more information.

CAUTION: Always unmount file systems contained on a mass storage device before removing the device from the system. Removing a device containing mounted file systems (for example, disconnecting or turning off the power to a disk, or removing a disk pack from a mass storage device) will likely corrupt the file systems.

Extending the Size of a File System Within a Logical Volume

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.

NOTE: If you are still using non-LVM disks, you should consider converting to logical volumes. Logical volumes allow you greater flexibility in dividing up and managing disk space.

Using SAM

If 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 Commands

When 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.)

NOTE: If you are using JFS and you have the HP OnLineJFS product, run the fsadm command to increase the size of a file system. See fsadm_vxfs(1M) for information on syntax. Further information is also available in Disk and File Management Tasks on HP-UX.

If you are using JFS but do not have HP OnLineJFS, use the steps below, or, back up the file system and create a larger file system using newfs.

Sample Procedure to Increase the Size of a Logical Volume

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:

  1. Unmount the file system.

    umount /dev/vg01/lvol1
  2. Increase the size of the logical volume.

    /usr/sbin/lvextend -L 1200 /dev/vg01/lvol1

    Note that the -L 1200 represents the new logical volume size in MB, not the increment in size.

  3. Increase the file system capacity to the same size as the logical volume. Notice the use of the character device file name.

    extendfs /dev/vg01/rlvol1
  4. Remount the file system.

    mount /dev/vg01/lvol1 /project
  5. Run bdf to confirm that the file system capacity has been increased.

Copying a File System Across Devices

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:

  1. If you will be overwriting the existing file system, back up files from the current device onto tape.

  2. If necessary, add the new disk or create the new logical volume.

  3. Create one or more new file systems on your new disk, section, or logical volume.

  4. Create/Edit an entry in the /etc/fstab file to automatically mount each file system at bootup.

  5. Mount each new file system.

  6. If you backed up the files, restore them to the file systems on the new device. Otherwise, merely copy all files on the old file system to the new device using cp or cpio.

Dealing with File System Corruption

Hardware failures, accidental power loss, or improper shutdown procedures can cause corruption in otherwise reliable file systems.

CAUTION: To ensure file system integrity, always follow proper shutdown procedures as described in “Shutting Down Systems”.

Never take a system offline by merely shutting its power off or by disconnecting it.

Diagnosing a Corrupt File System

The following are symptomatic of a corrupt file system:

  • A file contains incorrect data (garbage).

  • A file has been truncated or has missing data.

  • Files disappear or change locations unexpectedly.

  • Error messages appear on a user’s terminal, the system console, or in the system log.

  • You are unable to change directories or list files.

  • The system fails to reboot, possibly as a result of one or more errors reported by the /sbin/bcheckrc script during bootup.

If you or other users cannot readily identify causes for the difficulties, check the file system for inconsistencies using fsck.

Locating and Correcting Corruption 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.

Checking an HFS File System

To check an HFS file system, use the following procedure:

  1. Before running fsck, make sure that a lost+found directory is present and empty at the root for each file system you plan to examine. fsck places any problem files or directories it finds in lost+found.

    If lost+found is absent, rebuild it using mklost+found(1M).

  2. For mountable file systems, prepare to unmount the file system by terminating all processes running on it, closing any open files.

    For the root file system, execute shutdown (without -h or -r) to enter the single-user state. The root file system cannot be unmounted.

  3. Unmount the (mountable) file system using SAM or the umount command.

  4. Run fsck.

    NOTE: The -n or -N options run fsck in nondestructive mode, and are the safest options available. You can run them on a mounted file system as a precautionary measure when you suspect you might be having problems.

    The following text documents the traditional -p option in more detail.

    The -p option of fsck allows you to fix many file system problems, running noninteractively. (See fsck(1M) for information on syntax and options.) If fsck either finds no errors or finds correctable errors, it corrects any such errors and prints information about the file system it checked. If fsck encounters a problem it cannot correct while running with the -p option, it will terminate with an error message.

  5. Use the following table to determine what to do next based on three possible outcomes:

    Table 6-6 fsck Results

    If fsck reports...

    Proceed to...

    Then...

    No errors

    Step 6

    You are done

    Errors and corrects them all

    Step 7

    Step 10

    Any uncorrectable errors with an error message

    Step 8

    Step 9

     
  6. Check for other causes of the problem.

    If fsck runs without finding errors, the problem is not a corrupted file system. In this case, consider other possible causes of problems with files:

    • A user deleted, overwrote, moved, or truncated the file(s) in question.

    • A program/application deleted, overwrote, moved, or truncated the file(s).

    • The file system associated with a particular directory when a file was created might not be mounted to that directory at this time (if any are).

    • A file (or group of files) was placed in a directory that now has a file system mounted to it. The files that were in the directory before you mounted the current file system still exist, but won’t be accessible until you unmount the file system that is covering them.

    • The protection or ownership bits on the file prevent you from accessing it.

    Because your file system is not corrupt, do not continue with the remaining steps in this procedure.

  7. Restore any necessary files.

    Once fsck finds and corrects all errors it locates in the file system, you may assume that the file system is again structurally sound. If any necessary files were lost, restore them from a backup or from lost+found. Once fsck has repaired the damage, proceed to Step 10.

  8. Prepare to run fsck interactively.

    If fsck terminates without correcting all the errors it found, you must run fsck interactively.

    Before doing so, move any critical files on this file system that have not yet been backed up (and are still intact) to another file system or try saving them to tape.

    When you run fsck interactively, it may need to perform actions that could cause the loss of data or the removal of a file/file name (such as when two files claim ownership of the same data blocks). Because of this, any backups of this file system at this point are likely to fail. This is another reason you should back up your system regularly!

    IMPORTANT: Empty the lost+found directory before running fsck again.
  9. Run fsck interactively by reexecuting fsck without the -p or -P option.

    As fsck encounters errors, it will request permission to perform certain tasks. If you do not give fsck permission to perform the correction, it will bypass the operation, leaving the file system unrepaired.

    After running interactively, in many cases fsck will request you do a reboot -n. Failing to do so might re-corrupt your file system. (Note, do not use reboot -n for normal rebooting activities.)

  10. Examine files in the lost+found directory.

    Once fsck has repaired the file system, mount the file system and check its lost+found directory for any entries that might now be present. These are files, listed by inode number, that have lost their association with their original directories. Examine these files, determine their name, and return them to their proper location. To do this,

    • Use the file command to determine file type.

    • If they are ASCII text files, you can review them using cat or more to see what they contain.

    • If they are some other type, you will have to use a utility such as xd or od to examine their contents.

    • Run the commands what or strings to help you find the origin of your lost+found files.

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.

IMPORTANT: The following message
CAN'T READ BLOCK ...

may indicate a media problem that mediainit(1) can resolve. Otherwise, hardware failure has probably occurred; in this case, contact your local sales and support office.

Checking a JFS File System

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).

Differences between HFS and JFS File Checking

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

Concern

HFS

JFS

What needs to be checked?

The entire file system. This can be time consuming. As the size of the file system increases, the time required for fsck will increase.

The intent log only. This may be no more time consuming for a large file system than a small one.

What assurance is there of file system integrity?

No assurance fsck can repair a file system after a crash, although it usually can; is sometimes unable to repair a file system that crashed before completing a file system operation. Even a repairable file system has no guarantee its structure will be preserved: fsck puts “orphan files” into the lost+found directory.

Complete assurance of file system integrity following a crash (excepting disk failure). JFS ensures any transaction pending when the system crashes will either be completed entirely or returned to its pre-transaction state.

What do I do in the event of a disk failure?

The file system must be scanned from beginning to end for inconsistencies, with no assurances of file system integrity.

As with HFS, the file system must be scanned from beginning to end for inconsistencies, with no assurances of file system integrity.

 

For more information on fsck, see Disk and File Management Tasks on HP-UX.

Replacing an Existing File System with a Smaller One

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 Are Using JFS

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 You Are Not Using Logical Volumes

If an HFS file system is contained on a non-LVM disk, follow these steps to reduce its size:

  1. Back up the file system.

  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 ”). 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”.

  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

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.

Setting Up and Turning On Disk Quotas

Here are the main steps for setting up and turning on disk quotas:

  1. Mount the file system.

    Suppose you want to implement quotas on /home, which is accessed via the device file /dev/vg00/lvol3. This file system will be mounted automatically at bootup if it is listed in your /etc/fstab file. If the file system is not mounted, enter:

    mount /dev/vg00/lvol3 /home
  2. Create a quotas file.

    Use the cpset command to create an empty file named quotas within the directory. This file will contain, in binary form, the limits and usage statistics for each user to be limited in creating files within the file system. For example, to install the quotas file for the mounted /home file system, enter:

    cpset /dev/null /home/quotas 600 root bin

    In this example, /dev/null specifies that the file created is empty, /home/quotas specifies that the file quotas is to be in /home directory, and 600 root bin is the mode, owner, and group of the file. For syntax, see cpset(1M).

    NOTE: To control the size of the quotas file, refrain from using large user identification numbers (UIDs). This will not be a concern if you use SAM to add users because SAM selects the UIDs in numerical order.
  3. Set the user quotas.

    Use the /usr/sbin/edquota command to set or subsequently modify quotas of individual users. The edquota utility creates a temporary file for a text representation of disk quotas for a user and invokes an editor. Once you enter the quotas and leave the editor, the text is converted to binary form for storing within the quotas file. For syntax, see edquota(1M).

    To set uniform limits for users in a file system, create limits for one or more initial users, then apply those limits to the remaining users. For example, the following shows how to assign limits for a typical user whose home directory is within the file system /home and then implement those limits to other users. For this example, assume these limits: a soft limit of 10,000 blocks, a hard limit of 12,000 blocks, a soft limit of 250 files, and a hard limit of 300 files.

    1. Set the limits for a prototype user, patrick.

      1. Invoke the quota editor:

        edquota patrick
      2. To input the disk-usage limits, type the following:

        fs /home blocks (soft = 10000, hard = 12000) \
          inodes (soft = 250, hard = 300)

        There must be one such line for every file system with a quotas file. Be sure to type the line exactly as shown in order to get the correct spacing between items. Bad formatting and/or typographical errors may cause incorrect setting of quotas.

      3. Save the file. This updates the quotas file. Exit the editor.

    2. Apply the prototype user’s limits to other users of the /home file system:

      edquota -p patrick alice ellis dallas

      This assigns the limits of the prototype user, patrick, to the other users, alice, ellis, and dallas.

    NOTE: When removing a user from the system, run edquota and set the user’s limits to zero. Thus, when the user is removed from the system, there will be no entry for that user in the quotas file.
  4. Set time limits, unless you wish to apply default time limits of one week in which case no action is required.

    Use the edquota command with the -t option to set the time limit users will have to take corrective action when exceeding a soft limit. Unlike limits on files and blocks, a single time limit applies uniformly to all users of a file system.

    For example, to edit the quotas file and set a time limit of 10 days for file system blocks and 15 days for files in the file system /home, enter the following:

    1. Invoke the quota editor:

      edquota -t
    2. To input a time limit, type the following:

      fs /home blocks time limit = 10.00 days,files time limit = 15.00 days

      Be sure to type the line as shown with the correct spacing between items. Bad formatting and typographical errors may cause incorrect setting of quotas.

      The default time limit for both file system blocks and files is seven days. You can specify the default time limits by entering zeros in fields where you would specify the limits. For example, to implement default limits for the /home file system, enter this line:

      fs /home blocks time limit = 0, files time limit = 0
    3. Save the file and exit the editor.

  5. Turn on quotas.

    Disk quotas can be enabled in any of the following ways:

    • Turn on disk quotas when rebooting.

      If you want disk quotas to be turned on automatically when the system starts up, add the quota option to the file system entry in the /etc/fstab file. For example:

      /dev/vg00/lvol3 /home hfs rw,suid,quota 0 2
    • Turn on disk quotas by re-mounting the file system.

      Disk quotas can be turned on when you mount a file system with the quota option of the mount command. To do this, you must first unmount the file system. For example:

      umount /dev/vg00/lvol3
      mount -o quota /dev/vg00/lvol3 /home

      Note that if you have already added the quota option to the /etc/fstab file (see above), you do not need to specify the quota option to the mount command. Instead, simply specify one of the following commands:

      mount -a 

      or

      mount /home 

      After remounting the file system, you must run quotacheck on the file system to update usage information stored in the quotas file.

    • Turn on disk quotas using the quotaon command.

      If you want to enable quotas on a file system, but are unable to unmount the file system (perhaps because it is being used), follow these steps. (These steps will also work for the root (/) file system.)

      1. Use the /usr/sbin/quotaon command to turn on disk quotas for a mounted file system for which disk quotas are set up, but not currently turned on. The file quotas must exist in the mount directory of the file system. For example, issuing the command

        quotaon -v /home

        starts quotas on the /home file system. The -v (verbose) option generates a message to the screen listing each file system affected. This command has no effect on a file system for which quotas are already turned on.

        You can also specify the -a option, which turns on disk quotas for all mounted file systems listed in the file /etc/fstab that include the quota option. See quotaon(1M) for more information.

      2. Check the file system for consistency. For example:

        quotacheck /dev/vg00/lvol3

        See quotacheck(1M) for syntax.

Turning Off 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.

What To Do When Exceeding a Soft Limit

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:

WARNING: disk quota (/home) exceeded

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.

NOTE: Users of remote file systems (such as NFS mounts) will not receive soft limit warnings. Thus, users having quotas on remote file systems can reach hard limits without prior warning, so they should frequently check their usage levels using the /usr/bin/quota command. For details on checking levels, see quota(1). Only a user with superuser privileges can use the user option of the quota command to view specific usage and quota information about other users.

What To Do When Exceeding a Hard Limit

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:

DISK LIMIT REACHED - WRITE FAILED

If he reaches a file limit, he sees:

FILE LIMIT REACHED - CREATE FAILED

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 Editor

When not using an editor, follow these steps:

  1. Abort the process or processes that are using the file system.

  2. Remove enough files to lower the number of files and/or file system blocks below the soft limits established in the quotas file.

    The quota command reports whether a user is above or below the limit in the specific file system. To determine the current number of blocks in files and directories, use the du or the find command (see du(1) and find(1) for details).

  3. Run the aborted processes again.

When Using an Editor

When 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:

  1. Write the file to another file system (such as /var/tmp) where quotas are not exceeded.

  2. Exit the editor.

  3. Remove files until the remaining number is well below the file and/or file system block quotas determined by the soft limits.

  4. Move the file back into the original file system.

Or, when using a job-control shell:

  1. Go to the shell and type a “suspend” character (for example, pressing the CTRL and Z keys at the same time) to suspend the editor.

  2. Remove files until the number remaining is below the file and/or file system block quotas.

  3. Type fg at the shell prompt to return to the editor.

Managing Mirrored File Systems

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.)

Creating and Modifying Mirrored Logical Volumes

You can configure mirroring by using either SAM or HP-UX commands. Whenever possible, use SAM.

Using SAM

SAM will perform the following mirroring set-up and configuration tasks:

  • Creating or removing a mirrored logical volume.

  • Configuring or changing the characteristics of a logical volume’s mirrors. You can specify:

    • the number of mirror copies.

    • strict (including choice of using separate physical volume groups) vs. nonstrict allocation.

    • the Mirror Write Cache or the Mirror Consistency Recovery method.

    • parallel, sequential, or dynamic scheduling policy.

    • contiguous allocation vs. noncontiguous allocation.

NOTE: The logical volume feature in SAM related to mirroring will not function unless the MirrorDisk/UX subsystem has been added to the system.
Using HP-UX Commands

Table 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

Task

Commands and Options Needed

Creating a mirrored logical volume.

Subtasks:

Setting strict or nonstrict allocation.

Setting the Mirror Write Cache method.

Setting the Mirror Consistency Recovery method.

Setting parallel or sequential scheduling policy.

Setting contiguous allocation vs. noncontiguous allocation.

Creating a mirror copy within separate physical volume groups.

lvcreate -m

Add:

-s y or -s n

-M y or -M n

-c y or -c n

-d p or -d s

-C y or -C n

-s g

Removing a mirrored logical volume.

lvremove

Increasing the number of mirror copies.

lvextend -m

Reducing the number of mirror copies.

lvreduce -m

Changing logical volume characteristics.

Subtasks:

Same tasks and options as for lvcreate above.

lvchange

Add:

(see above)

Creating physical volume groups to mirror across separate I/O channels.

  1. vgcreate

  2. vgextend

Designating/changing whether a physical volume will serve as a spare physical volume within the volume group.

One of:

  • vgextend -z y

  • vgextend -z n

  • pvchange -z y

  • pvchange -z -n

 

Doing an Online Backup by Splitting a Logical Volume

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

  1. Perform a file system consistency check on the logical volume to be backed up using the fsck command.

  2. Mount the file system.

  3. Back it up.

  4. Unmount it.

  5. Merge it back with the online copy.

See lvsplit(1M) and lvmerge(1M) for more details.

Achieving I/O Channel Separation

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”.

  1. Create a physical volume group within a new volume group by naming the physical volume group using the -g option of vgcreate(1M).

  2. Extend your volume group to contain another physical volume group using the -g option of vgextend(1M).

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.

NOTE: To prevent the loss of flexibility that occurs when you create physical volume groups, you may want to use lvextend, which allows you to specify particular physical volumes. See “Extending a Logical Volume to a Specific Disk ” for more information.

Mirroring Root, Boot, and Primary Swap Logical Volumes for HP 9000 (PA-RISC) Systems

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:

  1. Create a physical volume using pvcreate with the -B option.

    pvcreate -B /dev/rdsk/c0t3d0
  2. Add the physical volume to your existing root volume group with vgextend:

    vgextend /dev/vg00 /dev/dsk/c0t3d0
  3. Use mkboot(1M) to place boot utilities in the boot area:

    mkboot /dev/rdsk/c0t3d0
  4. Use mkboot -a to add an AUTO file in boot LIF area:

    mkboot -a "hpux (;0)/stand/vmunix" /dev/rdsk/c0t3d0
    NOTE: This example includes creating a mirror copy of the primary swap logical volume. The primary swap mirror does not need to be on a specific disk or at a specific location, but it does need to be allocated on contiguous disk space. The recommended mirror policy for primary swap is to have the Mirror Write Cache and the Mirror Consistency Recovery mechanisms disabled.

    When primary swap is mirrored and your primary swap device also serves as a dump area, you must make sure that Mirror Write Cache and Mirror Consistency Recovery is set to off at boot time to avoid loss of your dump. To reset these options, you will need to reboot your system in maintenance mode. Then use the lvchange command with the -M n and -c n options.

  5. Use the lvextend command to mirror each logical volume in the root volume group onto the specified disk. The logical volumes must be extended in the same order that they are configured on the original boot disk. Use the pvdisplay command with the -v option to determine the list of logical volumes and their order. For example:

    pvdisplay -v /dev/dsk/c0t6d0 | grep ’current.*0000$’
       00000 current  /dev/vg00/lvol1    00000
       00038 current  /dev/vg00/lvol2    00000
       00550 current  /dev/vg00/lvol3    00000
       00583 current  /dev/vg00/lvol4    00000
       00608 current  /dev/vg00/lvol5    00000
       00611 current  /dev/vg00/lvol6    00000
       00923 current  /dev/vg00/lvol7    00000
       01252 current  /dev/vg00/lvol8    00000

    In this example, mirror the logical volumes as follows:

    lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t3d0
    lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t3d0
    lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t3d0
    lvextend -m 1 /dev/vg00/lv0l4 /dev/dsk/c0t3d0
    lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c0t3d0
    lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c0t3d0
    lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c0t3d0
    lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c0t3d0
  6. Update the root volume group information:

    lvlnboot -R /dev/vg00
  7. Display the BDRA. Verify that the mirrored disk is displayed as a boot disk and that the boot, root, and swap logical volumes appear to be on both disks:

    lvlnboot -v
  8. Specify the mirror disk as the alternate boot path in nonvolatile memory:

    setboot -a path_to_disk
  9. Add a line to /stand/bootconf for the new boot disk using vi or another text editor:

    vi /stand/bootconf
    l /dev/dsk/c0t3d0

    where l denotes LVM.

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:

vgchange -a y /dev/vg00

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.

Mirroring a Boot Disk with LVM on HP-UX 11i for HP Integrity Servers

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)).

Figure 6-5 Example LVM Disk Layout on HP Integrity Server

Example LVM Disk Layout on HP Integrity Server

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:

swlist -l fileset | grep -i mirror
LVM.LVM-MIRROR-RUN B.11.22 LVM Mirror
  1. Partition the disk using the idisk command and a partition description file.

    1. Create a partition description file. For example:

      vi /tmp/idf

      In this example the partition description file contains:

      3
      EFI 500MB
      HPUX 100%
      HPSP 400MB
      NOTE: The values in the example represent a boot disk with three partitions: an EFI partition, an HP-UX partition, and an HP Service partition. Boot disks of earlier HP Integrity Servers may have an EFI partition of only 100MB and may not contain the HPSP partition.
    2. Partition the disk using idisk and your partition description file:

      idisk -f /tmp/idf -w /dev/rdsk/c3t1d0
    3. To verify you can run:

      idisk /dev/rdsk/c3t1d0
  2. Use the insf command with the -e option to create the device files for all the partitions. For example:

    insf -e -H 0/18/1/2/0.0.1.0

    You should now have eight device files for this disk:

    /dev/[r]dsk/c?t?d?
            (This refers to the entire disk)
    /dev/[r]dsk/c?t?d?s1
            (This refers to the EFI partition)
    /dev/[r]dsk/c?t?d?s2
            (This will be the HP-UX partition)
    /dev/[r]dsk/c?t?d?s3
            (This refers to the Service partition)
  3. Use pvcreate to make the HP-UX partition of the disk an LVM managed disk:

    pvcreate -B /dev/rdsk/c3t1d0s2
  4. Add the disk to vg00:

    vgextend vg00 /dev/dsk/c3t1d0s2
  5. Place the boot files on the disk using mkboot:

    mkboot -e -l /dev/rdsk/c3t1d0
  6. Copy any autoboot file from the original boot disk to this one.

    1. Use efi_cp to copy the AUTO file from the original boot disk’s EFI partition to the current directory. Make sure to use the device file with the s1 suffix, as it refers to the EFI partition:

      efi_cp -d /dev/rdsk/cntndns1 -u /efi/hpux/auto ./AUTO
    2. Copy the file from the current directory into the new disk’s EFI partition:

      efi_cp -d /dev/rdsk/c3t1d0s1 ./AUTO /efi/hpux/auto
  7. Use the lvextend command to mirror each logical volume in the root volume group onto the desired physical volume. The logical volumes must be extended in the same order that they are configured on the original boot disk. Use the pvdisplay command with the -v option to determine the list of logical volumes and their order. For example:

    pvdisplay -v /dev/dsk/c0t0d0s2 | grep ’current.*0000$’
       00000 current  /dev/vg00/lvol1    00000
       00038 current  /dev/vg00/lvol2    00000
       00550 current  /dev/vg00/lvol3    00000
       00583 current  /dev/vg00/lvol4    00000
       00608 current  /dev/vg00/lvol5    00000
       00611 current  /dev/vg00/lvol6    00000
       00923 current  /dev/vg00/lvol7    00000
       01252 current  /dev/vg00/lvol8    00000

    In this example, mirror the logical volumes as follows:

    lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c3t1d0s2
    lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c3t1d0s2
    lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c3t1d0s2
    lvextend -m 1 /dev/vg00/lv0l4 /dev/dsk/c3t1d0s2
    lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c3t1d0s2
    lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c3t1d0s2
    lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c3t1d0s2
    lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c3t1d0s2

    If lvextend fails with following message:

    "m": Illegal option

    then HP MirrorDisk/UX is not installed.

  8. Update the root volume group information:

    lvlnboot -R /dev/vg00
  9. Display the BDRA. Verify that the mirrored disk is displayed as a boot disk and that the boot, root, and swap logical volumes appear to be on both disks:

    lvlnboot -v
  10. Specify the mirror disk as the alternate boot path in nonvolatile memory:

    setboot -a path_to_disk
  11. Add a line to /stand/bootconf for the new boot disk using vi or another text editor:

    vi /stand/bootconf
    l /dev/dsk/c3t1d0s2

    where l denotes LVM.

Mirroring Tasks that Must be Done Using HP-UX Commands

Certain mirroring tasks cannot be performed by SAM. For the tasks described below, you will have to use the appropriate HP-UX commands.

Moving a Mirrored Logical Volume to Another Disk

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:

pvmove -n /dev/vg01/lvol4 /dev/dsk/c7t0d0   /dev/dsk/c5t0d0
Synchronizing a Mirrored Logical Volume

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 Synchronization

If 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:

  • When a disk comes back online after experiencing a power failure.

  • When you extend a logical volume by increasing the number of mirror copies, the newly added physical extents will be synchronized.

Manual Synchronization

If 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.

Replacing a Mirrored Disk

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:

  1. Before replacing the disk, minimize any potential loss of data due to its removal; confirm that any mirrored logical volumes using the disk are mirrored onto a separate disk and that those mirror copies are current. You can find the list of logical volumes using the disk using pvdisplay:

    pvdisplay -v /dev/dsk/cntndn

    For each of those logical volumes, you can use lvdisplay to check which logical extents are mapped onto the disk, and if there’s a current copy of that data on another disk, as discussed in “Synchronizing a Mirrored Logical Volume”:

    lvdisplay -v /dev/vol_group/lvoln | grep /dev/dsk/cntndn

  2. Run vgcfgbackup to save the volume group configuration information, if necessary:

    vgcfgbackup /dev/vol_group

  3. Remove the disk from the volume group, if desired, using vgreduce.

    Otherwise, if any of the logical volumes on the disk have a timeout assigned that isn’t the default (zero), temporarily disable the timeout. For each logical volume:

    lvchange -t 0 /dev/vol_group/lvoln

  4. Physically disconnect the bad disk and connect the replacement.

  5. If you are replacing a mirror of the boot disk, set up the boot area on the disk.

    1. If this is an HP Integrity Server, partition the disk using the idisk command, as described in “Mirroring a Boot Disk with LVM on HP-UX 11i for HP Integrity Servers”. You do not need to run insf or pvcreate, since you are replacing an existing physical volume.

    2. Use the mkboot command to set up the boot area:

      mkboot /dev/rdsk/cntndn

      On HP Integrity Servers, use the -e and -l options to the mkboot command to copy EFI utilities to the EFI partition:

      mkboot -e -l /dev/rdsk/cntndn

    3. Update the root volume group information:

      lvlnboot -R /dev/vg00

  6. Run vgcfgrestore to restore LVM configuration information to the added disk:

    vgcfgrestore -n /dev/vol_group /dev/rdsk/cntndn

  7. Run vgchange -a y to reactivate the volume group to which the disk belongs. Since the volume group is already currently active, no automatic synchronization occurs:

    vgchange -a y /dev/vol_group

  8. If any of the logical volumes on the disk had a nondefault timeout assigned, restore the previous timeout:

    lvchange -t value /dev/vol_group/lvoln

  9. Now run vgsync to manually synchronize all the extents in the volume group:

    vgsync /dev/vol_group

Consult the HP-UX Reference for additional information on any of the above commands.

NOTE: You can use the same procedure to replace a disk that contains unmirrored logical volumes. However, by removing the disk, you will permanently lose any unmirrored data on that disk. Therefore, before starting this procedure, confirm that you have a backup of any unmirrored logical volume, then halt any applications using it, and unmount any file system mounted on it. After replacing the disk and activating the volume group, do not use those unmirrored logical volumes until you have recovered them from backup.
Maintaining High Availability in the Event of Disk Failure

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.

NOTE: MirrorDisk/UX is not available for shared LVM environments within a high availability cluster. Since MirrorDisk/UX is required for sparing, you will not be able to configure sparing using the steps below within such shared LVM environments. In such cases, it is suggested that you make use of hardware mirroring through RAID devices. Hardware mirroring often supports its own form of sparing.
  1. Use the pvcreate command to initialize the disk as an LVM disk. However, do not use the -B option since spare physical volumes cannot contain boot information.

    # pvcreate /dev/rdsk/c1t0d0
  2. Make sure the volume group has been activated.

    vgchange -a y /dev/vg01
  3. Use the vgextend command with -z y to designate one or more physical volumes as spare physical volumes within the volume group. Alternately, you can change a physical volume with no extents currently allocated within it into a spare physical volume using the pvchange command with the -z y option.

    vgextend -z y /dev/vg01 /dev/dsk/c1t0d0

In order for sparing to occur:

  • All logical volumes in the volume group must have been configured with strict mirroring whereby mirrored copies are maintained on separate disks. This is because LVM copies the data on to the spare from an undamaged disk rather than from the defective disk itself.

  • At least one physical volume must be available as a “standby” spare; if your last spare is already in use as a result of a prior disk failure, it cannot serve as a currently available spare.

  • The available spare must be at least as large as the failed disk.

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.

NOTE: If it is important to maintain comparable performance in the event of disk failure, you should configure a spare physical volume to each bus. However, in the event that more than one disk on the same bus fails, even with this strategy, there will be some performance impact.

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.

Reinstating a Spare Disk

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:

  1. Physically connect the new or repaired disk.

  2. Make sure the volume group has been activated:

    vgchange -a y /dev/vg01

  3. Restore the LVM configuration to the reconnected disk using vgcfgrestore.

  4. Make sure that allocation of extents is now allowed on the replaced disk:

    pvchange -x y /dev/dsk/c0t0d0

  5. Use pvmove to move the data from the spare back to the replaced physical volume. As a result, the data from the spare disk is now back on the original disk or its replacement and the spare disk is returned to its role as a “standby” empty disk.

    pvmove /dev/dsk/c1t0d0 /dev/dsk/c0t0d0

Defragmenting a JFS File System

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.

To defragment a JFS file system using SAM

  1. Execute sam.

  2. Select Disks and File Systems functional area.

  3. Select the File Systems application.

  4. Select the desired JFS (VxFS) file system.

  5. Select the Actions menu.

  6. Select the VxFS Maintenance menu item.

  7. You can choose to view reports on extent and directory fragmentation.

  8. Select Reorganize Extents and/or Reorganize Directories to defragment your JFS file system.

For more information, consult SAM’s online help.

To defragment a JFS file system using fsadm

Execute the following to perform both directory and extent reorganization and to generate reports before and after reorganization:

fsadm -d -D -e -E /mount_point

For detailed information, consult fsadm_vxfs(1M).

Daily Defragmentation

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):

0 21 * * * fsadm -d -e /home

Converting Existing File Systems to JFS

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:

  • available disk space

  • downtime

  • flexibility in file system arrangement

  • presence of ACLs in the file system

  • safety

The three methods are:

  1. Create a new logical volume with a new JFS file system and copy the existing HFS file system to it.

    Benefits:  

    minimal downtime, safe, flexible

    Requirements:  
    • free space greater than or equal to the existing file system

    • if the HFS file system uses ACLs, you must write a script to convert them to JFS ACLs

    • the HFS file system must be mounted read-only while it is being copied.

    See “Method 1: Copying the HFS to JFS on a New Logical Volume” below for the procedure.

  2. Create a new JFS file system on the logical volume containing the HFS file system, and copy the HFS file system to the JFS file system.

    Benefits:  

    minimal space, safe, flexible

    Requirements:  
    • full backup

    • if the file system uses ACLs, you must write a script to convert them to JFS ACLs

    • significant downtime, proportional to the size of the file system

    See “Method 2: Replacing the HFS with JFS on the Existing Logical Volume” for the procedure.

  3. Use vxfsconvert to convert the HFS file system to a JFS file system.

    Benefits:  

    mostly automatic ACL conversion, moderate space, moderate downtime

    Risks:  

    possible conversion failure, possible loss of data

    Requirements:  
    • full backup

    • if the file system uses ACLs that are incompatible with JFS ACLs, you must write a script to convert them to supported ACLs

    • moderate downtime

    • some free space

    See “Method 3: Converting from HFS to JFS Using vxfsconvert” for the procedure.

Use the following table to help evaluate which method best suits your needs.

Table 6-9 File System Conversion Methods Comparison

Method One:
Create and Copy

Method Two:
Replace HFS with JFS

Method Three:
vxfsconvert

Downtime

least

most

moderate

Free Space

most

least

medium

Need ACL conversion script

yes

yes

maybe

Flexible

yes

yes

no

Safe

yes

yes

some risk

 
NOTE: See “Managing Access to Files and Directories” for more information about Access Control Lists, or ACLs, on HFS and JFS.Before converting an existing HFS file system to a JFS file system, it is critical to do a full backup of the file system.

Method 1: Copying the HFS to JFS on a New Logical Volume

Method 1:
Create and Copy

Use this method to convert an HFS file system to a JFS file system when you want to minimize downtime and you have enough free space.

  1. Create a new logical volume using lvcreate(1M). For example, to create a logical volume in volume group /dev/vg00:

    lvcreate -l new-size /dev/vg00

    See “Example: Creating a Logical Volume Using HP-UX Commands” for more detail.

  2. Create a new JFS file system on the new logical volume. For example:

    mkfs -F vxfs /dev/vg00/rlvol5

    See “Creating a File System” for more detail.

  3. Mount the existing HFS file system read-only. For example:

    mount -F hfs -o ro /dev/vg00/rlvol4

  4. Mount the new JFS file system read-write on a temporary mount point. For example:

    mkdir /new-home
    mount -F vxfs -o rw /dev/vg00/rlvol5 /new-home

  5. Copy the files from the old HFS file system to the newly created JFS file system using cpio(1), tar(1), fbackup(1M), or another tool of your choice. For example,

    cd /home; tar -cvf * | (cd /new_home; tar -xvf -)

  6. If there are ACLs to be converted, record the ACLs from files in the old HFS file system, and apply corresponding JFS ACLs to the same 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.

  7. 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.

  8. Copy the /etc/fstab file to a safe location. For example:

    cp /etc/fstab /etc/fstab.save

  9. Edit the /etc/fstab file to comment out the HFS entry for the file system being replaced, and to add an entry for the new JFS file system. For example, in the excerpt below the hfs entry for lvol4 is commented out and the vxfs entry for lvol5 has been added:

    vi /etc/fstab

    /dev/vg00/lvol1 / hfs defaults 0 1
    #/dev/vg00/lvol4 /home hfs defaults 0 2
    /dev/vg00/lvol5 /home vxfs rw,suid,delaylog 0 2
    /dev/vg00/lvol6 /tmp hfs defaults 0 2
    /dev/vg00/lvol7 /usr hfs defaults 0 2
    /dev/vg00/lvol8 /var hfs defaults 0 2
  10. Unmount both the old HFS file system and the new JFS file system.

    umount /dev/vg00/lvol4 /dev/vg00/lvol5

  11. Mount the new JFS file system in place of the old HFS file system.

    mount -F vxfs /home

Method 2: Replacing the HFS with JFS on the Existing Logical Volume

Method 2:
Replace HFS with JFS

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.

  1. 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:

    fbackup -i /opt
  2. 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.

  3. Copy the /etc/fstab file to a safe location:

    cp /etc/fstab /etc/fstab.save
  4. 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:

    vi /etc/fstab
    /dev/vg00/lvol1 / hfs defaults 0 1
    /dev/vg00/lvol4 /home hfs defaults 0 2
    #/dev/vg00/lvol5 /opt hfs defaults 0 2
    /dev/vg00/lvol5 /opt vxfs rw,suid,delaylog 0 2
    /dev/vg00/lvol6 /tmp hfs defaults 0 2
    /dev/vg00/lvol7 /usr hfs defaults 0 2
    /dev/vg00/lvol8 /var hfs defaults 0 2
    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.
  5. 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.

  6. In an NFS environment, tell remote users to unmount the affected file system to avoid having stale NFS mounts later.

  7. Warn all users that the system is shutting down.

  8. Bring the system down to single-user mode by using the shutdown command with no parameters:

    shutdown
  9. Create the JFS file system using the mkfs command:

    mkfs -F vxfs /dev/vg00/rlvol5
  10. Mount the new file system:

    mount -F vxfs /dev/vg00/lvol5 /opt
  11. Restore the file system data from the backup archive created in Step 1 to the file system. For example:

    frecover -x -i /opt
    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.
  12. 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.

  13. Put the system back into multi-user mode:

      init 4

    or

      reboot -r

    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).

Method 3: Converting from HFS to JFS Using vxfsconvert

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.
  1. In an NFS environment, tell remote users to unmount the affected file systems to avoid having stale NFS mounts later.

  2. Unmount the HFS file system. For example:

    umount /opt
  3. Make sure the file system is clean. vxfsconvert cannot convert a dirty file system. For example:

    fsck -F hfs /dev/vg00/lvol5
  4. If the file system contains non-POSIX ACLs (unsupported in JFS) to be converted, run a script to convert them to supported POSIX ACLs.

  5. Back up your file system data using your favorite backup tool. (See “Backing Up Data” for procedural logistics.) For example:

    fbackup -i /opt
  6. Run vxfsconvert. For example:

    vxfsconvert /opt

    vxfsconvert sets up VxFS metadata and inodes, and converts ACLs. See vxfsconvert(1M) for details.

  7. 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.

  8. Run fsck to complete the conversion.For example:

    fsck -F vxfs -y -o full /dev/vg00/lvol5
    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.
  9. Mount the file system.For example:

    mount -o rw,suid,delaylog -F vxfs /dev/vg00/lvol5 /opt
  10. If you have the HP OnLineJFS product, run fsadm to reorganize and optimize the file system. For example:

    fsadm -ed /opt
    NOTE: If you do not run fsadm to optimize the file system, performance of existing files may degrade.
  11. 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)

Resizing a JFS File System

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.

To Resize a JFS File System using fsadm

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.

  1. Before proceeding to resize a JFS file system, defragment its directory tree and extents.

    fsadm -d -D -e -E /mount_point

  2. Determine how much to increase the size of the file system.

  3. 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.

  4. 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

  5. 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.

To Resize a Basic JFS File System

The following procedure will resize a JFS file system without the benefit of the optional HP OnLineJFS product.

  1. Determine how much to increase the size of the file system.

  2. 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.

  3. Back up the JFS file system, using any backup utility you prefer. Refer to “Backing Up Data” for detailed information on backup logistics.

  4. Run mkfs with the -F vxfs option to recreate a JFS file system of the new size. Refer to mkfs_vxfs(1M) for details.

  5. Restore the JFS file system onto the newly created file system.

Managing Large Files

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:

    vi large_file
    "large_file" Value too large to be stored in data type
  • You cannot mail a large file.

  • You cannot print a large file.

Creating a Large-Files File System

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.

Examples of Creating a Large Files File System

The following examples show different ways to create a large-files file system.

/usr/sbin/mkfs -F hfs -o largefiles /dev/vg02/rlvol1
/usr/sbin/newfs -F hfs -o largefiles /dev/vg02/rlvol1
/usr/sbin/mkfs -F vxfs -o largefiles /dev/vg02/rlvol1
/usr/sbin/newfs -F vxfs -o largefiles /dev/vg02/rlvol1

Examples of Creating a No-Large-Files File System

The following examples show different ways to create a file system that will not support large files.

/usr/sbin/mkfs -F hfs -o nolargefiles /dev/vg02/rlvol1
/usr/sbin/newfs -F hfs -o nolargefiles /dev/vg02/rlvol1
/usr/sbin/mkfs -F vxfs -o nolargefiles /dev/vg02/rlvol1
/usr/sbin/newfs -F vxfs -o nolargefiles /dev/vg02/rlvol1

Changing from a Large-Files File System

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.

/usr/sbin/fsadm -F hfs -o largefiles /dev/vg02/rlvol1
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.

Command Support for 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

Repairing a Large-Files File System with fsck

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 and Large-Files File Systems

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.

For More Information on Large Files

Refer to:

Managing FTP

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.)

Enabling/Disabling the /etc/ftpd/ftpaccess Configuration File

  • 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).
 

Verifying the Path Names of FTP Configuration Files

To verify the path names of all FTP configuration files, enter:

/usr/bin/ckconfig

For more information see the ckconfig(1) manpage.

Getting Information about FTP Users

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:

/usr/bin/ftpcount

To display the current process information for each user logged into the FTP server, enter:

/usr/bin/ftpwho

See the ftpcount(1) and ftpwho(1) manpages for more information

Creating an FTP Shutdown Message

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.

Logging FTP Session Information

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.

Logging FTP File Transfers

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.

Configuring Logging in the /etc/ftpd/ftpaccess File

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.

Setting Up Virtual FTP Support

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.
Printable version
Privacy statement Using this site means you accept its terms
© 1997-2006 Hewlett-Packard Development Company, L.P.