Managing File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

How to Create and Mount a TMPFS File System

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. Create the directory that you want to mount as the TMPFS file system, if necessary.
    # mkdir /mount-point

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

    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 at boot time, see Example 2–3.

  4. Verify that the TMPFS file system has been created.
    # mount -v
Example 2-2  Creating and Mounting 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 MB.

# mkdir /export/reports
# chmod 777 /export/reports
# mount -F tmpfs -o size=50m swap /export/reports
# mount -v
Example 2-3  Mounting a TMPFS File System at Boot Time

You can set up the system to automatically mount a TMPFS file system at boot time 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 at boot time. Because 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  -