|
|
|
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 IA 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 IA platform can only be used on an IA platform.
1. Format the diskette for a UFS file system.
Use “How to Format a UFS Diskette” on page 197.
2. Create a SunOS file system on the diskette.
$ /usr/sbin/newfs -v /vol/dev/aliases/floppy0
Prints status messages.
−v
/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.
3. 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.
4. Invoke the volrmmount command using the −i option to notify Volume
Management that the diskette is inserted.
$ volrmmount -i floppy0
5. Verify that the UFS file system is on the diskette by using the ls command on
the /floppy directory.
200
If the floppy0 subdirectory appears, the diskette has a UFS file system and has
been mounted properly.
$ ls /floppy
floppy0
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 IA 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 diskette.
Caution - Formatting a diskette erases any pre-existing content.
1. Quit File Manager.
File Manager automatically displays a formatting window when you insert an
unformatted diskette. To avoid the window, quit from File Manager. If you prefer
to keep File Manager open, quit the formatting window when it appears.
2. 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
Formatting and Using Diskettes From the Command Line (Tasks)
201
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.)
3.
Insert the diskette.
Make sure the diskette is completely inserted. It must drop down into the drive.
4.
Invoke formatting.
$ fdformat -v -U [density-options convenience-options]
Verifies whether the diskette was formatted correctly.
−v
Unmounts the diskette if it is mounted.
−U
If the drive density is 1.44 Mbytes, density-options are:
density-options
Formats at 1.44 Mbytes for MS-DOS.
−d
Formats at 720 Kbytes for MS-DOS.
−d −D
Formats at 1.2 Mbytes for NEC-DOS.
−t nec −M
Lists all the options to the fdformat command, but
does not format the diskette.
convenience-options
Ejects the diskette when done formatting.
−e
Does not ask for confirmation before formatting.
−f
Name for the diskette. label must be eight characters or
−b label
less, upper or lower case.
Lists all the options to the fdformat command, but
−z
does not format the diskette.
202
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.
5. 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 Vs appears beneath the dots. When the series stops, the
formatting is complete and the diskette is ready for use on a DOS system.
6. Run the volrmmount(1) command using the −i option to notify Volume
Management that the diskette is inserted.
$ volrmmount -i floppy0
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:
Formatting and Using Diskettes From the Command Line (Tasks)
203
$ 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 16-4
Using Diskettes Task Map
Task
Description
For Instructions, Go To
1. Load the Diskette
Insert the diskette into its drive and enter the
“How to Load a Diskette” on
volcheck command.
page 205
2. Examine its Contents
Optional. To examine the contents of the
“How to Examine the Contents
diskette, look in the appropriate directory
of a Diskette” on page 207
under /diskette.
3. Exchange Files
Optional. Copy files or directories between
“How to Copy or Move
the diskette and your file system.
Information From a Diskette”
on page 207
“How to Copy or Move
Information to a Diskette” on
page 208
4. Is Diskette Still in Use?
Optional. Before ejecting the diskette, find out
“How to Find Out If a Diskette
if the diskette is still in use.
Is Still in Use” on page 209
5. Eject the Diskette
When you finish, eject the diskette from its
“How to Eject a Diskette” on
drive.
page 210
204
How to Load a Diskette
1. 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 on page 205. If you need to format the diskette, go to “How
to Format a UFS Diskette” on page 197 or “How to Format a DOS Diskette” on
page 201.
2. 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.
3. Notify Volume Management.
$ volcheck -v
media was found
Two status messages are possible:
Formatting and Using Diskettes From the Command Line (Tasks)
205
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” on page 197 (for
UFS) and “How to Format a DOS Diskette” on page
201
(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.
4. 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.
206
How to Examine the Contents of a Diskette
Use the ls -L command because some directories under /floppy are symbolic
links.
$ ls -L [-l] floppy0
Includes symbolic links in the output.
−L
Long format. Includes permissions and owners in the output.
−l
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.
1. 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” on page 205. The diskette might also need to be
Formatting and Using Diskettes From the Command Line (Tasks)
207
formatted. See “How to Format a UFS Diskette” on page 197 or “How to Format
a DOS Diskette” on page 201.
2. Copy the files or directories.
To Copy ...
Use ...
A file
cp
A directory
cp -r
3. 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
1. 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.
2. Make sure the diskette is formatted and mounted.
208
$ 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” on page 205. The diskette might also need to be
formatted. See “How to Format a UFS Diskette” on page 197 or “How to Format
a DOS Diskette” on page 201.
3. Move or copy the files or directories.
To ...
Use ...
Copy a file
cp
Copy a directory
cp -r
Move a file or directory
mv
4. 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
1. Become superuser.
Formatting and Using Diskettes From the Command Line (Tasks)
209
2. Invoke the fuser command.
The fuser command lists the processes that are currently accessing the CD that
you specify.
# fuser -u [-k] floppy0
Displays the user of the diskette.
−u
Kills the process accessing the diskette.
−k
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 might 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
1. 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 might be accessing it), use the fuser
command, as described in “How to Find Out If a Diskette Is Still in Use” on page
209.
2. Eject the diskette.
210
# eject floppy0
On a SPARC based system the floppy is physically ejected from its drive, but on
an IA based system, 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” on page
212.
1. Select an existing directory to serve as the mount point, or create one.
$ mkdir directory
Is the name of the directory that you create to serve as
directory
a mount point for the other system’s diskette.
2. 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.
3. As superuser, mount the diskette.
# mount -F nfs system-name:/floppy/diskette-name local-mount-point
Formatting and Using Diskettes From the Command Line (Tasks)
211
system-name
The name of the system whose diskette you will mount.
The name of the diskette you want to mount.
diskette-name
local-mount-point
The local directory onto which you will mount the
remote diskette.
4. Log out as superuser.
5. Verify that the diskette is mounted by using the ls command to list the
contents of the mount point.
$ ls /floppy
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 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” on page 211.
1. Become superuser.
2. Find out whether the NFS daemon (nfsd) is running.
212
# 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.
3. Select an option from the following table.
If ...
Then ...
nfsd is running
Go to Step 8 on page 214
nfsd is not running
Continue with Step 4 on page 213
4. Create a dummy directory for nfsd to share.
# mkdir /dummy-dir
Can be any directory name; for example, dummy. This
dummy-dir
directory will not contain any files. Its only purpose is
to “wake up” the NFS daemon so that it notices your
shared diskettes.
5. 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.
6. Start the NFS daemon.
# /etc/init.d/nfs.server start
7. Verify that the NFS daemon is indeed running.
Formatting and Using Diskettes From the Command Line (Tasks)
213
# 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
8. Eject any diskette currently in the drive.
# eject floppy0
9. Assign root write permissions to /etc/rmmount.conf.
# chmod 644 /etc/rmmount.conf
10. 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.
11. Remove write permissions from /etc/rmmount.conf.
# chmod 444 /etc/rmmount.conf
This step returns the file to its default permissions.
12. 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” on page 211.
13. Verify that the diskette is available to other systems by using the share(1M)
command.
214
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
""
Formatting and Using Diskettes From the Command Line (Tasks)
215
216
CHAPTER
17
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.
“How to Format a UFS PCMCIA Memory Card” on page 219
“How to Place a UFS File System on a PCMCIA Memory Card” on page 222
“How to Format a DOS PCMCIA Memory Card” on page 224
“How to Load a PCMCIA Memory Card” on page 227
“How to Examine the Contents of a PCMCIA Memory Card” on page 229
“How to Copy or Move Information From a PCMCIA Memory Card” on page 229
“How to Copy or Move Information to a PCMCIA Memory Card” on page 230
“How to Find Out If a PCMCIA Memory Card Is Still In Use” on page 232
“How to Eject a PCMCIA Memory Card” on page 232
“How to Access PCMCIA Memory Cards on Other Systems” on page 233
“How to Make Local PCMCIA Memory Cards Available to Other Systems” on
page 235
Formatting PCMCIA Memory Cards
Task Map
217
TABLE 17-1
Formatting PCMCIA Memory Cards Task Map
Task
Description
For Instructions, Go To ...
1. Load Unformatted
Insert the PCMCIA memory card into the
“How to Load a PCMCIA
PCMCIA Memory Card
drive and enter the volcheck command.
Memory Card” on page 227
2. Format the PCMCIA
Format the PCMCIA memory card for UFS.
“How to Format a UFS
Memory Card
PCMCIA Memory Card” on
page 219
Format the PCMCIA memory card for DOS.
“How to Format a DOS
PCMCIA Memory Card” on
page 224
3. Add a UFS File System
UFS Only. Optional. To use the PCMCIA
“How to Place a UFS File
memory card for files, add a UFS file system.
System on a PCMCIA Memory
To use for characters, skip this step.
Card” on page 222
4. Eject the PCMCIA
When finished formatting, always eject the
“How to Eject a PCMCIA
Memory Card
PCMCIA memory card, even if you are going
Memory Card” on page 232
to use it again right away.
Using PCMCIA Memory Cards Names
When working with PCMCIA memory cards, you can identify them by name or with
a designator from the table below. For brevity, task descriptions use pcmem0, but you
can replace this with either the PCMCIA memory card’s name or a different
designator.
TABLE 17-2
How to Identify PCMCIA Memory Cards
PCMCIA Card
Alternate Name
First PCMCIA drive
pcmem0
Second PCMCIA drive
pcmem1
Third PCMCIA drive
pcmem2
218
TABLE 17-2
How to Identify PCMCIA Memory Cards
(continued)
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 ...
SPARC based systems
UFS
MS-DOS or NEC-DOS (PCFS)
IA based systems
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 IA platform. Likewise,
PCMCIA memory cards formatted on an IA platform cannot be used on a SPARC
platform. This is because the SPARC and IA 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” on page 217.
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 based platform can be used only on another SPARC based platform, and a
Using PCMCIA Memory Cards From the Command Line (Tasks)
219
UFS PCMCIA memory card formatted on an IA platform can be used only on an IA
platform running the Solaris Intel Platform Edition.
Caution - Formatting a PCMCIA memory card erases any pre-existing content.
1.
Quit File Manager.
File Manager automatically displays a formatting window when you insert an
unformatted PCMCIA memory card. To avoid the window, quit File Manager. If
you prefer to keep File Manager open, quit the formatting window when it
appears.
2.
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.
3.
Insert the PCMCIA memory card.
Make sure the PCMCIA memory card is completely inserted.
4.
Invoke formatting.
$ fdformat -v -U [convenience-options]
Verifies whether the PCMCIA memory card was
−v
formatted correctly.
Unmounts the PCMCIA memory card if it is mounted.
−U
convenience-options
Ejects the PCMCIA memory card when done
−e
formatting.
Forces formatting without asking for confirmation.
−f
Names the PCMCIA memory card. label must be eight
−b label
characters or less, upper or lower case.
Lists all the options to the fdformat command, but
−z
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:
220
Formatting in /vol/dev/aliases/pcmem0
Press return to start formatting pcmem0.
5. 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 Vs 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
Using PCMCIA Memory Cards From the Command Line (Tasks)
221
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 IA platforms and SPARC based platforms, a
UFS PCMCIA memory card formatted on a SPARC based platform can only be used
on another SPARC based platform, and a UFS PCMCIA memory card formatted on
an IA platform can only be used on a IA platform.
1. Format the PCMCIA memory card for a UFS file system.
Use the procedure “How to Format a UFS PCMCIA Memory Card” on page 219.
2. 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
Prints status messages.
−v
/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.
3. 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:
(continued)
222
(Continuation)
32, 304, 544, 816, 1056, 1328, 1568, 1840
The PCMCIA memory card is now ready to be used on a SPARC based platform.
However, before Volume Management recognizes the memory card, you must use
the volrmmount(1) command as described in the following step.
4. Use the volrmmount command with the −i option to notify Volume
Management that the memory card is inserted.
$ volrmmount -i pcmem0
The PCMCIA memory card should now be mounted under /pcmem/pcmem0.
5. 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.
$ ls /pcmem
pcmem0
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
Using PCMCIA Memory Cards From the Command Line (Tasks)
223
How to Format a DOS PCMCIA Memory Card
You can format a DOS PCMCIA memory card on a SPARC or IA based 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.
1.
Quit File Manager.
File Manager automatically displays a formatting window when you insert an
unformatted PCMCIA memory card. To avoid the window, quit File Manager. If
you prefer to keep File Manager open, quit the formatting window when it
appears.
2.
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.
3.
Insert the PCMCIA memory card.
Make sure the PCMCIA memory card is completely inserted. It must drop down
into the drive.
4.
Invoke formatting.
$ fdformat -v -U [density-options convenience-options]
Verifies whether the PCMCIA memory card was
−v
formatted correctly.
Unmounts the PCMCIA memory card, if it is mounted.
−U
If the drive density is 1.44 Mbytes, density-options are:
density-options
Formats for MS-DOS.
−d
Formats at 1.2 Mbytes for NEC-DOS.
−t nec −M
Lists all the options to the fdformat command, but
does not format the PCMCIA memory card.
convenience-options
224
Ejects the PCMCIA memory card when done
−e
formatting.
Does not ask for confirmation before formatting.
−f
Name for the PCMCIA memory card. label must be
−b label
eight characters or less, upper or lower case.
Lists all the options to the fdformat command, but
−z
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.
5. 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 Vs 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.
Using PCMCIA Memory Cards From the Command Line (Tasks)
225
6. Use the volrmmount command with the −i option to notify Volume
Management that the memory card is inserted.
$ volrmmount -i pcmem0
Volume Management mounts the PCMCIA memory card under /pcmem/pcmem0.
Using PCMCIA Memory Cards Task
Map
TABLE 17-3
Using PCMCIA Memory Cards Task Map
Task
Description
For Instructions, Go To
1. Load the PCMCIA
Insert the PCMCIA memory card into its
“How to Load a PCMCIA
Memory Card
drive and enter the volcheck command.
Memory Card” on page 227
2. Examine the Contents of a
Optional. To examine the contents of the
“How to Examine the Contents
PCMCIA Memory Card
PCMCIA memory card, look in the
of a PCMCIA Memory Card”
appropriate directory under /
on page 229
PCMCIAmemorycard.
3. Exchange Files
Optional. Copy files or directories between the
“How to Copy or Move
PCMCIA memory card and your file system.
Information From a PCMCIA
Memory Card” on page 229
“How to Copy or Move
Information to a PCMCIA
Memory Card” on page 230
226
TABLE 17-3
Using PCMCIA Memory Cards Task Map
(continued)
Task
Description
For Instructions, Go To
4. Is PCMCIA Memory Card
Optional. Before ejecting the PCMCIA
“How to Find Out If a
Still in Use?
memory card, find out if the PCMCIA
PCMCIA Memory Card Is Still
memory card is still in use.
In Use” on page 232
5. Eject the PCMCIA
When you finish, eject the PCMCIA memory
“How to Eject a PCMCIA
Memory Card
card.
Memory Card” on page 232
How to Load a PCMCIA Memory Card
1. 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” on page 226. If you need
to format the PCMCIA memory card, go to “How to Format a UFS PCMCIA
Memory Card” on page 219 or “How to Format a DOS PCMCIA Memory Card”
on page 224.
2. 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.
3. Notify Volume Management.
$ volcheck -v
media was found
Two status messages are possible:
Using PCMCIA Memory Cards From the Command Line (Tasks)
227
media was
Volume Management detected the PCMCIA memory card and will
found
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” on page 219 (for UFS) and
“How to Format a DOS PCMCIA Memory Card” on page 224 (for
DOS).
no media was
Volume Management did not detect a PCMCIA memory card.
found
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.
4. 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.
228
How to Examine the Contents of a PCMCIA
Memory Card
Use the ls -L command because some directories under /pcmem are symbolic links:
$ ls -L [-l] pcmem0
Includes symbolic links in the output.
−L
Long format. Includes permissions and owners in the output.
−l
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.
1. Make sure the PCMCIA memory card is formatted and mounted.
$ ls /pcmem
pcmem0
PCMCIAmemorycard-name
Using PCMCIA Memory Cards From the Command Line (Tasks)
229
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 “How to Load a PCMCIA Memory Card” on page 227. The
PCMCIA memory card might also need to be formatted. See “How to Format a
UFS PCMCIA Memory Card” on page 219 or “How to Format a DOS PCMCIA
Memory Card” on page 224.
2. Copy the files or directories.
To Copy ...
Use ...
A file
cp
A directory
cp -r
3. 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
1. 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.
2. Make sure the PCMCIA memory card is formatted and mounted.
230
$ ls /pcmem
pcmem0
PCMCIAmemory-card-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 “How to Load a PCMCIA Memory Card” on page 227. The
PCMCIA memory card might also need to be formatted. See “How to Format a
UFS PCMCIA Memory Card” on page 219 or “How to Format a DOS PCMCIA
Memory Card” on page 224.
3. Move or copy the files or directories.
To ...
Use ...
Copy a file
cp
Copy a directory
cp -r
Move a file or directory
mv
4. 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
Using PCMCIA Memory Cards From the Command Line (Tasks)
231
How to Find Out If a PCMCIA Memory Card Is
Still In Use
1. Become superuser.
2. Invoke the fuser(1M) command.
The fuser command lists the processes that are currently accessing the CD that
you specify.
# fuser -u [-k] pcmem0
Displays the user of the PCMCIA memory card.
−u
Kills the process accessing the PCMCIA memory card.
−k
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 might not always identify all the killed processes. To be sure,
run it again with the −u option.
How to Eject a PCMCIA Memory Card
1. 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.
232
|
|