System Administration Guide

Creating a UFS File System

You need to create UFS file systems only occasionally, because the system software automatically creates file systems as part of the installation process. You need to create (or re-create) a UFS file system when you:

The following procedure uses the newfs command to create UFS file systems. The newfs command is a convenient front-end to the mkfs command, which creates the new file system. On Solaris 2.x systems, newfs parameter defaults, such as tracks per cylinder and sectors per track, are read 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 Parameters

To make a new file system on a disk slice, you almost always use the newfs command. Table 27-1 shows the default parameters the newfs command uses.

Table 27-1 Default Parameters Used by the newfs Command

Parameter 

Default Value 

Block size 

8 Kbytes 

Fragment size 

1 Kbyte 

Minimum free space 

10% 

Rotational delay 

Device-dependent 

Optimization type 

Space 

Number of inodes 

1 for each 2 Kbytes of disk space 

Prerequisites

How to Create a UFS File System

  1. Make sure you have met the prerequisites listed on "Prerequisites".

  2. Create the file system.


    # newfs [-N] [-b size] [-i bytes] /dev/rdsk/device-name
    

    -N

    Displays all of the parameters newfs would pass to mkfs. No file system is created.

    -b size

    Sets the file system block size. Default is 8192 blocks. 

    -i bytes

    Sets the number of bytes per inode. Default is 2048 bytes. 

    device-name

    The device that will contain the new file system. 


    Caution - Caution -

    Be sure you have specified the correct device name for the slice before performing the next step. If you specify the wrong slice, you will erase its contents when the new file system is created.


    The system asks for confirmation.

  3. To verify the creation of UFS file systems, check the new file systems with the fsck command.


    # fsck /dev/rdsk/device-name
    

    device-name

    The name of the device containing the new file system. 

    This utility checks the consistency of the new file system, reports problems it finds, and prompts you before repairing the problems. See Chapter 31, Checking File System Integrity for more information on fsck.

Example--Creating a UFS File System

This example creates a file system on /dev/rdsk/c0t3d0s7.


# newfs /dev/rdsk/c0t3d0s7
newfs: construct a new file system /dev/rdsk/c0t3d0s7 (y/n)? y
/dev/rdsk/c0t3d0s7:     163944 sectors in 506 cylinders of 9 tracks, 
   36 sectors 83.9MB in 32 cyl groups (16 c/g, 2.65MB/g, 1216 i/g)
super-block backups (for fsck -b #) at:
 32, 5264, 10496, 15728, 20960, 26192, 31424, 36656, 41888,
 47120, 52352, 57584, 62816, 68048, 73280, 78512, 82976, 88208,
 93440, 98672, 103904, 109136, 114368, 119600, 124832, 130064, 
 135296, 140528, 145760, 150992, 156224, 161456,

Where to Go From Here

If You Want to Make the File System Available By ... 

Then ... 

Mounting the file system with the mount command

Go to "How to Mount a UFS File System".

Creating an entry in /etc/vfstab to make the system automatically mount the file system when it boots

Go to "How to Add an Entry in the /etc/vfstab File".