System Administration Guide, Volume 1

Mounting File Systems (mount Command)

How to Mount a UFS File System

  1. Become superuser.

    Also, there must be a mount point on the local system to mount a file system. A mount point is a directory to which the mounted file system is attached.

  2. Mount the UFS file system by using the mount command.


    # mount [-o mount-options] /dev/dsk/device-name mount-point
    

    -o mount-options

    Specifies mount options that you can use to mount a UFS file system. See Table 36-3 or mount_ufs(1M) for a list of options.

    /dev/dsk/device-name

    Specifies the disk device name for the slice holding the file system (for example, /dev/dsk/c0t3d0s7). See "How to Display Disk Slice Information" to get slice information for a disk.

    mount-point

    Specifies the directory on which to mount the file system. 

Example--Mounting a UFS File System

The following example mounts /dev/dsk/c0t3d0s7 on the /files1 directory.


# mount /dev/dsk/c0t3d0s7 /files1

Example--Mounting a UFS File System With Logging Enabled

UFS logging eliminates file system inconsistency, which can significantly reduce the time of system reboots. The following example mounts /dev/dsk/c0t3d0s7 on the /files1 directory with logging enabled.


# mount -o logging /dev/dsk/c0t3d0s7 /files1

How to Remount a UFS File System Without Large Files

When you mount a file system, the largefiles option is selected by default, which enables you to create files larger than 2 Gbytes. Once a file system contains large files, you cannot remount the file system with the nolargefiles option or mount it on a system running Solaris 2.6 or compatible versions, until you remove any large files and run fsck to reset the state to nolargefiles.

This procedure assumes that the file system is in the /etc/vfstab file.

  1. Become superuser.

  2. Make sure there are no large files in the file system.


    # cd mount-point
    # find . -xdev -size +20000000 -exec ls -l {} \;
    

    mount-point

    Specifies the mount point of the file system you want to check for large files. 

    If large files exist within this file system, they must be removed or moved to another file system.

  3. Unmount the file system.


    # umount mount-point
    
  4. Reset the file system state.


    # fsck mount-point
    
  5. Remount the file system with the nolargefiles option.


    # mount -o nolargefiles mount-point
    

Example--Mounting a File System Without Large Files

The following example checks the /datab file system and remounts it with the nolargefiles option.


# cd /datab
# find . -xdev -size +20000000 -exec ls -l {} \;
# umount /datab 
# fsck /datab
# mount -o nolargefiles /datab

How to Mount an NFS File System

  1. Become superuser.

    Also, there must be a mount point on the local system to mount a file system. A mount point is a directory to which the mounted file system is attached.

  2. Make sure the resource (file or directory) is available from a server.

    To mount an NFS file system, the resource must be made available on the server by using the share command. See System Administration Guide, Volume 3 for information on how to share resources.

  3. Mount the NFS file system by using the mount command.


    # mount -F nfs [-o mount-options] server:/directory mount-point
    

    -o mount-options

    Specifies mount options that you can use to mount an NFS file system. See Table 36-3 for the list of commonly used mount options or mount_nfs(1M) for a complete list of options.

    server:/directory

    Specifies the server's host name that contains the shared resource, and the path to the file or directory to mount. 

    mount-point

    Specifies the directory on which to mount the file system. 

Example--Mounting an NFS File System

The following example mounts the /export/packages directory on /mnt from the server pluto.


# mount -F nfs pluto:/export/packages /mnt

IA: How to Mount a System V (S5FS) File System

  1. Become superuser.

    Also, there must be a mount point on the local system to mount a file system. A mount point is a directory to which the mounted file system is attached.

  2. Mount the S5FS file system by using the mount command.


    # mount -F s5fs [-o mount-options] /dev/dsk/device_name mount-point
    

    -o mount-options

    Specifies mount options that you can use to mount a S5FS file system. See Table 36-3 for the list of commonly used mount options or mount_s5fs(1M) for a complete list of options.

    /dev/dsk/device-name

    Specifies the disk device name of the slice holding the file system (for example, /dev/dsk/c0t3d0s7). See "How to Display Disk Slice Information" to get slice information for a disk.

    mount-point

    Specifies the directory on which to mount the file system. 

IA: Example--Mounting an S5FS File System

The following example mounts /dev/dsk/c0t3d0s7 on the /files1 directory.


# mount -F s5fs /dev/dsk/c0t3d0s7 /files1

IA: How to Mount a PCFS (DOS) File System From a Hard Disk

Use the following procedure to mount a PCFS (DOS) file system from a hard disk.

  1. Become superuser.

    Also, there must be a mount point on the local system to mount a file system. A mount point is a directory to which the mounted file system is attached.

  2. Mount the PCFS file system by using the mount command.


    # mount -F pcfs [-o rw | ro] /dev/dsk/device-name:logical-drive mount-point
    

    -o rw | ro

    Specifies that you can mount a PCFS file system read/write or read-only. If you do not specify this option, the default is read/write. 

    /dev/dsk/device-name

    Specifies the device name of the whole disk (for example, /dev/dsk/c0t0d0p0).

    logical-drive

    Specifies either the DOS logical drive letter (c through z) or a drive number 1 through 24. Drive c is equivalent to drive 1 and represents the Primary DOS slice on the drive; all other letters or numbers represent DOS logical drives within the Extended DOS slice. 

    mount-point

    Specifies the directory on which to mount the file system. 

    Note that the device-name and logical-drive must be separated by a colon.

IA: Examples--Mounting a PCFS (DOS) File System From a Hard Disk

The following example mounts the logical drive in the Primary DOS slice on the /pcfs/c directory.


# mount -F pcfs /dev/dsk/c0t0d0p0:c /pcfs/c

The following example mounts the first logical drive in the Extended DOS slice read-only on /mnt.


# mount -F pcfs -o ro /dev/dsk/c0t0d0p0:2 /mnt