Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
19.  Formatting Removable Media (Tasks) Formatting Removable Media Overview How to Load a Removable Media  Previous   Contents   Next 
   
 

How to Format Removable Media (rmformat)

You can use the rmformat command to format the media. By default, this command creates two partitions on the media: partition 0 and partition 2 (the whole media).

  1. Verify that the volume manager is running, which means you can use the shorter nickname for the device name.

    $ ps -ef | grep vold
    root   212     1  0   Nov 03 ?        0:01 /usr/sbin/vold

    For information on starting vold, see "How to Restart Volume Management (vold)". For information on identifying media device names, see "Using Removable Media Names".

  2. Format the removable media.

    $ rmformat -F [ quick | long | force ] device-name

    See the previous section for more information on rmformat formatting options.

    If the rmformat output indicates bad blocks, see "How to Repair Bad Blocks on Removable Media" for information on repairing bad blocks.

  3. (Optional) Label the removable media with an 8-character label to be used in the Solaris environment.

    $ rmformat -b label device-name

    For information on creating a DOS label, see mkfs_pcfs(1M).

Examples--Formatting Removable Media

This example shows how to format a diskette.

$ rmformat -F quick /dev/rdiskette
Formatting will erase all the data on disk.
Do you want to continue? (y/n) y
.........................................................................

This example shows how to format a Zip drive.

$ rmformat -F quick /vol/dev/aliases/zip0
Formatting will erase all the data on disk.
Do you want to continue? (y/n) y
.........................................................................

How to Format Removable Media for Adding a File System

  1. Format the media.

    $ rmformat -F quick device-name
  2. (Optional) Create an alternate Solaris partition table.

    $ rmformat -s slice-file device-name

    A sample slice file looks like the following:
    slices: 0 = 0, 30MB, "wm", "home" : 
                  1 = 30MB, 51MB : 
                  2 = 0, 94MB, "wm", "backup" : 
                  6 = 81MB, 13MB

  3. Become superuser.

  4. Determine the appropriate file system type and select one of the following:

    1. Create a UFS file system.

      # newfs device-name
    2. Create a UDFS file system.

      # mkfs -F udfs device-name

Example--Formatting a Diskette for a UFS File System

The following example shows how to format a diskette and create a UFS file system on the diskette.

$ rmformat -F quick /vol/dev/aliases/floppy0
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
$ su
# /usr/sbin/newfs /vol/dev/aliases/floppy0
newfs: construct a new file system /dev/rdiskette: (y/n)? y
/dev/rdiskette: 2880 sectors in 80 cylinders of 2 tracks, 18 sectors
        1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 640, 1184, 1792, 2336,
# 

Example--Formatting a PCMCIA Memory Card for a UFS File System

The following example shows how to format a PCMCIA memory card and create a UFS file system on the card.

$ rmformat -F quick /vol/dev/aliases/pcmem0
$ su
# /usr/sbin/newfs -v /vol/dev/aliases/pcmem0
newfs: construct a new file system /vol/dev/aliases/pcmem0:(y/n)? y
.
.
.
#

Examples--Formatting Removable Media for a PCFS File System

This example shows how to create an alternate fdisk partition.

$ rmformat -F quick /dev/rdsk/c0t4d0s2:c
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
$ su
# fdisk /dev/rdsk/c0t4d0s2:c 
# mkfs -F pcfs /dev/rdsk/c0t4d0s2:c
Construct a new FAT file system on /dev/rdsk/c0t4d0s2:c: (y/n)? y
#

This example shows how to create a PCFS file system without an fdisk partition.

$ rmformat -F quick /dev/rdiskette
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
$ su
# mkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette
Construct a new FAT file system on /dev/rdiskette: (y/n)? y
#

How to Check a File System on Removable Media

  1. Become superuser.

  2. Identify the name service and select one of the following:

    1. Check a UFS file system.

      # fsck -F ufs device-name
    2. Check a UDFS file system.

      # fsck -F udfs device-name
    3. Check a PCFS file system.

      # fsck -F pcfs device-name
 
 
 
  Previous   Contents   Next