Solaris 8 System Administration Supplement

Chapter 2 Improved Removable Media Management


Note -

For the most up-to-date man pages, use the man command. The Solaris 8 6/00 man pages include new feature information not found in the Solaris 8 Reference Manual Collection.


Overview

This functionality is updated in the Solaris 8 6/00 software release.

Volume management features have been improved in the Solaris 8 6/00software release to fully support removable media. This means DVD-ROMs, Iomega and USB Zip and Jaz drives, CD-ROMs, and diskettes are mounted and available for reading when inserted.

Both the Common Desktop Environment (CDE) volume management and Solaris command-line features have been updated in this release. The information here adds to information on managing removable media found in "Guidelines for Using CDs and Diskettes (Overview)" in System Administration Guide, Volume 1. For information on using File Manager to administer this feature, see "Using Removable Media Manager" in Solaris 8 User Supplement.

With the volume management improvements, you can:

Guidelines for using removable media are:

Accessing Information on Removable Media

You can access information on removable media with or without using volume manager. For information on accessing information on removable media with File Manager, see "Using Removable Media Manager" in Solaris 8 User Supplement.

How to Access Information on Removable Media

Use the appropriate device name to access information using the command-line interface. You can use the volume manager's nickname from the command line by running the volcheck command before accessing the removable media. See rmformat(1) for an explanation of device names.

Examples--Accessing Information on Removable Media

To access information on a diskette, use:


$ volcheck
$ ls /floppy
myfile

To access information on a Jaz drive, use:


$ volcheck
$ ls /rmdisk
jaz0/		jaz1/

To access information on a CD-ROM, use:


$ volcheck
$ ls /cdrom
solaris_8_sparc/

Formatting Removable Media (rmformat)

You can use the rmformat command to format removable media, including the following types of diskettes:

The rmformat command is a non-superuser utility that can format and protect rewritable removable media. The rmformat command has three formatting options:

How to Format Removable Media (rmformat)

The rmformat command formats the media and by default creates two partitions on the media: partition 0 and partition 2 (the whole media).

  1. Verify that 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

    See System Administration Guide, Volume I for information on determining removable media device names and starting volume manager if it is not running.

  2. Format the removable media.


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

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

    If the rmformat output indicates bad blocks, see the procedure below for 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
    

    See mkfs_pcfs(1M) for information on creating a DOS label.

Examples--Formatting Removable Media

This example formats a diskette.


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

This example formats a Zip drive.


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

How to Format Removable Media for a UFS or UDFS 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

    See System Administration Guide, Volume I for information on creating an alternate Solaris partition table.

  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 Removable Media for a UFS File System

The following example formats a diskette and creates a UFS file system.


$ rmformat -F quick /dev/rdiskette
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
$ su
# newfs /dev/rdiskette
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,
# 

How to Format Removable Media for a PCFS File System

  1. Format the removable media.


    $ rmformat -F quick device-name
    
  2. Become superuser.

  3. (Optional) Create an alternate Solaris fdisk partition table.


    # fdisk device-name
    

    See System Administration Guide, Volume I for information on creating an fdisk partition.

  4. Create a PCFS file system.


    # mkfs -F pcfs device-name 
    

Examples--Formatting Removable Media for a PCFS File System

This example includes 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 describes 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 PCFS File System on Removable Media

  1. Become superuser.

  2. Check the PCFS file system.


    # fsck -F pcfs device-name
    

Example--Checking a PCFS File System on Removable Media


# fsck -F pcfs /dev/rdsk/c0t4d0s2
** /dev/rdsk/c0t4d0s2
** Scanning file system meta-data
** Correcting any meta-data discrepancies
1457664 bytes.
0 bytes in bad sectors.
0 bytes in 0 directories.
0 bytes in 0 files.
1457664 bytes free.
512 bytes per allocation unit.
2847 total allocation units.
2847 available allocation units.
# 

How to Repair Bad Blocks on Removable Media

You can only use the rmformat command to verify, analyze, and repair bad sectors found during verification if the drive supports bad block management. Most diskettes and PCMCIA memory cards do not support bad block management.

If the drive supports bad block management, a best effort is made to rectify the bad block. If the bad block cannot be rectified despite the best effort mechanism, a message indicates a failure to repair.

  1. Repair bad blocks on removable media.


    $ rmformat -c block-numbers device-name
    

    Supply the block number in decimal, octal, or hexadecimal format from a previous rmformat session.

  2. Verify the media.


    $ rmformat -V read device-name
    

Applying Read/Write and Password Protection to Removable Media

You can apply read/write protection and set a password on Iomega media such as Zip and Jaz drives. For other types of media, you can enable or disable read/write protection without a password.

How to Disable or Enable Read/Write Protection on Removable Media

  1. Determine whether you want to disable or enable read/write protection and select one of the following:

    1. Disable read or write protection.


      $ rmformat -r disable device-name
      

      $ rmformat -w disable device-name
      
    2. Enable read or write protection.


      $ rmformat -r enable device-name
      

      $ rmformat -w enable device-name
      
  2. Verify whether the media's read/write protection is enabled or disabled.


    $ rmformat -p device-name
    

How to Disable or Enable Read/Write Protection and a Password on Iomega Media

A password with a maximum of 32 characters can be applied for Iomega media that support this feature. You cannot set read/write protection without a password on Iomega media. In this case, you are prompted to provide a password.

You will receive a warning message if you attempt to apply a password on media that does not support this feature.

  1. Determine whether you want to enable or disable read/write protection and a password.

    1. Enable read or write protection.


      $ rmformat -W enable device-name
      Please enter password (32 chars maximum): xxx
      Please reenter password:

      $ rmformat -R enable device-name
      Please enter password (32 chars maximum): xxx
      Please reenter password:
    2. Disable read or write protection and remove the password.


      $ rmformat -W disable device-name
      Please enter password (32 chars maximum): xxx
      

      $ rmformat -R disable device-name
      Please enter password (32 chars maximum): xxx
      
  2. Verify whether the media's read/write protection is enabled or disabled.


    $ rmformat -p device-name
    

Examples--Disabling or Enabling Read/Write Protection

This example enables write protection and sets a password on a Zip drive.


$ rmformat -W enable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
Please reenter password: xxx

This example disables write protection and removes the password on a Zip drive.


$ rmformat -W disable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx

This example enables read protection and sets a password on a Zip drive.


$ rmformat -R enable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
Please reenter password: xxx

This example disables read protection and removes the password on a Zip drive.

--


$ rmformat -R disable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx