Previous Table of Contents Next


Listing the Files on a Diskette (tar)

Follow these steps to list files that were copied using 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 this example, the table of contents for the diskette contains two files:

oak% tar tvf /dev/rdiskette
rw-rw-rw-6693/1Ø  44Ø32 Apr 23 14:54 1991 evaluation.doc
rw-rw-rw-6693/1Ø  43ØØ8 Apr 23 14:47 1991 evaluation.doc.backup
oak%

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

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

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 keep the files already on the diskette and add other files, follow these steps:

1.  Change to the directory that contains the file you want to copy.
2.  Insert a write-enabled formatted diskette protected 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.

In this example, one file is appended 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/1Ø  44Ø32 Apr 23 14:54 1991 evaluation.doc
rw-rw-rw-6693/1Ø  43ØØ8 Apr 23 14:47 1991 evaluation.doc.backup
rw-rw-rw-6693/1Ø     18 Dec 1Ø 11:36 1991 junk
oak% eject
oak%

Retrieving Files from a Diskette (tar)

Follow these steps to retrieve files from a diskette:

1.  Change to the directory where 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.

In this example, all files are copied from the diskette:

oak% cd /home/winsor/Evaluations
oak% tar xvf /dev/rdiskette
x evaluation.doc, 44Ø32 bytes, 86 tape blocks
x evaluation.doc.backup, 43ØØ8 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. In this example, all files with the prefix evaluation are copied 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 SunOS 5.x system software. You can retrieve files from diskettes that were archived using 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.

Follow these steps to retrieve bar files from a diskette:

1.  Change to the directory where 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 will 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" earlier for information on how to use cpio.

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

If you want to mount a ufs diskette, you must make a file system on it first:

1.  Format the diskette.
2.  Become superuser.
3.  Type newfs /dev/rdiskette and press Return.

A ufs file system is created on the diskette:

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 SunOS 5.x system software. See Chapter 4, "Administering File Systems," for a description of the pcfs file system.

Formatting a Diskette with a pcfs (DOS) File System

Follow these 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%


Previous Table of Contents Next