JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Devices and File Systems     Oracle Solaris 11 Express 11/10
search filter icon
search icon

Document Information

Preface

1.  Managing Removable Media (Overview)

2.  Managing Removable Media (Tasks)

3.  Accessing Removable Media (Tasks)

4.  Writing CDs and DVDs (Tasks)

5.  Managing Devices (Overview/Tasks)

6.  Dynamically Configuring Devices (Tasks)

7.  Using USB Devices (Overview)

8.  Using USB Devices (Tasks)

9.  Using InfiniBand Devices (Overview/Tasks)

10.  Managing Disks (Overview)

11.  Administering Disks (Tasks)

12.  SPARC: Adding a Disk (Tasks)

13.  x86: Adding a Disk (Tasks)

14.  Configuring iSCSI Storage Devices With COMSTAR

15.  Configuring and Managing the Solaris Internet Storage Name Service (iSNS)

16.  Managing Disk Use (Tasks)

17.  The format Utility (Reference)

18.  Managing File Systems (Overview)

19.  Creating ZFS, UFS, TMPFS, and LOFS File Systems (Tasks)

Creating an Oracle Solaris ZFS File System

How to Create an Oracle Solaris ZFS File System

Creating a UFS File System

How to Create a UFS File System

Creating a Temporary File System (TMPFS)

How to Create and Mount a TMPFS File System

Creating and Mounting a Loopback File System (LOFS)

How to Create and Mount an LOFS File System

20.  Mounting and Unmounting File Systems (Tasks)

21.  Configuring Additional Swap Space (Tasks)

22.  Copying Files and File Systems (Tasks)

23.  Managing Tape Drives (Tasks)

Index

Creating a UFS File System

Before 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 10, Managing Disks (Overview) for complete information on formatting disks and dividing disks into slices.


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 Oracle Solaris OS automatically creates them as part of the installation process. You need to create (or re-create) a UFS file system when you want to do the following:

The newfs command is the standard way to create UFS file systems. The newfs command is a convenient front end to the mkfs 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 label for the disk that will contain the new file system. The options you choose are passed to the mkfs command to build the file system.

For information about the default parameters that are used by the newfs command, see newfs(1M).

How to Create a UFS File System

Before You Begin

Ensure that you have met the following prerequisites:

For information on finding disks and disk slice numbers, see Chapter 11, Administering Disks (Tasks).

For information on formatting disks and dividing disks into slices, see Chapter 10, Managing Disks (Overview).

  1. Become an administrator.

    For more information, see How to Obtain Administrative Rights in System Administration Guide: Security Services.

  2. Create the UFS file system.
    # newfs [-N] [-b size] [-i bytes] /dev/rdsk/device-name
    -N

    Displays what parameters the newfs command would pass to the mkfs command without actually creating the file system. This option is a good way to test the newfs command.

    -b size

    Specifies the block size for the file system, either 4096 or 8192 bytes per block. The default is 8192.

    -i bytes

    Specifies the number of bytes per inode. The default varies depending on the disk size. For more information, see newfs(1M).

    device-name

    Specifies the disk device name on which to create the new file system.

    The system asks for confirmation.


    Caution

    Caution - Be sure you have specified the correct device name for the slice before performing this step. If you specify the wrong slice, you will erase its contents when the new file system is created. This error might cause the system to panic.


  3. To verify the creation of the UFS file system, check the new file system.
    # fsck /dev/rdsk/device-name

    where device-name argument specifies the name of the disk device that contains the new file system.

    The fsck command checks the consistency of the new file system, reports any problems, and prompts you before it repairs the problems. For more information on the fsck command, see fsck(1M).

Example 19-1 Creating a UFS File System

The following example shows how to create a UFS file system on /dev/rdsk/c0t1d0s0.

# newfs /dev/rdsk/c0t1d0s0
newfs: construct a new file system /dev/rdsk/c0t1d0s0: (y/n)? y
/dev/rdsk/c0t1d0s0:     286722656 sectors in 46668 cylinders of 48 tracks, 128 sectors
        140001.3MB in 2917 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
..........................................................
super-block backups for last 10 cylinder groups at:
 285773216, 285871648, 285970080, 286068512, 286166944, 286265376, 286363808,
 286462240, 286560672, 286659104
# fsck /dev/rdsk/c0t1d0s0
After You Create a UFS File System ...

To mount the UFS file system and make it available, go to Chapter 20, Mounting and Unmounting File Systems (Tasks).