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
HP-UX System Administration Tasks: HP 9000 > Chapter 4 Working with HP-UX File Systems

Mounting File Systems

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

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 part of a remote NFS file system, and it can be on either a non-LVM disk or a logical volume.

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 on 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 on 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 with -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 currently exist. For example, enter:

    mkdir /joe
  2. Mount the file system using the mount command. Use the block device file name that contains the file system. You will need to enter this name as an argument 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, you may need to enter ioscan -fn -H hw_path to determine the block device file name to use.

You can use lssf(1M) 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(1M) to show you the devices connected to your system and their hardware path.

If the block device file does not exist, you will need to create it using insf(1M) or mksf(1M).

See Configuring HP-UX for Peripherals for more information on these commands.

Mounting Remote File Systems

You can use either SAM or the mount command to mount file systems located on a remote system.

Before you can mount file systems located on a remote system, NFS software must be installed and configured on both local and remote systems. Refer to Installing and Administering NFS for information.

For information on mounting NFS file systems using SAM, see SAM's online help.

To mount a remote file system using HP-UX commands,

  1. You must know the name of the host machine and the file system's directory on the remote machine.

  2. Establish communication over a network between the local system (that is, the "client") and the remote system. (The local system must be able to reach the remote system via whatever hosts database is in use.) (See named(1M) and hosts(4).) If necessary, test the connection with /usr/sbin/ping; see ping(1M).

  3. Make sure the file /etc/exports on the remote system lists the file systems that you wish to make available to clients (that is, to "export") and the local systems that you wish to mount the file systems.

    For example, to allow machines called rolf and egbert to remotely mount the /usr file system, edit the file /etc/exports on the remote machine and include the line:

    /usr rolf egbert

    For more information, see exports(4).

  4. Execute /usr/sbin/exportfs -a on the remote system to export all directories in /etc/exports to clients.

    For more information, see exportfs(1M).

    NOTE: If you wish to invoke exportfs -a at boot time, make sure the NFS configuration file /etc/rc.config.d/nfsconf on the remote system contains the following settings: NFS_SERVER=1 and START_MOUNTD=1. The client's /etc/rc.config.d/nfsconf file must contain NFS_CLIENT=1. Then issue the following command to run the script:
    /sbin/init.d/nfs.server start

    See Installing and Administering NFS for more information.

  5. Mount the file system on the local system, as in:

    mount -F nfs remotehost:/remote_dir /local_dir

In this example, as a result of issuing the mount command, you can access the directory called remote_dir on the system remotehost under the directory local_dir on your local system.

Mounting File Systems Automatically at Bootup

To automatically mount a file system 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.

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

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

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

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

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

Solution: Update /etc/mnttab using mount -u.

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

Solution: /etc/mnttab is normally created, if it doesn't already exist, within /sbin/init.d/hfsmount when you boot up your computer. If you get one of these messages, /etc/mnttab does not exist so you need to create it using the following command:

mount -u

The following problems concern attempting to mount a remote file system:

Problem: You observe that a server or client are not acting as you expect.

Solution: Make sure the server and client have been designated as such in their /etc/rc.config.d/nfsconf script by setting NFS_SERVER=1 and/or NFS_CLIENT=1.

Problem: You get an access denied message.

Solution: Make sure the remote machine has an entry in the /etc/exports file that lists the client's hostname. (hostname is returned by the hostname(1) command.) If not, add it to /etc/exports and then execute exportfs -a. If you are using the Domain Name Server, servers need to be correctly listed in /etc/resolv.conf.

Problem: Same as previous problem.

Solution: As an alternate solution, run /usr/sbin/exportfs -i dir from the server to export the named directory or file system to all nodes.

Problem: You get the message No such file or directory for the mount point you have chosen.

Solution: Make sure the mount directory exists and is not currently being used as a mount point.

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

Solution: See "Reconfiguring the Kernel" in Chapter 1, "Setting Up a System", for help with this T500 problem.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.