Sun Microsystems Logo
Products & Services
 
Support & Training
 
 

Previous Previous     Contents     Index     Next Next

ProcedureHow to Create a TMPFS File System

  1. Become superuser or assume an equivalent role.

  2. Create the directory that you want to mount as the TMPF file system, if necessary.

    # mkdir /mount-point

    mount-point is the directory on which the TMPFS file system is mounted.

  3. Mount the TMPFS file system.

    # mount -F tmpfs [-o size=number]  swap mount-point

    -o size=number

    Specifies the size limit of the TMPFS file system in Mbytes.

    mount-point

    Specifies the directory on which the TMPFS file system is mounted.

    To set up the system to automatically mount a TMPFS file system when it boots, see Example--Mounting a TMPFS File System at Boot Time.

  4. Verify that the TMPFS file system has been created.

    # mount -v

Example--Creating a TMPFS File System

The following example shows how to create, mount, and limit the size of the TMPFS file system, /export/reports, to 50 Mbytes.

# mkdir /export/reports
# chmod 777 /export/reports
# mount -F tmpfs -o size=50m swap /export/reports

Example--Mounting a TMPFS File System at Boot Time

You can set up the system to automatically mount a TMPFS file system when it boots by adding an /etc/vfstab entry. The following example shows an entry in the /etc/vfstab file that mounts /export/test as a TMPFS file system when the system boots. Since the size=number option is not specified, the size of the TMPFS file system on /export/test is limited only by the available system resources.

swap - /export/test  tmpfs   -  yes  -

For more information on the /etc/vfstab file, see Field Descriptions for the /etc/vfstab File.

Creating a Loopback File System (LOFS)

A LOFS file system is a virtual file system that provides an alternate path to an existing file system. When other file systems are mounted onto an LOFS file system, the original file system does not change.

For more information, see the lofs(7FS).


Caution! Caution - Be careful when creating LOFS file systems. Because LOFS file systems are virtual file systems, the potential for confusing both users and applications is enormous.


ProcedureHow to Create an LOFS File System

  1. Become superuser or assume an equivalent role.

  2. Create the directory you want to mount as an LOFS file system, if necessary.

    # mkdir loopback-directory

  3. Grant the appropriate permissions and ownership on the newly created directory.

  4. Create the mount point where you want to mount the LOFS file system, if necessary.

    # mkdir /mount-point

  5. Mount the LOFS file system.

    # mount -F lofs loopback-directory /mount-point

    loopback-directory

    Specifies the file system to be mounted on the loopback mount point.

    /mount-point

    Specifies the directory on which to mount the LOFS file system.

  6. Verify that the LOFS file system has been mounted.

    # mount -v

Example--Creating and Mounting an LOFS File System

The following example illustrates how to create, mount, and test new software in the /new/dist directory as a loopback file system without actually having to install it.

# mkdir /tmp/newroot
# mount -F lofs /new/dist /tmp/newroot
# chroot /tmp/newroot newcommand 

Example--Mounting an LOFS File System at Boot Time

You can set up the system to automatically mount an LOFS file system when it boots by adding an entry to the end of the /etc/vfstab file. The following example shows an entry in the /etc/vfstab file that mounts an LOFS file system for the root (/) file system on /tmp/newroot.

/ - /tmp/newroot  lofs   -  yes  -


Caution! Caution - Make sure the loopback entries are the last entries in the /etc/vfstab file. Otherwise, if the /etc/vfstab entry for a loopback file system precedes the file systems to be included in it, the loopback file system cannot be mounted.


For more information on the /etc/vfstab file, see Field Descriptions for the /etc/vfstab File.

Previous Previous     Contents     Index     Next Next