Managing File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014

How to Create and Mount a Legacy UFS File System

Before You Begin

Ensure that you have met the following prerequisites:

  • The disk must be formatted and divided into slices.

  • If you are recreating an existing legacy UFS file system, unmount it.

  • You need to know the device name of the slice that will contain the file system.

For information on finding disks and disk slice numbers, see Chapter 6, Administering the System’s Disks, in Managing Devices in Oracle Solaris 11.2 .

  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 a legacy UFS file system.
    # newfs [-N] [-b size] [-i bytes] /dev/rdsk/device-name

    The system asks for confirmation.


    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 legacy 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).

  4. Mount the legacy UFS file system.
    # mkdir /directory-name
    # mount /dev/dsk/device-name /directory-name
Example 2-1  Creating and Mounting a Legacy UFS File System

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

# 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
# mkdir /legacy
# mount /dev/dsk/c0t1d0s0 /legacy

Next Steps

To mount the legacy UFS file system automatically at boot time, after you create it, go to How to Add an Entry to the /etc/vfstab File.