System Administration Guide, Volume I

How to Create a TMPFS File System

  1. Become superuser.

  2. If necessary, create the directory where you want to mount the TMPFS file system and set permissions and ownership as necessary.

  3. Create a TMPFS file system.

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


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

    size=number

    Specifies the size of the TMPFS file system in Mbytes.  

    mount-point

    The directory on which the TMPFS file system is mounted. 

  4. Look at the output from the mount command to verify that the TMPFS file system has been created.


    # mount -v
    

Example--Creating a TMPFS File System

The following example creates a new directory, /export/reports, and mounts a TMPFS file system at that point, limiting it to 50 Mbytes.


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

Example--Creating a TMPFS File System at Boot Time

You can set up the system to automatically create a TMPFS file system when it boots by adding an entry to the /etc/vfstab file. The following example shows an entry in the /etc/vfstab file that will create a TMPFS file system on /export/test 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 the /etc/vfstab file, see "/etc/vfstab Field Descriptions".