Contained WithinFind More DocumentationFeatured Support Resources | Descargar este libro en PDF (1386 KB)
Chapter 35 Creating File Systems (Tasks)This chapter describes how to create UFS, TMPFS, and LOFS file systems. For UFS file systems, this chapter shows you how to create a file system on a hard disk using the newfs command. Because TMPFS and LOFS are virtual file systems, you actually "access" them by mounting them. This is a list of the step-by-step instructions in this chapter. Note - For instructions on how to create UFS and DOS file systems on removable media, see Chapter 14, Guidelines for Using CDs and Diskettes (Overview). Creating a UFS File SystemBefore you can create a UFS file system on a disk, the disk must be formatted and divided into slices. A disk slice is a physical subset of a disk that is composed of a single range of contiguous blocks. A slice can be used either as a raw device that provides, for example, swap space, or to hold a disk-based file system. See Chapter 28, Disk Management (Overview) for complete information on formatting disks and dividing disks into slices. Logical volume management products, like Solstice DiskSuite, create more sophisticated meta devices, that expand beyond single slice or single disk boundaries. See Solstice DiskSuite 4.2.1 User's Guide for more information about meta devices. Note - Solaris device names use the term slice (and the letter s in the device name) to refer to the slice number. Slices are also called "partitions." You need to create UFS file systems only occasionally, because the Solaris operating environment automatically creates them as part of the installation process. You need to create (or re-create) a UFS file system when you:
The newfs command is the standard way to create UFS file systems. The newfs(1M) command is a convenient front-end to the mkfs(1M) command, which actually creates the new file system. The newfs command reads parameter defaults, such as tracks per cylinder and sectors per track, from the disk label that will contain the new file system, and the options you choose are passed to the mkfs command to build the file system. File System ParametersTo make a new file system on a disk slice, you almost always use the newfs command. The table below shows the default parameters used by the newfs command. Table 35-1 Default Parameters Used by the newfs Command
How to Create a UFS File System
Example--Creating a UFS File SystemThe following example creates a UFS file system on /dev/rdsk/c0t1d0s7.
Where to Go From HereTo mount the file system and make it available, go to Chapter 36, Mounting and Unmounting File Systems (Tasks). Creating a Temporary File System (TMPFS)The Temporary File System (TMPFS) uses local memory for file system reads and writes, which is typically much faster than a UFS file system. Using TMPFS file systems can improve system performance by saving the cost of reading and writing temporary files to a local disk or across the network. Files in TMPFS file systems do not survive across reboots or unmounts. If you create multiple TMPFS file systems, be aware that they all use the same system resources. Files created under one TMPFS file system use up the space available for any other TMPFS, unless you limit TMPFS sizes using the -o size option of the mount command. See the tmpfs(7FS) man page for more information. How to Create a TMPFS File System
Example--Creating a TMPFS File SystemThe following example creates a new directory, /export/reports, and mounts a TMPFS file system at that point, limiting it to 50 Mbytes.
Example--Creating a TMPFS File System at Boot TimeYou 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.
For more information the /etc/vfstab file, see "The /etc/vfstab Field Descriptions". 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 a LOFS file system, the original file system does not change. See the lofs(7FS) man page for more information. Be careful when creating LOFS file systems. Because these are virtual file systems, the potential for confusing both users and applications is enormous. How to Create a LOFS File System
Example--Creating a LOFS File SystemThe following example illustrates how to mount and test new software as a loopback file system without actually having to install it.
Example--Creating a LOFS File System at Boot TimeYou can set up the system to automatically create a 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 will create a LOFS file system for the root (/) file system on /tmp/newroot.
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 created. For more information the /etc/vfstab file, see "The /etc/vfstab Field Descriptions". |
|||||||||||||||||||||||||||||||||||||||||||