[ Team LiB ] Previous Section Next Section

Using Diskettes Without Volume Management

Use double-sided (DS), high-density (HD) 3.5-inch diskettes. Before you can copy UFS files or file systems to diskette, you must format the diskette. Use the tar command to copy UFS files to a single formatted diskette. Use cpio if you need to copy UFS files to multiple formatted diskettes. The cpio command recognizes end of media and prompts you to insert the next volume.

You also can make a DOS file system on a diskette. To use a DOS-formatted diskette, you mount the diskette as a PCFS file system and use basic OS commands such as cp and mv to archive and retrieve files from the diskette.

Diskette Device Names

The device name for the diskette drive in the Solaris Operating Environment is /dev/diskette. The raw device file for a diskette is /dev/rdiskette.

Diskettes for UFS File Systems

The following sections describe how to format diskettes for use with UFS file systems and how to copy files with the tar and cpio commands. They also describe how to retrieve files that were created with the SunOS 4.x bar command.

Formatting a UFS Diskette (rmformat)
graphics/new.gif

The rmformat command, introduced in the Solaris 8 release, was buggy. The bugs to rmformat are fixed in the Solaris 9 release, and rmformat is the preferred command for formatting removable media.

Use the following steps to format a diskette by using the rmformat command from a command line.

NOTE. Do not use the volcheck command to mount the diskette. rmformat requires an unmounted diskette for formatting.


  1. Insert a diskette into the diskette drive.

  2. Type rmformat -F quick /dev/rdiskette and press Return to format the diskette.

  3. When prompted, type y and press Return to begin formatting the diskette.

    When formatting is complete, the prompt is redisplayed.

The following example formats a diskette on a system not running volume management.


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



Formatting a UFS Diskette (fdformat)

graphics/new.gif

NOTE. Starting with the Solaris 8 release, fdformat has been superseded by the rmformat(1) command, which provides most fdformat functionality.


Use the following steps to format a diskette for use with Solaris UFS file systems.

  1. Check the diskette to make sure that it is not write-protected.

  2. Put the diskette in the drive.

    CAUTION. Reformatting destroys any files already on the diskette.


  3. Type fdformat and press Return.

    The message Press return to start formatting floppy is displayed.

  4. Press Return.

    While the diskette is being formatted, a series of dots (...) is displayed. When formatting is complete, the prompt is redisplayed.


oak%
Press return to start formatting floppy.
............................................................................
oak%



Removing a Diskette from the Drive

Use the eject command to remove a diskette from the disk drive. You can also use the eject command to remove a CD-ROM disc from a CD-ROM drive. The default for the eject command is /dev/diskette when you type it with no arguments. To remove a diskette from the diskette drive, type eject and press Return. The diskette is ejected.

NOTE. If the drive jams, you can eject a diskette manually by inserting a straightened wire paper clip into the pinhole under the diskette slot.


To eject a CD-ROM disc from a CD-ROM drive, type eject cdrom and press Return.

Copying UFS Files to a Single Formatted Diskette

This section provides steps for using the tar command to copy raw files to a single formatted diskette. Note that the tar command does not require the raw device name, /dev/rdiskette. You can use either the /dev/rdiskette or /dev/diskette device name. The examples in this book use the raw device name.

Use the following steps to copy UFS files to a single formatted diskette.

  1. Change to the directory that contains the file(s) you want to copy.

  2. Insert a write-enabled formatted diskette into the drive.

    CAUTION. Copying files to a formatted diskette with the c option destroys any files already on the diskette. If you want to preserve the files already on the diskette, use the r option described in "Appending Files to a Formatted Diskette (tar)" on page 291.


  3. Type tar cvf /dev/rdiskette filename filename filename... and press Return.

    The file names you specify are copied to the diskette, overwriting any existing files on the diskette.

    NOTE. You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file-name argument.


  4. Type eject and press Return to remove the diskette from the drive.

    The diskette is ejected from the drive.

  5. Write the names of the files on the diskette label.

The following example copies two files to a diskette.


oak% cd /home/winsor
oak% ls evaluation*
evaluation.doc evaluation.doc.backup
oak% tar cvf /dev/rdiskette evaluation*
a evaluation.doc 86 blocks
a evaluation.doc.backup 84 blocks
oak% eject
oak%



Listing the Files on a Diskette (tar)

Use the following steps to list files that were copied with the tar command.

  1. Insert a diskette into the drive.

  2. Type tar tvf /dev/rdiskette and press Return.

    The t option lists the table of contents for the files on the diskette.

In the following example, the table of contents for the diskette contains two files.


oak% tar tvf /dev/rdiskette
rw-rw-rw-6693/10  44032 Apr 23 14:54 2000 evaluation.doc
rw-rw-rw-6693/10  43008 Apr 23 14:47 2000 evaluation.doc.backup
oak%

See the tar(1) manual page for more information.

If you need a multiple-volume interchange command, use cpio. The tar command is only a single-volume command.

Appending Files to a Formatted Diskette (tar)

When you copy tar files to a formatted diskette, any files already on the diskette are overwritten. If you want to add other files but keep the files already on the diskette, use the following steps.

  1. Change to the directory that contains the file you want to copy.

  2. Insert a write-enabled formatted diskette into the drive.

  3. Type tar rvf /dev/rdiskette filename filename filename... and press Return.

    The file names you specify are appended to the files already on the diskette.

    NOTE. You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file-name argument.


  4. Type eject and press Return to remove the diskette from the drive.

    The diskette is ejected from the drive.

  5. Write the names of the additional files on the diskette label.

The following example appends one file to the files already on the diskette.


oak% cd /home/winsor
oak% tar rvf /dev/rdiskette junk
a junk 1 blocks
oak% tar tvf /dev/rdiskette
rw-rw-rw-6693/10  44032 Apr 23 14:54 2000 evaluation.doc
rw-rw-rw-6693/10  43008 Apr 23 14:47 2000 evaluation.doc.backup
rw-rw-rw-6693/10     18 Dec 10 11:36 2000 junk
oak% eject
oak%



Retrieving Files from a Diskette (tar)

Use the following steps to retrieve all files from a diskette.

  1. Change to the directory into which you want to put the files.

  2. Insert the diskette into the drive.

  3. Type tar xvf /dev/rdiskette and press Return.

    All the files on the diskette are copied to the current directory.

  4. Type eject and press Return to remove the diskette from the drive.

    The diskette is ejected from the drive.

The following example copies all files from the diskette.


oak% cd /home/winsor/Evaluations
oak% tar xvf /dev/rdiskette
x evaluation.doc, 44032 bytes, 86 tape blocks
x evaluation.doc.backup, 43008 bytes, 84 tape blocks
oak% eject
oak%

To retrieve individual files from a diskette, type tar xvf /dev/rdiskette filename filename filename... and press Return. The file names you specify are extracted from the diskette and placed in the current working directory. The following example copies all files with the prefix evaluation from the diskette.


oak% cd /home/winsor/Evaluations
oak% tar xvf /dev/rdiskette
x evaluation.doc, 44032 bytes, 86 tape blocks
x evaluation.doc.backup, 43008 bytes, 84 tape blocks
oak% eject
oak%



Retrieving bar Files from Diskettes (cpio)

The SunOS 4.x bar command is not provided with the Solaris Operating Environment. You can retrieve files from diskettes that were archived with the SunOS 4.x bar command by using the -H bar option to cpio.

NOTE. You can use the -H bar option with -i to retrieve files only. You cannot create files with the bar header option. It is good practice to list the contents of an archive before extracting them.


Use the following steps to retrieve bar files from a diskette.

  1. Change to the directory into which you want to put the files.

  2. Insert the diskette that contains bar files into the drive.

  3. Type cpio -ivH bar < /dev/diskette and press Return.

    All the files on the diskette are copied to the current directory.

  4. Type eject and press Return to remove the diskette from the drive.

Multiple Diskettes for Archiving Files (cpio)

If you are copying large files or file systems onto diskettes, you want to be prompted to replace a full diskette with another formatted diskette. The cpio command provides this capability. The cpio options you use are the same as you would use to copy files to tape, except you would specify /dev/rdiskette as the device instead of the tape device name. See "The cpio Command" on page 250 for information on how to use cpio.

Making a UFS File System on a Diskette (newfs /dev/rdiskette)

If you want to mount a formatted UFS diskette, you must first create a file system on it.

  1. Format the diskette.

  2. Become superuser.

  3. Type newfs /dev/rdiskette and press Return.

A UFS file system is created on the formatted diskette, as shown in the following example.


oak% fdformat
Press return to start formatting floppy.
................................................................................
oak% su
Password:
# newfs /dev/rdiskette
#




Diskettes for PCFS (DOS) File Systems

You can format diskettes with the PCFS file system for use with DOS systems. The following sections describe how to format a DOS diskette and how to mount the diskette for use with the Solaris Operating Environment. See "Types of File Systems" on page 182 for a description of the PCFS file system.

Formatting a Diskette with a PCFS (DOS) File System

graphics/new.gif

NOTE. Starting with the Solaris 8 release, fdformat has been superseded by the rmformat(1) command, which provides most fdformat functionality. However, the rmformat command does not provide an option for formatting PCFS file systems.


Use the following steps to format a diskette with the PCFS file system.

  1. Put a diskette in the drive.

    CAUTION. Reformatting destroys any files already on the diskette.


  2. Type fdformat -d and press Return.

    The message Press return to start formatting floppy is displayed.

  3. Press Return.

    While the diskette is being formatted, a series of dots (...) is displayed. When formatting is complete, the prompt is redisplayed, as shown in the following example.


oak% fdformat -d
Press return to start formatting floppy.
............................................................................
oak%



Mounting a PCFS Diskette

You can mount a PCFS diskette that was formatted with the fdformat -d command, or a DOS diskette that was formatted on a DOS system. When you mount a PCFS file system, you can create, read, write, and delete files in the file system with Solaris file commands, subject to DOS naming conventions. See the pcfs(7) manual page for more information about the format and features of the PCFS file system.

Use the following steps to mount a PCFS file system from a diskette.

  1. Insert the PCFS diskette in the drive.

  2. Become superuser.

  3. Type mount -F pcfs /dev/diskette mount-point and press Return.

    The file system is mounted on the mount-point you specify.

You can mount a PCFS file system with different mount options (for example, -o rw). See the mount_pcfs(1M) manual page for a description of the options that can be included in the list.

If you use PCFS diskettes frequently, you may want to add the following entry to your /etc/vfstab file.


/dev/diskette -   /pcfs   pcfs   -   no  rw

Create a directory named /pcfs to use as the mount point for the diskette. With the mount point and the entry in the /etc/vfstab file, you can mount a PCFS diskette by becoming superuser and typing mount /pcfs and pressing Return. Once the diskette is mounted, you can use any of the Solaris file commands such as cp or mv to copy files to and from the diskette.

Unmounting a PCFS Diskette

When you are done with the PCFS diskette, you must unmount it before you can eject it. To unmount the diskette, first make sure the current working directory is not in the mount point directory or any of its subdirectories. Then, type umount mount-point and press Return. To eject the diskette, type eject and press Return.

    [ Team LiB ] Previous Section Next Section