System Administration Guide: Devices and File Systems

ProcedureHow to Create a File System on a USB Mass Storage Device Without vold Running

Use this procedure to add a file system to a USB mass storage device with removable media services disabled.

A USB diskette must be formatted before you can add a file system to it. All other USB mass storage devices just need a PCFS or UFS file system before they can be used. Keep the following key points in mind when formatting a USB diskette:


Note –

Perform steps 7–8 only if you need to format a USB diskette.


  1. Become superuser.

  2. For information on disabling removable media services, see How to Disable or Enable Removable Media Services.

  3. Verify that removable media services are not running.


    # svcs volfs
    STATE          STIME    FMRI
    disable        10:39:12 svc:/system/filesystem/volfs:default
  4. Add the USB device to your system.

    For information on hot-plugging USB devices, see:

  5. (Optional) Identify the USB device.

    The following example identifies a USB diskette device.


    # cd /dev/rdsk
    # ls -l c*0 | grep usb
    lrwxrwxrwx   1 root  root   55 Mar  5 10:35 c2t0d0s0 ->
    ../../devices/pci@1f,0/usb@c,3/storage@3/disk@0,0:a,raw

    In this example, the diskette device is c2t0d0s0.

  6. Insert a diskette into the diskette drive, if necessary.

  7. Format the diskette, if necessary.


    % rmformat -F long raw-device
    

    For example, on a SPARC system:


    % rmformat -F long /dev/rdsk/c2t0d0s2
    

    For example, on an x86 system:


    % rmformat -F long /dev/rdsk/c3t0d0p0
    
  8. Determine the file system type and select one of the following:

    • Create a PCFS file system.


      # mkfs -F pcfs -o nofdisk,size=size raw-device
      

      Specify the -size option in 512-byte blocks.

      The following example shows how to create a PCFS file system on a 1.4-MB diskette on a SPARC system:


      # mkfs -F pcfs -o nofdisk,size=2880 /dev/rdsk/c4t0d0s2
      

      The following example shows how to create a PCFS file system on a 1.4-MB diskette on an x86 system:


      # mkfs -F pcfs -o nofdisk,size=2880 /dev/rdsk/c4t0d0p0
      

      The following example shows how to create a PCFS file system on a 100-MB USB memory stick on a SPARC system:


      # mkfs -F pcfs /dev/rdsk/c5t0d0s2:c
      

      The following example shows how to create a PCFS file system on a 100-MB USB memory stick on an x86 system:


      # mkfs -F pcfs /dev/rdsk/c5t0d0p0:c
      

      This command can take several minutes to complete.

    • Create a UFS file system.


      # newfs raw-device
      

      For example:


      # newfs /dev/rdsk/c4t0d0s7
      

      Consider using the newfs -f 4096 option or newfs -T option for large USB hard disks.


      Note –

      UFS file system overhead consumes a significant portion of space on a diskette, due to a diskette's limited storage capacity.


    See the next two procedures for a detailed example of creating a PCFS file system and modifying slices on a USB mass storage device.