Part IV Managing Removable Media
This part provides instructions for using removable media in the Solaris environment. This part contains these chapters.
Chapter 11 Guidelines for Using CDs and Diskettes (Overview)
This chapter provides general guidelines for using diskettes and CDs in the Solaris environment.
This is a list of overview information in this chapter.
Where to Find Managing Removable Media Tasks
Use these references to find step-by-step instructions for managing removable media.
For information on using removable media with File Manager in the OpenWindows environment or the Common Desktop Environment, see:
Features and Benefits
The Solaris environment gives users and software developers a standard interface for dealing with diskettes and CDs. Referred to as Volume Management, this interface provides three major benefits:
Comparison of Automatic and Manual Mounting
Table 11-1 compares the steps involved in manual mounting (without Volume Management) and automatic mounting (with Volume Management).
Table 11-1 Comparison of Manual and Automatic Mounting
|
Steps
|
Manual Mounting
|
Automatic Mounting
|
|
1
|
Insert media.
|
Insert media.
|
|
2
|
Become superuser.
|
For diskettes, use the volcheck command.
|
|
3
|
Determine the location of the media device.
|
Volume Management automatically performs many of tasks previously required to manually mount and work with CDs and diskettes.
|
|
4
|
Create a mount point.
|
|
|
5
|
Make sure you are not in the mount point directory.
|
|
|
6
|
Mount the device using the proper mount options.
|
|
|
7
|
Exit the superuser account.
|
|
|
8
|
Work with files on media.
|
Work with files on media.
|
|
9
|
Become superuser.
|
|
|
10
|
Unmount the media device.
|
|
|
11
|
Eject media.
|
Eject media.
|
|
12
|
Exit the superuser account.
|
|
What You Can Do With Diskettes and CDs
Essentially Volume Management enables you to access diskettes and CDs just as manual mounting does, but more easily and without the need for superuser access. To make diskettes and CDs easier to work with, they are mounted in easy-to-remember locations.
Table 11-2 How to Access Data on Diskettes and CDs
|
To Access ...
|
Insert ...
|
And Find The Files In ...
|
|
Files on a diskette
|
The diskette and enter volcheck
|
/vol/dev/aliases/floppy0
|
|
Raw data on a diskette
|
The diskette and enter volcheck
|
/vol/dev/aliases/floppy0
|
|
Files on a CD
|
The CD and wait for a few seconds
|
/cdrom/cdrom0
|
If your system has more than one diskette or CD-ROM drive, see Table 11-3 for their access points.
Table 11-3 Where to Access Diskettes and CDs
|
Media Device
|
Access File Systems On...
|
Access Raw Data On...
|
|
First diskette drive
|
/floppy/floppy0
|
/vol/dev/aliases/floppy0
|
|
Second diskette drive
|
/floppy/floppy1
|
/vol/dev/aliases/floppy1
|
|
First CD-ROM drive
|
/cdrom/cdrom0
|
/vol/dev/aliases/cdrom0
|
|
Second CD-ROM drive
|
/cdrom/cdrom1
|
/vol/dev/aliases/cdrom1
|
Chapter 12 Using CDs From the Command Line (Tasks)
This chapter describes all the tasks required to use CDs in the Solaris environment from the command line. This is a list of the step-by-step instructions in this chapter.
Using CDs Task Map
Table 12-1 Task Map: Using CDs
Using CD Names
When working with CDs, you can identify them by name or with a designator from Table 12-2 below. For brevity, task descriptions use cdrom0, but you can replace this with either the CD name or a different designator.
Table 12-2 How to Identify CDs
|
CD
|
Alternate Name
|
|
First CD-ROM drive
|
cdrom0
|
|
Second CD-ROM drive
|
cdrom1
|
|
Third CD-ROM drive
|
cdrom2
|
How to Load a CD
Insert the CD. Shortly after the light stops flashing (about five to ten seconds), the CD is mounted to /cdrom. To verify that the CD is mounted, perform the task "How to Examine the Contents of a CD".
Note -
Most CDs are formatted to the ISO 9660 standard, which is portable, so most CDs can be mounted by Volume Management. However, as described in Chapter 15, How Volume Management Works (Reference), UFS CDs are not portable between architectures, so they must be used on the architecture for which they were designed. If you are having trouble mounting a CD, particularly if it is an installation CD, make sure its UFS file system is appropriate for your system's architecture (check the label on the CD).
How to Examine the Contents of a CD
Use the ls -L command to view the contents of /cdrom directory.
$ ls -L [-l] /cdrom/cdrom0
|
|
-L
|
Includes symbolic links in the output.
|
|
-l
|
Long format. Includes permissions and owners in the output.
|
Example--Examining the Contents of a CD
The following example lists the contents of the CD loaded into the first CD-ROM directory, /cdrom/cdrom0.
$ ls -L -l /cdrom/cdrom0
dr-xr-xr-x 2 root sys 2048 Dec 31 1993 tools
dr-xr-xr-x 2 root sys 2048 Dec 31 1993 graphics
|
How to Copy Information From a CD
You can access a CD's files and directories just like any other file system. The only significant restrictions are ownership and permissions. For instance, if you copy a file from a CD into your file system, you'll be the owner, but you won't have write permissions (because the file never had them on the CD); you'll have to change the permissions yourself.
-
Make sure the CD is mounted.
The ls command displays the contents of a mounted CD. If no contents are displayed, see "How to Load a CD".
-
Copy the files or directories.
|
To Copy ...
|
Use ...
|
|
A file
|
cp
|
|
A directory
|
cp -r
|
Example--Copying Information From a CD
The following example uses cp to copy a single file from the /cdrom/solstice_sysmgt_2_3 directory into the system's working directory (denoted by the ".").
$ cp /cdrom/solstice_sysmgt_2_3/README .
$ ls -l
-r--r--r-- 1 pmorph users 4618 May 9 08:09 README
|
Note that when a file or directory is copied from a CD into your file system, you become its owner, but it retains the permissions it had on the CD:
-r--r--r--
To overwrite it, you'll need to change the permissions with the chmod command. See "Securing Files (Tasks)" in System Administration Guide, Volume II for more information on using the chmod command.
How to Find Out If a CD Is Still in Use
-
Become superuser.
-
Enter the fuser(1M) command.
The fuser command lists the processes that are currently accessing the CD that you specify.
# fuser -u [-k] /cdrom/cdrom0
|
|
-u
|
Displays the user of the CD.
|
|
-k
|
Kills the process accessing the CD.
|
The fuser command may not always identify all the killed processes. To be sure, run it again with the -u option.
Example--Finding Out If a CD Is Still in Use
In the following example, the processes 6400c and 6399c are accessing the /cdrom/cdrom0 directory, and the process owners are root and smith, respectively.
# fuser -u /cdrom/cdrom0
/cdrom/cdrom0: 6400c(root) 6399c(smith)
|
You can kill the processes individually (as superuser), or you can use the fuser command with the -k option, which kills all the processes accessing that file system, as shown in the following example.
# fuser -u -k /cdrom/cdrom0
/cdrom/cdrom0: 6400c(root)Killed 6399c(smith)Killed
|
How to Eject a CD
-
Make sure the CD is not being used.
Remember, a CD is "being used" if a shell or an application is accessing any of its files or directories. If you are not sure whether you have found all users of a CD (a shell hidden behind a desktop tool may be accessing it), use the fuser command, as described in "How to Find Out If a CD Is Still in Use".
-
Eject the CD.
How to Access CDs on Other Systems
You can access a CD on another system by mounting it manually into your file system--provided the other system has shared its CD-ROM according to the instructions in "How to Make Local CDs Available to Other Systems".
-
Select an existing directory to serve as the mount point or create one.
|
directory
|
The name of the directory that you create to serve as a mount point for the other system's CD.
|
-
Find the name of the CD you want to mount.
When you manually mount a remote CD, you cannot use the cdrom0 or cdrom1 variables available with your local CDs. You must use the exact CD name. To find it, use the ls command on the remote system's /cdrom directory. If the automounter is running, you can simply cd to the system whose CD you want to mount and then use the ls command. If the automounter is not running, you'll have to use another method, such as logging in remotely.
-
As superuser, mount the CD.
# mount -F nfs -o ro system-name:/cdrom/cd-name local-mount-point
|
|
system-name
|
The name of the system whose CD you will mount.
|
|
cd-name
|
The name of the CD you want to mount.
|
|
local-mount-point
|
The local directory onto which you will mount the remote CD.
|
-
Log out as superuser.
-
Verify that the CD is mounted by using the ls command to list the contents of the mount point.
Example--Accessing CDs on Other Systems
Note -
The name of this release is Solaris 7 but code and path or package path names may use Solaris 2.7 or SunOS 5.7. Always follow the code or path as it is written.
This example mounts the CD named Solaris_2.7_sparc from the remote system mars onto the /cdrom directory of the local system.
$ cd /net/mars
$ ls /cdrom
cdrom0 Solaris_2.7_sparc
$ su
Password: password
# mount -F nfs ro mars:/cdrom/Solaris_2.7_sparc /cdrom
# exit
$ ls /cdrom
Solaris_2.7_sparc
|
How to Make Local CDs Available to Other Systems
You can configure your system to share its CD-ROM drives; in other words, make any CDs in those drives available to other systems. (This does not apply to musical CDs.) Once your CD-ROM drives are shared, other systems can access the CDs they contain simply by mounting them, as described in "How to Access CDs on Other Systems".
-
Become superuser.
-
Find out whether the NFS daemon (nfsd) is running.
# ps -ef | grep nfsd
root 14533 1 17 10:46:55 ? 0:00 /usr/lib/nfs/nfsd -a 16
root 14656 289 7 14:06:02 pts/3 0:00 grep nfsd
|
If the daemon is running, a line for /usr/lib/nfs/nfsd will appear, as shown above. If the daemon is not running, only the grep nfsd line will appear.
-
Select an option from the following table.
|
If ...
|
Then ...
|
|
nfsd is running
|
Go to Step 8
|
|
nfsd is not running
|
Continue with Step 4
|
-
Create a dummy directory for nfsd to share.
|
dummy-dir
|
Can be any directory name; for example, dummy. This directory will not contain any files. Its only purpose is to "wake up" the NFS daemon so that it notices your shared CD-ROM.
|
-
Add the following entry into /etc/dfs/dfstab.
share -F nfs -o ro [-d comment] /dummy-dir
|
When you start the NFS daemon, it will see this entry, "wake up," and notice the shared CD-ROM drive. Note that the comment (preceded by -d) is optional.
-
Start the NFS daemon.
# /etc/init.d/nfs.server start
|
-
Verify that the NFS daemon is indeed running.
# ps -ef | grep nfsd
root 14533 1 17 10:46:55 ? 0:00 /usr/lib/nfs/nfsd -a 16
root 14656 289 7 14:06:02 pts/3 0:00 /grep nfsd
|
-
Eject any CD currently in the drive.
-
Assign root write permissions to /etc/rmmount.conf.
# chmod 644 /etc/rmmount.conf
|
-
Add the following lines to /etc/rmmount.conf.
# File System Sharing
share cdrom*
|
These lines share any CD loaded into your system's CD-ROM drive. You can, however, limit sharing to a particular CD or series of CDs, as described in share(1M).
-
Remove write permissions from /etc/rmmount.conf.
# chmod 444 /etc/rmmount.conf
|
This step returns the file to its default permissions.
-
Load a CD.
The CD you now load, and all subsequent CDs, will be available to other systems. Remember to wait until the light on the drive stops blinking before you verify this task.
To access the CD, the remote user must mount it by name, according to the instructions in "How to Access CDs on Other Systems".
-
Verify that the CD is indeed available to other systems by using the share command.
If the CD is available, its share configuration will be displayed. (The shared dummy directory will also be displayed.)
# share
- /dummy ro "dummy dir to wake up NFS daemon"
- /Solaris_2.7_sparc ro ""
|
Example--Making Local CDs Available to Other Systems
The following example makes any CD loaded into the local system's CD-ROM drive available to other systems on the network.
# ps -ef | grep nfsd
root 10127 9986 0 08:25:01 pts/2 0:00 grep nfsd
root 10118 1 0 08:24:39 ? 0:00 /usr/lib/nfs/nfsd -a
# mkdir /dummy
# vi /etc/dfs/dfstab
(Add the following line:)
share -F nfs -o ro /dummy
# eject cdrom0
# chmod 644 /etc/rmmount.conf
# vi /etc/rmmount
(Add the following line to the File System Sharing section.)
share cdrom*
# chmod 444 /etc/rmmount.conf
(Load a CD.)
# share
- /dummy ro ""
- /cdrom/solaris_2_6_sparc/s5 ro ""
- /cdrom/solaris_2_6_sparc/s4 ro ""
- /cdrom/solaris_2_6_sparc/s3 ro ""
- /cdrom/solaris_2_6_sparc/s2 ro ""
- /cdrom/solaris_2_6_sparc/s1 ro ""
- /cdrom/solaris_2_6_sparc/s0 ro ""
|
How to Configure a System to Play Musical CDs
You can play musical CDs from a CD-ROM attached to your Solaris system. You'll need to access Workman, which is public domain software, and you must attach external speakers or headphones independently to the CD-ROM drive; speakers attached to the system hardware will not work.
Once you configure your system, you can play a musical CD simply by inserting it into the CD-ROM drive. The Workman control panel is automatically displayed on your desktop.
-
Become superuser.
-
Edit /etc/rmmount.conf.
Add the following line under # Actions, before the cdrom action, as shown in the example below.
# Actions
action cdrom action_workman.so path/workman workman-options
|
|
path
|
The directory in which you have placed the Workman software.
|
|
workman-options
|
The options allowed by the Workman software
|
Example--Configuring a System to Play Musical CDs
This example shows an /etc/rmmount.conf file modified to support the Workman software.
# @(#)rmmount.conf 1.3 96/05/10 SMI
#
# Removable Media Mounter configuration file.
#
# File system identification
ident hsfs ident_hsfs.so cdrom
ident ufs ident_ufs.so cdrom floppy rmscsi pcmem
ident pcfs ident_pcfs.so floppy rmscsi pcmem
# Actions
action cdrom action_workman.so /usr/dist/exe/workman
action cdrom action_filemgr.so
action floppy action_filemgr.so
action rmscsi action_filemgr.so
# File System Sharing
share cdrom*
share floppy*
|
How to Prepare a System for a New CD-ROM Drive
On a system that is properly booted with the boot -r command, Volume Management will automatically recognize a new CD-ROM drive. However, to make sure Volume Management always recognizes a new drive, create the /reconfigure file.
-
Become superuser.
-
Create a file called /reconfigure.
The /reconfigure file makes the Solaris environment check for the presence of any newly installed peripheral devices when you power on or boot your system. After that, Volume Management locates the new device and automatically manages it for you.
Configuring Volume Management
Occasionally, you may want to manage diskettes or CDs without the help of Volume Management. This section describes how to stop and restart Volume Management.
How to Stop Volume Management
-
Make sure no diskettes or CDs are being used.
If you are not sure whether you have found all users of the diskette or CD, use the fuser command, as described in "How to Find Out If a CD Is Still in Use".
-
Become superuser.
-
Enter the volmgt stop command.
# /etc/init.d/volmgt stop
#
|
How to Restart Volume Management
-
Become superuser.
-
Enter the volmgt start command.
# /etc/init.d/volmgt start
volume management starting.
|
Chapter 13 Formatting and Using Diskettes From the Command Line (Tasks)
This chapter describes all the tasks required to format and use diskettes from the command line in the Solaris environment. This is a list of the step-by-step instructions in this chapter.
Formatting Diskettes Task Map
Table 13-1 Task Map: Formatting Diskettes
Using Diskette Names
When working with diskettes, you can identify them by name or with a designator from Table 13-2. For brevity, task descriptions use floppy0, but you can replace this with either the diskette name or a different designator.
Table 13-2 How to Identify Diskettes
|
Diskette
|
Alternate Name
|
|
First diskette drive
|
floppy0
|
|
Second diskette drive
|
floppy1
|
|
Third diskette drive
|
floppy2
|
Note -
Diskettes that are not named (that is, they have no "label") are assigned the default name of noname.
Hardware Considerations
A Solaris system can format diskettes for use on both Solaris and DOS systems. However, the hardware platform imposes some limitations. They are summarized in the table below.
|
Solaris on this Platform ...
|
Can Format Diskettes For ...
|
|
Solaris on SPARC
|
Solaris on SPARC (UFS)
|
|
|
MS-DOS or NEC-DOS (PCFS)
|
|
Solaris on x86
|
Solaris on x86 (UFS)
|
|
|
MS-DOS or NEC-DOS (PCFS)
|
Diskettes formatted for UFS are restricted to the hardware platform on which they were formatted. In other words, a UFS diskette formatted on a SPARC platform cannot be used for UFS on an x86 platform, nor can a diskette formatted on an x86 platform be used on a SPARC platform. This is because the SPARC and x86 UFS formats are different. SPARC uses little-endian bit coding, x86 uses big-endian.
A complete format for SunOS file systems consists of the basic "bit" formatting plus the structure to support a SunOS file system. A complete format for a DOS file system consists of the basic "bit" formatting plus the structure to support either an MS-DOS or an NEC-DOS file system. The procedures required to prepare a diskette for each type of file system are different. Therefore, before you format a diskette, consider which procedure to follow. See "Formatting Diskettes Task Map".
On a Solaris system (either SPARC or x86), you can format diskettes of seven different densities (provided you have the appropriate drive).
|
Diskette Size
|
Diskette Density
|
Capacity
|
|
3.5"
|
Extended Density
|
2.88 Mbytes
|
|
3.5"
|
High Density (HD)
|
1.44 Mbytes
|
|
3.5"
|
Medium Density (DD)
|
1.2 Mbytes
|
|
3.5"
|
Low Density
|
720 Kbytes
|
|
5.25"
|
High Density (HD)
|
1.2 Mbytes
|
|
5.25"
|
Medium
Density (DD)
|
720 Kbytes
|
|
5.25"
|
Low Density
|
360 Kbytes
|
By default, the diskette drive formats a diskette to a like density. In other words, a 1.44 Mbyte drive attempts to format a diskette for 1.44 Mbytes, whether the diskette is in fact a 1.44 Mbyte diskette or not--unless you instruct it otherwise. You can tell a 1.44 Mbyte drive to format a diskette to, for instance, 720 Kbytes. You cannot, however, instruct a 720 Kbyte drive to format a diskette to 1.44 Mbyte. In other words, a diskette can be formatted to its capacity or lower, and a drive can format to its capacity or lower.
To instruct a drive to format a diskette to a non-default density, use the fdformat command as instructed in the following tasks, but use the appropriate density option from Table 13-3, below.
Table 13-3 Density Options
|
To Format a Diskette With This Density ...
|
In a Drive With This Default Density ...
|
Use This Density Option to the fdformat Command ...
|
|
2.88 Mbytes
|
2.88 Mbytes
|
-E
|
|
1.44 Mbytes
|
2.88 Mbytes
|
-H
|
|
1.44 Mbytes
|
1.44 Mbytes
|
none
|
|
1.2 Mbytes
|
1.44 Mbytes
|
-t nec -M
|
|
720 Kbytes
|
1.44 Mbytes
|
-D or -t dos -D
|
|
1.2 Mbytes
|
1.2 Mbytes
|
none
|
|
720 Kbytes
|
1.2 Mbytes
|
-D
|
|
720 Kbytes
|
720 Kbytes
|
none
|
|
360 Kbytes
|
720 Kbytes
|
-D
|
To view all the options to the fdformat command, either see fdformat(1) or enter fdformat -z. The -z option displays all the options to the command.
If you don't know the default density of your drive, begin the formatting process with the default setting (that is, no density options) and observe the configuration message. It will look something like this:
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy.
|
The confirmation message indicates the drive's default density. For instance, in the example above, the default density of the drive is 1.44 Mbytes. If the density is not what you expected, use Control-c to escape the formatting process and start over.
How to Format a UFS Diskette
As mentioned in "Hardware Considerations", a UFS diskette formatted on a SPARC platform can only be used on another SPARC platform, and a UFS diskette formatted on an x86 platform can only be used on an x86 platform running Solaris.

Caution -
Formatting a diskette erases any pre-existing content.
-
Quit File Manager.
File Manager automatically displays a formatting window when you insert an unformatted diskette. Unfortunately, File Manager formatting is unreliable. To avoid the window, quit from File Manager. If you prefer to keep File Manager open, quit the formatting window when it appears.
-
Make sure the diskette is write-enabled.
On both 3.5-inch and 5.25 inch diskettes, write-protection is controlled by a small tab in either the lower left or lower right corner. If you can see through the square hole behind the tab, the diskette is write-protected. If the hole is covered by the tab, the diskette is write-enabled. (If you need to eject the diskette to examine it, simply type eject floppy in a shell.)
-
Insert the diskette.
Make sure the diskette is completely inserted.
-
Invoke formatting.
$ fdformat -v -U [density-options convenience-options]
|
|
-v
|
Verifies whether the diskette was formatted correctly.
|
|
-U
|
Unmounts the diskette if it is mounted.
|
|
density-options
|
If the drive density is 1.44 Mbytes, density-options are:
|
|
|
--none--
|
Formats a 1.44 Mbyte diskette.
|
|
|
-D
|
Formats a 720 Kbyte diskette.
|
|
|
|
A complete list of density-options appears in Table 13-3.
|
|
convenience-options
|
|
|
|
-e
|
Ejects the diskette when done formatting.
|
|
|
-f
|
Forces formatting without asking for confirmation.
|
|
|
-b label
|
Names the diskette. label must be eight characters or less, upper or lower case.
|
|
|
-z
|
Lists all the options to the fdformat command, but does not format the diskette.
|
Note -
If you try to format a 720 Kbyte (DD) diskette for 1.44 Mbytes, fdformat will not stop you unless you include the -v option. With the -v option, fdformat will format the diskette, but the verification will catch the error and notify you with the following message: fdformat: check diskette density, I/O error
The fdformat command displays a confirmation message (unless you used the -f option), indicating the type of formatting to be performed:
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy.
|
-
Select one of the options in the table below.
|
To ...
|
Press ...
|
|
Confirm the type of formatting
|
Return (unless you used the -f option in the previous step, in which case no confirmation is necessary)
|
|
Cancel formatting
|
Control-c
|
As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of V's appears beneath the dots. When the series stops, the formatting is complete.
The diskette is now ready for raw character operations such as tar and cpio.
Examples--Formatting a UFS Diskette
Following are several examples of UFS formatting. The first example formats a 1.44 Mbyte diskette on a 1.44 Mbyte drive:
$ fdformat -v -U
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
The following example performs the same job, but assigns the diskette the name myfiles:
$ fdformat -v -U -b myfiles
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
The following example formats a 720Kbyte diskette on a 1.44 Mbyte drive, and names it myfiles:
$ fdformat -v -U -D -b myfiles
Formatting 720 KB in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
How to Place a UFS File System on a Diskette
Even though the procedure for adding a UFS file system is the same for UFS diskettes formatted on x86 platforms and SPARC platforms, a UFS diskette formatted on a SPARC platform can only be used on another SPARC platform, and a UFS diskette formatted on an x86 platform can only be used on an x86 platform running Solaris.
-
Format the diskette for a UFS file system.
Use "How to Format a UFS Diskette".
-
Create a SunOS file system on the diskette.
$ /usr/sbin/newfs -v /vol/dev/aliases/floppy0
|
|
-v
|
Prints status messages.
|
|
/vol/dev/aliases/floppy0
|
Indicates the location of the floppy.
|
The newfs(1M) command displays a message asking you to confirm the creation of the file system.
-
Confirm the creation of the file system.
newfs: construct a new file system
/vol/dev/aliases/floppy0:(y/n)? y
|
A status message is displayed, indicating the particulars of the file system and the diskette's formatting.
The diskette is now ready to be used on a SPARC platform. However, before Volume Management recognizes it, you must run the volrmmount command, as described in the following steps.
-
Invoke the volrmmount command using the -i option to notify Volume Management that the diskette is inserted.
-
Verify that the UFS file system is on the diskette by using the ls command on the /floppy directory.
If the floppy0 subdirectory appears, the diskette has a UFS file system and has been mounted properly.
Example--Placing a UFS File System on a Diskette
$ volcheck -v
media was found
$ /usr/sbin/newfs -v /vol/dev/aliases/floppy0
newfs: construct a new file system /vol/dev/aliases/floppy0: (y/n)? y
mkfs -F ufs /vol/dev/aliases/floppy0 2880 18 2 8192 1024 16 10 5 2048
t 0 -1 8 15
/vol/dev/aliases/floppy0: 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,
$ volrmmount -i floppy0
$ ls /floppy
floppy0
|
How to Format a DOS Diskette
You can format a DOS diskette on a SPARC or x86 Solaris platform. The steps are similar, except that instead of a SunOS file system being placed on the diskette, a DOS file system, either MS-DOS or NEC-DOS, is put on the file system.

Caution -
Formatting a diskette erases any pre-existing content.
-
Quit File Manager.
File Manager automatically displays a formatting window when you insert an unformatted diskette. Unfortunately, File Manager formatting is unreliable. To avoid the window, quit from File Manager. If you prefer to keep File Manager open, quit the formatting window when it appears.
-
Make sure the diskette is not write-protected.
On both 3.5-inch and 5.25 inch diskettes, write-protection is controlled by a small tab in either the lower left or lower right corner. If you can see through the square hole behind the tab, the diskette is write-protected. If the hole is covered by the tab, the diskette is write-enabled. (If you need to eject the diskette to examine it, simply type eject floppy in a shell.)
-
Insert the diskette.
Make sure the diskette is completely inserted. It must drop down into the drive.
-
Invoke formatting.
$ fdformat -v -U [density-options convenience-options]
|
|
-v
|
Verifies whether the diskette was formatted correctly.
|
|
-U
|
Unmounts the diskette if it is mounted.
|
|
density-options
|
If the drive density is 1.44 Mbytes, density-options are:
|
|
|
-d
|
Formats at 1.44 Mbytes for MS-DOS.
|
|
|
-d -D
|
Formats at 720 Kbytes for MS-DOS.
|
|
|
-t nec -M
|
Formats at 1.2 Mbytes for NEC-DOS.
|
|
|
|
A complete list of density-options appears in Table 13-3.
|
|
convenience-options
|
|
|
|
-e
|
Ejects the diskette when done formatting.
|
|
|
-f
|
Does not ask for confirmation before formatting.
|
|
|
-b label
|
Name for the diskette. label must be eight characters or less, upper or lower case.
|
|
|
-z
|
Lists all the options to the fdformat command, but does not format the diskette.
|
Note -
If you try to format a 720 Kbyte (DD) diskette for 1.44 Mbytes, fdformat will not stop you unless you include the -v option. With the -v option, fdformat will format the diskette, but the verification will catch the error and notify you with the following message: fdformat: check diskette density, I/O error
The fdformat command displays a confirmation message, indicating the type of formatting to be performed:
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy.
|
-
Select one of the options in the table below.
|
To ...
|
Press ...
|
|
Confirm the type of formatting
|
Return (unless you used the -f option in the previous step, in which case no confirmation is necessary).
|
|
Cancel formatting
|
Control-c.
|
As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of V's appears beneath the dots. When the series stops, the formatting is complete and the diskette is ready for use on a DOS system.
-
Run the volrmmount(1) command using the -i option to notify Volume Management that the diskette is inserted.
Volume Management mounts the diskette under /floppy/floppy0.
Example--Formatting a DOS Diskette
The following example formats a 1.44 Mbyte MS-DOS diskette and assigns the diskette the name myfiles:
$ fdformat -v -U -b myfiles
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
Using Diskettes Task Map
Table 13-4 Task Map: Using Diskettes
How to Load a Diskette
-
Make sure the diskette is formatted.
If you aren't sure, insert it and check the status messages in the console, as described in Step 3. If you need to format the diskette, go to "How to Format a UFS Diskette" or "How to Format a DOS Diskette".
-
Insert the diskette.
Make sure the diskette is completely inserted. It must drop down into the drive. If the drive has a door, close it.
-
Notify Volume Management.
$ volcheck -v
media was found
|
Two status messages are possible:
|
media was found
|
Volume Management detected the diskette and will attempt to mount it in the /floppy directory.
If the diskette is formatted properly, no error messages appear in the console.
If the diskette is not formatted, the "media was found" message is still displayed, but the following error messages appear in the Console:
fd0: unformatted diskette or no
diskette in the drive
fd0: read failed (40 1 0)
fd0: bad format
You must format the diskette before Volume Management can mount it. Instructions are provided on "How to Format a UFS Diskette" (for UFS) and "How to Format a DOS Diskette" (for DOS).
|
|
no media was found
|
Volume Management did not detect a diskette. Make sure the diskette is inserted properly and run volcheck(1) again. If unsuccessful, check the diskette; it could be damaged. You can also try to mount the diskette manually.
|
-
Verify that the diskette was mounted by listing its contents.
$ ls /floppy
floppy0 myfiles
|
As described earlier, floppy0 is a symbolic link to the actual name of the diskette; in this case, myfiles. If the diskette has no name but is formatted correctly, the system will refer to it as unnamed_floppy.
If nothing appears under the /floppy directory, the diskette was either not mounted or is not formatted properly. To find out, run the mount command and look for the line that begins with /floppy (usually at the end of the listing):
/floppy/name on /vol/dev/diskette0/name ...
If the line does not appear, the diskette was not mounted. Check the Console for error messages.
How to Examine the Contents of a Diskette
Use the ls -L command because some directories under /floppy are symbolic links.
|
-L
|
Includes symbolic links in the output
|
|
-l
|
Long format. Includes permissions and owners in the output.
|
Example--Examining the Contents of a Diskette
The following example lists the contents of the diskette in the first floppy drive, identified by floppy0.
$ ls -L -l /floppy/floppy0
-rwxrwxrwx 1 smith staff 362284 Nov 16 20:54 text.doc
-rwxrwxrwx 1 smith staff 24562 Nov 16 12:20 art.gif
|
How to Copy or Move Information From a Diskette
Once you have inserted a diskette, you can access its files and directories just as you would those of any other file system. The only significant restrictions are ownership and permissions. For instance, if you are not the owner of a file on a diskette, you won't be able to overwrite that file on the diskette. Or, if you copy a file into your file system, you'll be the owner, but that file won't have write permissions (because it never had them on the diskette); you'll have to change the permissions yourself.
-
Make sure the diskette is formatted and mounted.
$ ls /floppy
floppy0 diskette-name
|
If the diskette is properly formatted and mounted, its name and the symbolic link will appear under /floppy.
If nothing appears under the /floppy directory, the diskette is not mounted. See "How to Load a Diskette". The diskette might also need to be formatted. See "How to Format a UFS Diskette" or "How to Format a DOS Diskette".
-
Copy the files or directories.
|
To Copy ...
|
Use ...
|
|
A file
|
cp
|
|
A directory
|
cp -r
|
-
Verify the copy or move operation by using the ls command.
Examples--Copying or Moving Information from a Diskette
The first example, below, moves a file (readme.doc) from the diskette to the current directory (indicated by the "." symbol). The second example copies a file (readme2.doc) from the diskette to the current directory. The third example copies a directory (morefiles) and everything below it from the diskette to the current directory.
$ mv /floppy/floppy0/readme.doc .
$ cp /floppy/floppy0/readme2.doc .
$ cp -r /floppy/floppy0/morefiles .
|
How to Copy or Move Information to a Diskette
-
Make sure the diskette is not write-protected.
On both 3.5-inch and 5.25 inch diskettes, write-protection is controlled by a small tab in either the lower left or lower right corner. If you can see through the square hole behind the tab, the diskette is write-protected. If the hole is covered by the tab, the diskette is write-enabled.
-
Make sure the diskette is formatted and mounted.
$ ls /floppy
floppy0 diskette-name
|
If the diskette is properly formatted and mounted, its name and the symbolic link, floppy0, will appear under /floppy.
If nothing appears under the /floppy directory, the diskette is not mounted. See "How to Load a Diskette". The diskette might also need to be formatted. See "How to Format a UFS Diskette" or "How to Format a DOS Diskette".
-
Move or copy the files or directories.
|
To ...
|
Use ...
|
|
Copy a file
|
cp
|
|
Copy a directory
|
cp -r
|
|
Move a file or directory
|
mv
|
-
Verify a move or copy operation by using the ls command.
Examples--Copying or Moving Information to a Diskette
The first example, below, moves a file (readme.doc) from the current directory to the diskette loaded into the first floppy drive (indicated by /floppy/floppy0). The second example copies a file (readme2.doc) from the current directory to the diskette loaded into the second floppy drive (indicated by /floppy/floppy1). The third example copies a directory (morefiles) and its contents from the /home/smith/directory to the diskette loaded into the first floppy drive.
$ mv readme.doc /floppy/floppy0
$ cp readme2.doc /floppy/floppy1
$ cp -r /home/smith/morefiles /floppy/floppy0
|
How to Find Out If a Diskette Is Still in Use
-
Become superuser.
-
Invoke the fuser command.
The fuser command lists the processes that are currently accessing the CD that you specify.
|
-u
|
Displays the user of the diskette.
|
|
-k
|
Kills the process accessing the diskette.
|
Example--Finding Out If a Diskette Is Still In Use
In the following example, the processes 6400c and 6399c are accessing the /floppy/floppy0 directory, and the process owners are root and smith, respectively.
# fuser -u /floppy/floppy0
/floppy/floppy0: 6400c(root) 6399c(smith)
|
You can kill the processes individually (as superuser), or you can use the fuser command with the -k option, which kills all the processes accessing that file system. The fuser command may not always identify all the killed processes. To be sure, run it again with the -u option.
# fuser -u -k /floppy/floppy0
/floppy/floppy0: 6400c(root)Killed 6399c(smith)Killed
|
How to Eject a Diskette
-
Make sure the diskette is not being used.
Remember, a diskette is "being used" if a shell or an application is accessing any of its files or directories.
If you are not sure whether you have found all users of a diskette (a renegade shell hidden behind a desktop tool may be accessing it), use the fuser command, as described in "How to Find Out If a Diskette Is Still in Use".
-
Eject the diskette.
On a SPARC platform the floppy is physically ejected from its drive, but on an x86 platform you'll have to eject the diskette by hand. If you are running Windows, look for an onscreen message that says you can now eject the diskette.
If the diskette is still in use, the following message appears:
/vol/dev/rdiskette0/noname: Device busy
|
In this case, return to Step 1 and make sure no one is using the diskette, then eject it again.
If the diskette jams, eject it manually by inserting an unfolded paper clip about an inch into the small hole in the front of the drive.
How to Access Diskettes on Other Systems
You can access a diskette on another system by mounting it manually into your file system--provided the other system has shared its diskette drive according to the instructions in "How to Make Local Diskettes Available to Other Systems".
-
Select an existing directory to serve as the mount point or create one.
|
directory
|
Is the name of the directory that you create to serve as a mount point for the other system's diskette.
|
-
Find the name of the diskette you want to mount.
When you manually mount a remote diskette, you cannot use the floppy0 or floppy1 variables available with your local diskettes. You must use the exact diskette name. To find it, use the ls command on the remote system's /floppy directory. If the automounter is running, you can simply cd to the system whose diskette you want to mount and then use the ls command. If the automounter is not running, you'll have to use another method, such as logging in remotely.
-
As superuser, mount the diskette.
# mount -F nfs -o rw system-name:/floppy/diskette-name local-mount-point
|
|
system-name
|
The name of the system whose diskette you will mount.
|
|
diskette-name
|
The name of the diskette you want to mount
|
|
local-mount-point
|
The local directory onto which you will mount the remote diskette.
|
-
Log out as superuser.
-
Verify that the diskette is mounted by using the ls command to list the contents of the mount point.
Example--Accessing Diskettes on Other Systems
This example mounts the diskette named myfiles from the remote system mars onto the /floppy directory of the local system.
$ cd /net/mars
$ ls /floppy
floppy0 myfiles
$ su
Password: password
# mount -F nfs rw mars:/floppy/myfiles /floppy
# exit
$ ls /floppy
myfiles
|
How to Make Local Diskettes Available to Other Systems
You can configure your system to share its diskettes; in other words, make any diskettes in those drives available to other systems. Once your diskette drives are shared, other systems can access the diskettes they contain simply by mounting them, as described in "How to Access Diskettes on Other Systems".
-
Become superuser.
-
Find out whether the NFS daemon (nfsd) is running.
# ps -ef | grep nfsd
root 14533 1 17 10:46:55 ? 0:00 /usr/lib/nfs/nfsd -a 16
root 14656 289 7 14:06:02 pts/3 0:00 grep nfsd
|
If the daemon is running, a line for /usr/lib/nfs/nfsd will appear, as shown above. If the daemon is not running, only the grep nfsd line will appear.
-
Select an option from the following table.
|
If ...
|
Then ...
|
|
nfsd is running
|
Go to Step 8
|
|
nfsd is not running
|
Continue with Step 4
|
-
Create a dummy directory for nfsd to share.
|
dummy-dir
|
Can be any directory name; for example, dummy. This directory will not contain any files. Its only purpose is to "wake up" the NFS daemon so that it notices your shared diskettes.
|
-
Add the following entry into /etc/dfs/dfstab.
share -F nfs -o ro [-d comment] /dummy-dir
|
When you start the NFS daemon, it will see this entry, "wake up," and notice the shared diskette drive. Note that the comment (preceded by -d) is optional.
-
Start the NFS daemon.
# /etc/init.d/nfs.server start
|
-
Verify that the NFS daemon is indeed running.
# ps -ef | grep nfsd
root 14533 1 17 10:46:55 ? 0:00 /usr/lib/nfs/nfsd -a 16
root 14656 289 7 14:06:02 pts/3 0:00 /grep nfsd
|
-
Eject any diskette currently in the drive.
-
Assign root write permissions to /etc/rmmount.conf.
# chmod 644 /etc/rmmount.conf
|
-
Add the following lines to /etc/rmmount.conf.
# File System Sharing
share floppy*
|
These lines share any diskette loaded into your system's diskette drives.
-
Remove write permissions from /etc/rmmount.conf.
# chmod 444 /etc/rmmount.conf
|
This step returns the file to its default permissions.
-
Load a diskette.
--Insert the diskette--
# volcheck -v
media was found
|
The diskette you now load, and all subsequent diskettes, will be available to other systems. To access the diskette, the remote user must mount it by name, according to the instructions in "How to Access Diskettes on Other Systems".
-
Verify that the diskette is available to other systems by using the share(1M) command.
If the diskette is available, its share configuration will be displayed. (The shared dummy directory will also be displayed.)
# share
- /dummy ro "dummy dir to wake up NFS daemon"
- /myfiles rw ""
|
Example--Making Local Diskettes Available to Other Systems
The following example makes any diskette loaded into the local system's diskette drive available to other systems on the network.
# ps -ef | grep nfsd
root 10127 9986 0 08:25:01 pts/2 0:00 grep nfsd
root 10118 1 0 08:24:39 ? 0:00 /usr/lib/nfs/nfsd -a
# mkdir /dummy
# vi /etc/dfs/dfstab
(Add the following line:)
share -F nfs -o ro /dummy
# eject floppy0
# chmod 644 /etc/rmmount.conf
# vi /etc/rmmount
(Add the following line to the File System Sharing section.)
share floppy*
# chmod 444 /etc/rmmount.conf
(Load a diskette.)
# volcheck -v
media was found
# share
- /dummy ro ""
- /floppy/myfiles rw ""
|
Chapter 14 Using PCMCIA Memory Cards From the Command Line (Tasks)
This chapter describes all the tasks required to format and use PCMCIA memory cards from the command line in the Solaris environment.
This is a list of the step-by-step instructions in this chapter.
Formatting PCMCIA Memory Cards Task Map
Table 14-1 Task Map: Formatting PCMCIA Memory Cards
Using PCMCIA Memory Cards Names
When working with PCMCIA memory cards, you can identify them by name or with a designator from Table 14-2. For brevity, task descriptions use pcmem0, but you can replace it with either the PCMCIA memory card's name or a different designator.
Table 14-2 How to Identify PCMCIA Memory Cards
|
PCMCIA Card
|
Alternate Name
|
|
First PCMCIA drive
|
pcmem0
|
|
Second PCMCIA drive
|
pcmem1
|
|
Third PCMCIA drive
|
pcmem2
|
Note -
PCATA drives that are not named (that is, they have no "label") are assigned the default name of noname.
Hardware Considerations
A Solaris platform can format PCMCIA memory cards for use on both Solaris and DOS platforms. However, the hardware platform imposes some limitations. They are summarized in the table below.
|
Solaris on This Platform ...
|
Can Format PCMCIA Memory Cards For ...
|
|
Solaris on SPARC
|
Solaris on SPARC (UFS)
|
|
|
MS-DOS or NEC-DOS (PCFS)
|
|
Solaris on x86
|
Solaris on x86 (UFS)
|
|
|
MS-DOS or NEC-DOS (PCFS)
|
PCMCIA memory cards formatted for UFS are restricted to the hardware platform on which they were formatted. In other words, a UFS PCMCIA memory card formatted on a SPARC platform cannot be used for UFS on an x86 platform. Likewise, PCMCIA memory cards formatted on an x86 platform cannot be used on a SPARC platform. This is because the SPARC and x86 UFS formats are different.
A complete format for UFS file systems consists of the basic "bit" formatting plus the structure to support a UFS file system. A complete format for a DOS file system consists of the basic "bit" formatting plus the structure to support either an MS-DOS or an NEC-DOS file system. The procedures required to prepare a PCMCIA memory card for each type of file system are different. Therefore, before you format a PCMCIA memory card, consider which file system you are using. See "Formatting PCMCIA Memory Cards Task Map".
To view all the options to the fdformat command, either see fdformat(1) or enter fdformat -z. The -z option displays all the options to the command.
How to Format a UFS PCMCIA Memory Card
As mentioned in the introduction, a UFS PCMCIA memory card formatted on a SPARC platform can be used only on another SPARC platform, and a UFS PCMCIA memory card formatted on an x86 platform can be used only on an x86 platform running the Solaris release.

Caution -
Formatting a PCMCIA memory card erases any pre-existing content.
-
Quit File Manager.
File Manager automatically displays a formatting window when you insert an unformatted PCMCIA memory card. Unfortunately, File Manager formatting is unreliable. To avoid the window, quit File Manager. If you prefer to keep File Manager open, quit the formatting window when it appears.
-
Make sure the PCMCIA memory card is write-enabled.
Write-protection is controlled by a small slide switch in the end of the PCMCIA memory card.
-
Insert the PCMCIA memory card.
Make sure the PCMCIA memory card is completely inserted.
-
Invoke formatting.
$ fdformat -v -U [convenience-options]
|
|
-v
|
Verifies whether the PCMCIA memory card was formatted correctly.
|
|
-U
|
Unmounts the PCMCIA memory card if it is mounted.
|
|
convenience-options
|
|
|
|
-e
|
Ejects the PCMCIA memory card when done formatting.
|
|
|
-f
|
Forces formatting without asking for confirmation.
|
|
|
-b label
|
Names the PCMCIA memory card. label must be eight characters or less, upper or lower
case.
|
|
|
-z
|
Lists all the options to the fdformat command, but does not format the PCMCIA memory card.
|
The fdformat command displays a confirmation message (unless you used the -f option), indicating the type of formatting to be performed:
Formatting in /vol/dev/aliases/pcmem0
Press return to start formatting pcmem0.
|
-
Select one of the options in the table below.
|
To ...
|
Press ...
|
|
Confirm the type of formatting
|
Return (unless you used the -f option in the previous step, in which case no confirmation is necessary).
|
|
Cancel formatting
|
Control-c.
|
As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of V's appears beneath the dots. When the series stops, the formatting is complete.
The PCMCIA memory card is now ready for raw character operations such as tar and cpio.
Examples--Formatting a UFS PCMCIA Memory Card
Following are examples of UFS formatting.
$ fdformat -v -U
Formatting in /vol/dev/aliases/unformatted
Press return to start formatting pcmem0. [ Return ]
.........................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
The following example performs the same job, but assigns the PCMCIA memory card the name myfiles:
$ fdformat -v -U -b myfiles
Formatting in /vol/dev/aliases/unformatted
Press return to start formatting pcmem0. [ Return ]
.........................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
How to Place a UFS File System on a PCMCIA Memory Card
Even though the procedure for adding a UFS file system is the same for UFS PCMCIA memory cards formatted on x86 platforms and SPARC platforms, a UFS PCMCIA memory card formatted on a SPARC platform can only be used on another SPARC platform, and a UFS PCMCIA memory card formatted on an x86 platform can only be used on an x86 platform running Solaris.
-
Format the PCMCIA memory card for a UFS file system.
Use the procedure "How to Format a UFS PCMCIA Memory Card".
-
Use the newfs(1M) command and the full pathname to the Volume Management directory to create a UFS file system on the PCMCIA memory card.
$ /usr/sbin/newfs -v /vol/dev/aliases/pcmem0
|
|
-v
|
Prints status messages.
|
|
/vol/dev/aliases/pcmem0
|
Indicates the location of the memory card.
|
The newfs(1M) command displays a message asking you to confirm the creation of the file system.
-
Confirm the creation of the file system.
newfs: construct a new file system \
/vol/dev/aliases/pcmem0:(y/n)? y
|
A status message is displayed, indicating the particulars of the file system and the PCMCIA memory card's formatting:
mkfs -F ufs /vol/dev/aliases/pcmem0 2848 8 2 8192 1024 16 \
10 60 2048 t 0 -1 8 -1
/vol/dev/aliases/pcmem0: 2848 sectors in 128 cylinders of \
2 tracks, 8 sectors
1.0MB in 8 cyl groups (16 c/g, 0.12MB/g, 64 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 304, 544, 816, 1056, 1328, 1568, 1840
|
The PCMCIA memory card is now ready to be used on a SPARC platform. However, before Volume Management recognizes the memory card, you must use the volrmmount(1) command as described in the following step.
-
Use the volrmmount command with the -i option to notify Volume Management that the memory card is inserted.
The PCMCIA memory card should now be mounted under /pcmem/pcmem0.
-
Verify the UFS file system is on the PCMCIA card by using the ls command on the /pcmem directory.
If the pcmem0 subdirectory appears, the PCMCIA memory card has a UFS file system and has been mounted properly.
Example--Placing a UFS File System on a PCMCIA Memory Card
$ volcheck -v
media was found
$ /usr/sbin/newfs -v /vol/dev/aliases/pcmem0
newfs: construct a new file system \
/vol/dev/aliases/pcmem0:(y/n)? y
mkfs -F ufs /vol/dev/aliases/pcmem0 ...
$ volrmmount -i pcmem0
media was found
|
How to Format a DOS PCMCIA Memory Card
You can format a DOS PCMCIA memory card on a SPARC or x86 Solaris platform. The steps are similar, except that instead of a SunOS file system being placed on the PCMCIA memory card, a DOS file system, either MS-DOS or NEC-DOS, is put on the file system.

Caution -
Formatting a PCMCIA memory card erases any pre-existing content.
-
Quit File Manager.
File Manager automatically displays a formatting window when you insert an unformatted PCMCIA memory card. Unfortunately, File Manager formatting is unreliable. To avoid the window, quit File Manager. If you prefer to keep File Manager open, quit the formatting window when it appears.
-
Make sure the PCMCIA memory card is not write-protected.
Write-protection is controlled by a small slide switch in the end of the PCMCIA memory card.
-
Insert the PCMCIA memory card.
Make sure the PCMCIA memory card is completely inserted. It must drop down into the drive.
-
Invoke formatting.
$ fdformat -v -U [density-options convenience-options]
|
|
-v
|
Verifies whether the PCMCIA memory card was formatted correctly.
|
|
-U
|
Unmounts the PCMCIA memory card if it is mounted.
|
|
density-options
|
If the drive density is 1.44 Mbytes, density-options are:
|
|
|
-d
|
Formats for MS-DOS.
|
|
|
-t nec -M
|
Formats at 1.2 Mbytes for NEC-DOS.
|
|
|
|
A complete list of density-options appears in fdformat(1).
|
|
convenience-options
|
|
|
|
-e
|
Ejects the PCMCIA memory card when done formatting.
|
|
|
-f
|
Does not ask for confirmation before formatting.
|
|
|
-b label
|
Name for the PCMCIA memory card. Label must be eight characters or less, upper or lower case.
|
|
|
-z
|
Lists all the options to the fdformat command, but does not format the PCMCIA memory card.
|
Note -
If you try to format a 720 Kbyte (DD) diskette for 1.44 Mbytes, fdformat will not stop you unless you include the -v option. With the -v option, fdformat will format the diskette, but the verification will catch the error and notify you with the following message: fdformat: check diskette density, I/O error
The fdformat command displays a confirmation message, indicating the type of formatting to be performed:
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy.
|
-
Select one of the options in the table below.
|
To ...
|
Press ...
|
|
Confirm the type of formatting
|
Return (unless you used the -f option in the previous step, in which case no confirmation is necessary)
|
|
Cancel formatting
|
Control-c
|
As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of V's appears beneath the dots. When the series stops, the formatting is complete and the PCMCIA memory card is ready for use on a DOS system.
-
Use the volrmmount command with the -i option to notify Volume Management that the memory card is inserted.
Volume Management mounts the PCMCIA memory card under /pcmem/pcmem0.
Using PCMCIA Memory Cards Task Map
Table 14-3 Task Map: Using PCMCIA Memory Cards
How to Load a PCMCIA Memory Card
-
Make sure the PCMCIA memory card is formatted.
If you aren't sure, insert it and check the status messages in the Console, as described in "Using PCMCIA Memory Cards Task Map". If you need to format the PCMCIA memory card, go to "How to Format a UFS PCMCIA Memory Card" or "How to Format a DOS PCMCIA Memory Card".
-
Insert the PCMCIA memory card.
Make sure the PCMCIA memory card is completely inserted. It must drop down into the drive. If the drive has a door, close it.
-
Notify Volume Management.
$ volcheck -v
media was found
|
Two status messages are possible:
|
media was found
|
Volume Management detected the PCMCIA memory card and will attempt to mount it in the /pcmem directory.
If the PCMCIA memory card is formatted properly, no error messages appear in the Console.
If the PCMCIA memory card is not formatted, the "media was found" message is still displayed, but the following error messages appear in the Console:
fd0: unformatted diskette or no diskette in the drive
fd0: read failed
(40 1 0)
fd0: bad format
You must format the PCMCIA memory card before Volume Management can mount it. Instructions are provided on "How to Format a UFS PCMCIA Memory Card" (for UFS) and "How to Format a DOS PCMCIA Memory Card" (for DOS).
|
|
no media was found
|
Volume Management did not detect a PCMCIA memory card. Make sure the PCMCIA memory card is inserted properly and run volcheck again. If unsuccessful, check the PCMCIA memory card; it could be damaged. You can also try to mount the PCMCIA memory card manually.
|
-
Verify that the PCMCIA memory card was mounted by listing its contents.
$ ls /pcmem/pcmem0
pcmem0 myfiles
|
As described earlier, pcmem0 is a symbolic link to the actual name of the PCMCIA memory card; in this case, myfiles. If the PCMCIA memory card has no name but is formatted correctly, the system will refer to it as unnamed_floppy.
If nothing appears under the /pcmem directory, the PCMCIA memory card was either not mounted or is not formatted properly. To find out, run the mount command and look for the line that begins with /pcmem (usually at the end of the listing):
/pcmem/name on /vol/dev/diskette0/name ...
|
If the line does not appear, the PCMCIA memory card was not mounted. Check the Console for error messages.
How to Examine the Contents of a PCMCIA Memory Card
Use the ls -L command because some directories under /pcmem are symbolic links:
|
-L
|
Includes symbolic links in the output.
|
|
-l
|
Long format. Includes permissions and owners in the output.
|
Example--Displaying the Contents of a PCMCIA Memory Card
The following example lists the contents of the PCMCIA memory card in the first floppy drive, identified by pcmem0.
$ ls -L -l /pcmem/pcmem0
-rwxrwxrwx 1 smith staff 362284 Nov 16 20:54 text.doc
-rwxrwxrwx 1 smith staff 24562 Nov 16 12:20 art.gif
|
How to Copy or Move Information From a PCMCIA Memory Card
Once you have inserted a PCMCIA memory card, you can access its files and directories just as you would those of any other file system. The only significant restrictions are ownership and permissions. For instance, if you are not the owner of a file on a PCMCIA memory card, you won't be able to overwrite that file on the PCMCIA memory card. Or, if you copy a file into your file system, you'll be the owner, but that file won't have write permissions (because it never had them on the PCMCIA memory card); you'll have to change the permissions yourself.
-
Make sure the PCMCIA memory card is formatted and mounted.
$ ls /pcmem
pcmem0 PCMCIA memorycard-name
|
If the PCMCIA memory card is properly formatted and mounted, its name and the symbolic link will appear under /pcmem.
If nothing appears under the /pcmem directory, the PCMCIA memory card is not mounted. See "". The PCMCIA memory card might also need to be formatted. See "How to Format a UFS PCMCIA Memory Card" or "How to Format a DOS PCMCIA Memory Card".
-
Copy the files or directories.
|
To Copy ...
|
Use ...
|
|
A file
|
cp
|
|
A directory
|
cp -r
|
-
Verify the copy or move operation by using the ls command.
Examples--Copying or Moving Information from a PCMCIA Memory Card
The first example, below, moves a file (readme.doc) from the PCMCIA memory card to the current directory (indicated by the "." symbol). The second example copies a file (readme2.doc) from the PCMCIA memory card to the current directory. The third example copies a directory (morefiles) and everything below it from the PCMCIA memory card to the current directory.
$ mv /pcmem/pcmem0/readme.doc .
$ cp /pcmem/pcmem0/readme2.doc .
$ cp -r /pcmem/pcmem0/morefiles .
|
How to Copy or Move Information to a PCMCIA Memory Card
-
Make sure the PCMCIA memory card is not write-protected.
Write-protection is controlled by a small slide switch in the end of the PCMCIA memory card.
-
Make sure the PCMCIA memory card is formatted and mounted.
$ ls /pcmem
pcmem0 PCMCIA memorycard-name
|
If the PCMCIA memory card is properly formatted and mounted, its name and the symbolic link, pcmem0, will appear under /pcmem.
If nothing appears under the /pcmem directory, the PCMCIA memory card is not mounted. See "". The PCMCIA memory card might also need to be formatted. See "How to Format a UFS PCMCIA Memory Card" or "How to Format a DOS PCMCIA Memory Card".
-
Move or copy the files or directories.
|
To ...
|
Use ...
|
|
Copy a file
|
cp
|
|
Copy a directory
|
cp -r
|
|
Move a file or directory
|
mv
|
-
Verify the move or copy operation by using the ls command.
Examples--Copying or Moving Information to a PCMCIA Memory Card
The first example, below, moves a file (readme.doc) from the current directory to the PCMCIA memory card loaded into the first floppy drive (indicated by /pcmem/pcmem0). The second example copies a file (readme2.doc) from the current directory to the PCMCIA memory card loaded into the second floppy drive (indicated by /pcmem/pcmem1). The third example copies a directory (morefiles) and its contents from the /home/smith/directory to the PCMCIA memory card loaded into the first floppy drive.
$ mv readme.doc /pcmem/pcmem0
$ cp readme2.doc /pcmem/pcmem1
$ cp -r /home/smith/morefiles /pcmem/pcmem0
|
How to Find Out If a PCMCIA Memory Card Is Still In Use
-
Become superuser.
-
Invoke the fuser(1M) command.
The fuser command lists the processes that are currently accessing the CD that you specify.
|
-u
|
Displays the user of the PCMCIA memory card.
|
|
-k
|
Kills the process accessing the PCMCIA memory card.
|
Example--Finding Out If a PCMCIA Memory Card Is Still In Use
In the following example, the processes 6400c and 6399c are accessing the /pcmem/pcmem0 directory, and the process owners are root and smith, respectively.
# fuser -u /pcmem/pcmem0
/pcmem/pcmem0: 6400c(root) 6399c(smith)
|
You can kill the processes individually (as superuser), or you can use the fuser command with the -k option, which kills all the processes accessing that file system:
# fuser -u -k /pcmem/pcmem0
/pcmem/pcmem0: 6400c(root)Killed 6399c(smith)Killed
|
The fuser command may not always identify all the killed processes. To be sure, run it again with the -u option.
How to Eject a PCMCIA Memory Card
-
Make sure the PCMCIA memory card is not being used.
Remember, a PCMCIA memory card is "being used" if a shell or an application is accessing any of its files or directories.
If you are not sure whether you have found all users of a PCMCIA memory card (a renegade shell hidden behind a desktop tool may be accessing it), use the fuser command, as described in "How to Find Out If a PCMCIA Memory Card Is Still In Use".
-
Eject the PCMCIA memory card.
You'll have to eject the PCMCIA memory card by hand. If you are running Windows, look for an onscreen message that says you can now eject the PCMCIA memory card.
If the PCMCIA memory card is still in use, the following message appears:
/vol/dev/pcmem/noname: Device busy
|
In this case, return to Step 1 and make sure no one is using the PCMCIA memory card, then eject it again.
How to Access PCMCIA Memory Cards on Other Systems
You can access a PCMCIA memory card on another system by mounting it manually into your file system--provided the other system has shared its PCMCIA memory card drive according to the instructions in "How to Make Local PCMCIA Memory Cards Available to Other Systems".
-
Select an existing directory to serve as the mount point or create one.
|
directory
|
The name of the directory that you create to serve as a mount point for the other system's PCMCIA memory card.
|
-
Find the name of the PCMCIA memory card you want to mount.
When you manually mount a remote PCMCIA memory card, you cannot use the pcmem0 or floppy1 variables available with your local PCMCIA memory cards. You must use the exact PCMCIA memory card name. To find it, use the ls command on the remote system's /pcmem directory. If the automounter is running, you can simply cd to the system whose PCMCIA memory card you want to mount and then use the ls command. If the automounter is not running, you'll have to use another method, such as logging in remotely.
-
As superuser, mount the PCMCIA memory card.
# mount -F nfs -o rw system-name:/pcmem/PCMCIA memory-card-name
local-mount-point
|
|
system-name
|
The name of the system whose PCMCIA memory card you will mount.
|
|
PCMCIA memory-card-name
|
The name of the PCMCIA memory card you want to mount.
|
|
local-mount-point
|
The local directory onto which you will mount the remote PCMCIA memory card.
|
-
Log out as superuser.
-
Verify that the PCMCIA memory card is indeed mounted by using the ls command to list the contents of the mount point.
Example--Accessing PCMCIA Memory Cards on Other Systems
This example mounts the PCMCIA memory card named myfiles from the remote system mars onto the /pcmem directory of the local system.
$ cd /net/mars
$ ls /pcmem
pcmem0 myfiles
$ su
Password: password
# mount -F nfs rw mars:/pcmem/myfiles /pcmem
# exit
$ ls /pcmem
myfiles
|
How to Make Local PCMCIA Memory Cards Available to Other Systems
You can configure your system to share its PCMCIA memory cards; in other words, you can make any PCMCIA memory cards in those drives available to other systems. Once your PCMCIA memory card drives are shared, other systems can access the PCMCIA memory cards they contain simply by mounting them, as described in "How to Access PCMCIA Memory Cards on Other Systems".
-
Become superuser.
-
Find out whether the NFS daemon (nfsd) is running.
# ps -ef | grep nfsd
root 14533 1 17 10:46:55 ? 0:00 /usr/lib/nfs/nfsd -a 16
root 14656 289 7 14:06:02 pts/3 0:00 grep nfsd
|
If the daemon is running, a line for /usr/lib/nfs/nfsd will appear, as shown above. If the daemon is not running, only the grep nfsd line will appear.
-
Select an option from the following table.
|
If ...
|
Then ...
|
|
nfsd is running
|
Go to Step 8
|
|
nfsd is not running
|
Continue with Step 4
|
-
Create a dummy directory for nfsd to share.
|
dummy-dir
|
Can be any directory name; for example, dummy. This directory will not contain any files. Its only purpose is to "wake up" the NFS daemon so that it notices your shared PCMCIA memory cards.
|
-
Add the following entry into the /etc/dfs/dfstab file.
share -F nfs -o ro [-d comment] /dummy-dir
|
When you start the NFS daemon, it will see this entry, "wake up," and notice the shared PCMCIA memory card drive. Note that the comment (preceded by -d) is optional.
-
Start the NFS daemon.
# /etc/init.d/nfs.server start
|
-
Verify that the NFS daemon is indeed running.
# ps -ef | grep nfsd
root 14533 1 17 10:46:55 ? 0:00 /usr/lib/nfs/nfsd -a 16
root 14656 289 7 14:06:02 pts/3 0:00 grep nfsd
|
-
Eject any PCMCIA memory card currently in the drive.
-
Assign write permissions to /etc/rmmount.conf.
# chmod 644 /etc/rmmount.conf
|
-
Add the following lines to /etc/rmmount.conf.
# File System Sharing
share floppy*
|
These lines share any PCMCIA memory card loaded into your system's PCMCIA memory card drives.
-
Remove write permissions from /etc/rmmount.conf.
# chmod 444 /etc/rmmount.conf
|
This step returns the file to its default permissions.
-
Load a PCMCIA memory card.
--Insert the PCMCIA memory card--
# volcheck -v
media was found
|
The PCMCIA memory card you now load, and all subsequent PCMCIA memory cards, will be available to other systems. To access the PCMCIA memory card, the remote user must mount it by name, according to the instructions in "How to Access PCMCIA Memory Cards on Other Systems".
-
Verify that the PCMCIA memory card is indeed available to other systems by using the share command.
If the PCMCIA memory card is available, its share configuration will be displayed. (The shared dummy directory will also be displayed.)
# share
- /dummy ro "dummy dir to wake up NFS daemon"
- /myfiles rw ""
|
Example--Making Local PCMCIA Memory Cards Available to Other Systems
The following example makes any PCMCIA memory card loaded into the local system's PCMCIA memory card drive available to other systems on the network.
# ps -ef | grep nfsd
root 10127 9986 0 08:25:01 pts/2 0:00 grep nfsd
root 10118 1 0 08:24:39 ? 0:00 /usr/lib/nfs/nfsd -a
# mkdir /dummy
# vi /etc/dfs/dfstab
(Add the following line:)
share -F nfs -o ro /dummy
# eject pcmem0
# chmod 644 /etc/rmmount.conf
# vi /etc/rmmount
(Add the following line to the File System Sharing section.)
share floppy*
# chmod 444 /etc/rmmount.conf
(Load a PCMCIA memory card.)
# volcheck -v
media was found
# share
- /dummy ro ""
- /pcmem/myfiles rw ""
|
Chapter 15 How Volume Management Works (Reference)
This chapter describes the mount points and symbolic links that Volume Management creates to accommodate removable media.
This is a list of reference information in this chapter.
Volume Management Mounts All Removable Media
Volume Management provides access to all CD-ROM and diskette drives under /vol/dev:
Volume Management Provides Access to Diskettes
Volume Management provides access to a system's diskette drive through subdirectories of /vol/dev; namely, diskette0 and rdiskette0.

If a system has a second diskette drive, Volume Management creates a second pair of directories named diskette1 and rdiskette1. For a third diskette drive, it would create diskette2 and rdiskette2. And so on for additional drives.
The diskette directories provide access to file systems, and the rdiskette directories provide access to raw characters. The diskettes themselves appear in subdirectories beneath the drive directories [In this and subsequent illustrations, some nodes are "grayed out" to draw attention to the other nodes. There is no structural significance to this convention; it is simply a means of highlighting.] :
Volume Management Provides Access to CDs
The arrangement for CDs is similar, except that the block and raw directories are labelled /dsk and /rdsk, respectively, and the CD-ROM device is actually located one directory beneath them.

In the illustration above, the additional directory is named c0t6. That simply reflects a particular system's device naming conventions. The directory name on your system could be different, though it would have the same format.
The CDs themselves, however, follow a convention similar to diskettes, in that they are mounted beneath the directory belonging to their device:

As a result of this arrangement, a system with one diskette drive and one CD-ROM drive would have the following /vol/dev file system:

(Actually, /vol/dev includes an additional subdirectory named aliases, but that is described later in this section.)
Volume Management Supplies Convenient Mount Points for Easier Access
To make access more convenient, Volume Management uses two special mount points, /floppy and /cdrom.

Volume Management mounts the /vol/dev/diskette0 and /vol/dev/dsk/c0t6 directories onto /floppy and /cdrom:

Because of these mount points, when you insert a diskette, you can access it under /floppy/diskette-name. Likewise, when you insert a CD, you can access it under /cdrom/cd-name.

However, these mount points depend on proper formatting. If a diskette is formatted, the mount succeeds, but if it is unformatted, the mount fails and the diskette is only available under /vol/dev/diskette0. You can format diskettes according to the instructions in "How to Format a UFS Diskette" or "How to Format a DOS Diskette".
If a system has multiple drives, they are mounted onto parallel directories such as /floppy/floppy0, /floppy/floppy1, /cdrom/cdrom0, etc.
Volume Management Creates Two Sets of Symbolic Links
As an additional convenience, Volume Management creates two separate sets of symbolic links:
Symbolic Links for File System Access
The symbolic links for file system access simply link the directories /floppy/floppy0 and /cdrom/cdrom0 to the diskette inserted into the first diskette drive and the CD inserted into the first CD-ROM drive:
/floppy/floppy0 --> /floppy/name --> /vol/dev/diskette0/name
/cdrom/cdrom0 --> /cdrom/cd-name --> /vol/dev/dsk/c0t6d0/cd-name
These links enable you to access floppies and CDs without knowing their names. You can use the link names, floppy0 or cdrom0, instead.
Diskettes and CDs inserted into subsequent drives would follow the naming conventions summarized in Table 11-3.
Symbolic Links for Raw Device Access
To make raw device access more convenient, Volume Management creates the aliases directory, under /vol/dev:

Beneath the aliases directory, Volume Management creates a set of symbolic links similar to those used for block access. In other words, for character access, these directories are equivalent:
/vol/dev/aliases/floppy0 --> /vol/dev/rdiskette0/diskette-name
/vol/dev/aliases/cdrom0 --> /vol/dev/rdsk/c0t6d0/cd-name
Like the symbolic links for file system access, the purpose of these links is to enable you to access a raw-character diskette or CD without knowing its name; in other words, by using the /vol/dev/aliases/floppy0 and /vol/dev/aliases/cdrom0 link names.
The example above shows only one symbolic link for diskettes and one for CDs. If your system had two diskettes or two CDs, there would be one symbolic link for each:
Volume Management Can Be Limited by UFS Formats
UFS formats are not portable between architectures, so they must be used on the architecture for which they were formatted. For instance, a UFS CD formatted for a SPARC platform cannot be recognized by an x86 platform. Likewise, an x86 UFS CD cannot be mounted by Volume Management on a SPARC platform. The same limitation applies to diskettes. (Actually, some architectures share the same bit structure, so occasionally a UFS format specific to one architecture will be recognized by another architecture, but the UFS file system structure was not designed to guarantee this compatibility).
Therefore, Volume Management cannot recognize and mount x86 UFS media on a SPARC platform--or SPARC UFS media on an x86 platform.
Most CDs are formatted according to the ISO 9660 standard (High Sierra File System--HSFS), which imposes no limitations on Volume Management, so incompatibility is seldom a problem with CDs.
With diskettes, UFS incompatibility can occur more often because formats can be established by the user. Be aware that if you format a UFS diskette on one architecture, you won't be able to use it on a different architecture. (For instructions, see "How to Format a UFS Diskette").
What About Mixed Formats?
Some CDs, particularly installation CDs, contain mixed formats; that is, part UFS, part ISO 9660. To accommodate the different formats, the CD is split into slices, which are similar in effect to partitions on hard disks. The 9660 portion is portable, but the UFS portion is architecture-specific. Furthermore, to make the CD usable by several different architectures (as in the case of installation, when different PROM architectures might be used to boot the system), more than one UFS format is loaded onto the CD:

When Volume Management encounters this arrangement, it simply ignores the UFS formats not specific to the local system's architecture and mounts the appropriate UFS slice and the ISO 9660 slice:

These slices appear as subdirectories both under /vol/dev/dsk/c0t6 and /cdrom/cdrom0:
$ ls /cdrom/cdrom0
S0 S2
$ ls /vol/dev/dsk/c0t6
S0 S2
|