System Administration Guide: Devices and File Systems

ProcedureHow to Create a File System on a USB Mass Storage Device

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 device:


Note –

Perform steps 4-5 only if you need to format a USB diskette.


  1. Become superuser.

  2. Add the USB device to your system. For information on hot-plugging USB devices, see:

  3. (Optional) Identify the USB device.

    For example:


    # rmformat
    Looking for devices...
         1. Logical Node: /dev/rdsk/c2t0d0p0
            Physical Node: /pci@0,0/pci108e,534a@2,1/hub@7/floppy@1/disk@0,0
            Connected Device: MITSUMI  USB FDD          1039
            Device Type: Floppy drive
            Bus: USB
            Size: 1.4 MB
            Label: <None>
            Access permissions: Medium is not write protected.

    In this example, the diskette device is c2t0d0p0.

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

  5. 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
    
  6. Determine the file system type and make sure the device is unmounted. Then, select one of the following:

    For more information about unmounting a USB device, see How to Mount or Unmount a USB Mass Storage Device.

    • 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-Mbyte diskette on a SPARC system:


      # mkfs -F pcfs /dev/rdsk/c2t0d0p0
      Construct a new FAT file system on /dev/rdsk/c2t0d0p0: (y/n)? y
      

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


      # mkfs -F pcfs /dev/rdsk/c2t0d0s2
      Construct a new FAT file system on /dev/rdsk/c2t0d0s2: (y/n)? y
      

      The following example shows how to create a PCFS file system on a 100-Mbyte 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-Mbyte 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.