Solaris Advanced User's Guide
  Search only this book
Download this book in PDF

Using PCMCIA Cards

G

Introduction

Personal Computer Memory Card International Association (PCMCIA) cards are rugged, credit card-sized, user-installable devices.
You can use PCMCIA memory cards in the same way as a diskette, but you can store much larger amounts of data on a PCMCIA memory card.
PCMCIA serial and modem cards provide a convienient way to add an RS-232 interface or data/fax modem functionality to your workstation.
PCMCIA cards are available from many vendors. Check with your SunServiceSM provider or the PCMCIA card vendor to determine if a device is compatible with your workstation.
This appendix contains the following sections:

Support Requirements

PCMCIA memory and PCMCIA serial/modem cards must be compliant with PCMCIA release 2.1 or higher.
This Solaris release supports SRAM (Non-Volatile Static Random Acess Memory), DRAM (Dynamic Random Access Memory, and MROM (Memory Read-Only Memory) PCMCIA memory cards.

Note - This release does not support PCMCIA FLASH, EEPROM, and OTP (One-Time Programmable) PROM cards.

Specifically, this software release supports PCMCIA memory cards that have:
  • Card Information Structure (CIS)
  • Densities ranging from 512 Kbytes to 64 Mbytes
  • (R) · An MS-DOS file system and a UNIX file system

Other Information Sources

Refer to the Hardware Platform Guide and other documents that accompanied the Solaris software for your system to determine if there are any special installation instructions for the PCMCIA device you want to use.

Using a PCMCIA Memory Card

This section describes general use of PCMCIA Memory Cards, such as protecting any data on them from being accidentally deleted by enabling the write-protect mode, as described in the section titled "Enabling Write-Protect Mode" on page 226.

File Copying Methods

The three sections that follow describe how to format and copy files from a PCMCIA memory card to a hard disk or from a hard disk to a PCMCIA memory card by the three available methods:

Write-Protect Mode

You can protect data on a PCMCIA memory card from being accidentally deleted by enabling the write-protect mode. As soon as you enable the write-protect mode on a PCMCIA memory card, you are no longer able to copy any data until you disable the write-protect mode.
· Enabling Write-Protect Mode
* Using a fine-tipped tool (such as a screwdriver), slide the write-protect switch toward the edge of the PCMCIA memory card, as shown in Figure G-1 to enable the write-protect mode.

Graphic

· Disabling Write-Protect Mode
* Using a fine-tipped tool (such as a screwdriver), slide the write-protect switch away from the edge of the PCMCIA memory card, to disable the write-protect mode.

PCMCIA Memory Cards and Power Management's Resume/Suspend Feature

This section provides additional information for systems that have PCMCIA cards and the Power Management software installed. For more information on Power Management, refer to the Using Power Management.

CAUTION Caution - Do not insert or remove a PCMCIA card while your system is suspending or resuming. The PCMCIA card will not be recognized after the resume operation.

If a PCMCIA memory card is managed by Volume Management and the system is suspended, the PCMCIA memory card is automatically unmounted. When the system is resumed, any PCMCIA memory card with a valid file system that is managed by Volume Management is automatically remounted.
If Volume Management is disabled and a PCMCIA card is manually mounted when the system is suspended, the PCMCIA memory card is automatically unmounted. When the system resumes, the PCMCIA memory card is not automatically remounted. If you want to have the PCMCIA memory card mounted again, you must manually remount.

Copying Files with the tar Command

This is the first of three sections that describe how to format and copy files from a PCMCIA memory card to a hard disk or from a hard disk to a PCMCIA memory card.

Note - See the man pages for further information on how to use the cpio or the dump/restore commands.

This section describes the following tasks:
  • Formatting a PCMCIA Memory Card
  • Displaying file names
  • Copying files

· Formatting a PCMCIA Memory Card

Before you can use a PCMCIA memory card, you may need to format it. The fdformat utility allows you to format both diskettes and PCMCIA memory cards.

CAUTION Caution - Formatting deletes any data that may already be resident on a PCMCIA memory card.

To format a PCMCIA memory card:
* Type:

  % fdformat option device_name  


Note - The format utility cannot be used with PCMCIA memory cards. Only the fdformat utility will work.

Table G-1 lists the available options for the fdformat utility.
Table G-1 fdformat
OptionDescription
-UUnmounts the PCMCIA memory card
-dInstalls an MS-DOS file system (UNIX file system is the default)
-fDoes not display confirmation messages before starting to format
-qDisables print status messages
-xInstalls a Solaris label or an MS-DOS file system; it does not format the PCMCIA memory card
-b labelSpecifies a UNIX or MS-DOS label on a PCMCIA memory card
-t dosInstalls an MS-DOS file system (UNIX file system is the default)
-B filenameInstalls a special boot loader

Note - There is no option in the fdformat utility for installing a NEC-DOS file system on a PCMCIA memory card.

If you want to format a PCMCIA memory card, you must specify a device name for the PCMCIA memory card. Otherwise, the fdformat utility automatically specifies the diskette drive as the default device.
The format for a device name of a PCMCIA memory card is
/dev/rdsk/cntndnsn

or
/dev/dsk/cntndnsn.

For example, the device name /dev/dsk/c1t6d0s2 represents a PCMCIA SRAM memory card with a logical socket controller number 1, a technology number 6, and a slice number 2
Table G-2 list the available device name options for the fdformat utility.
Table G-2 fdformat
Device Name OptionDescription
nRepresents a decimal number
cnRepresents controller n
tnRepresents technology region n

0x1 ROM, 0x2 OTPROM, 0x3 EPROM, 0x4 EEPROM, 0x5 FLASH, 0x6 SRAM, 0x7 DRAM

dnRepresents technology region in type n
snRepresents slice n

(This release supports only one partition on the PCMCIA memory card. Therefore, the partition number sn for the device name must be s2.)

· Displaying File Names with the tar Command

You may want to display the file names that are resident on a PCMCIA memory card.
* Type:

  % tar tvf device_name  

Table G-3 tar
OptionDescription
tlists or displays files that are resident on the PCMCIA memory card
vspecifies a verbose listing
fspecifies an input device name

Copying Files

To copy a file or directory from a PCMCIA memory card to a hard disk or from a hard disk to a PCMCIA memory card, you must have already formatted the PCMCIA memory card (see "Formatting a PCMCIA Memory Card" on page 227). In addition, you must have write permission for the destination directory on the hard disk.
If you use the following procedure to copy a file or directory, you preserve the owner, permissions, group, and modification time of the file or directory.

Note - If you use the tar command to copy files to a PCMCIA memory card, you must use the tar command to extract or copy files from the PCMCIA memory card.

· Copying Files from a Hard Disk to a PCMCIA Memory Card
  1. Type:


  % cd directory  

where directory is the name of the directory in which the files that you want to copy are located.
For example, to copy the file /home/samples/design, type:

  % cd /home/samples  

  1. Type:


  % tar cvf device_name filename  

Table G-4 tar
OptionDescription
ccreates a backup archive
vdisplays a verbose listing
fspecifies an input device name
For example, to copy the file ./design located on your hard disk to a PCMCIA memory card that has the device name /dev/rdsk/c1t6d0s2, type:

  % tar cvf /dev/rdsk/c1t6d0s2 ./design  

· Copying Files from a PCMCIA Memory Card to a Hard Disk
  1. Type:


  % cd directory  

where directory is the name of the directory in which the files that you want to copy are located. In this case, the directory is located on the PCMCIA memory card.
For example, to copy the file /home/samples/design, type:

  % cd /home/samples  

  1. Type:


  % tar xvfp device_name filename  

Table G-5 tar
OptionDescription
xextracts a backup archive
vdisplays a verbose listing
fspecifies an input device name
ppreserves the original modes of the file

CAUTION Caution - If a file or directory with the same name as the one being copied already exists in the working directory, it is automatically overwritten.

For example, to copy the file ./design from a PCMCIA memory card with an address /dev/rdsk/c1t6d0s2 to the working directory on your hard disk, type:

  % tar xvfp /dev/rdsk/c1t6d0s2 ./design  

Copying Files with Volume Management Enabled

This is the second of three sections that describe different methods for formatting a PCMCIA memory card and to copy files between it and a hard disk. This section describes the way to do such tasks when Volume Management is enabled on your system.

Note - The PCMCIA memory card is automatically managed by Volume Management. You do not have to become superuser to copy files from your system to the PCMCIA memory card.


CAUTION Caution - After just having removed a PCMCIA memory card from a socket, you should wait for a minimum of two to three seconds before attempting to insert it into another socket. Otherwise, Volume Management may not be able to mount the PCMCIA memory card properly. Should Volume Management be unable to mount the PCMCIA memory card properly, restart the vold daemon or reboot your system, if necessary.
Also, if you insert a PCMCIA memory card into a socket and then immediately remove it, Volume Management might no longer recognize that socket. You can solve this problem in the same way--restart the vold daemon or reboot your system, if necessary.
Familiarize yourself with the following:
  • The Volume Manager supports only one PCMCIA memory card.
  • The volcheck(1) command supports PCMCIA memory cards.
  • The PCMCIA hardware uses a manual mechanism. The eject(1) command allows you to manually eject PCMCIA memory cards so that the Volume Manager can unmount the file system.
  • filemgr(1) does not provide a File Manager pop-up menu when a PCMCIA memory card is inserted. However, the File Manager can display names of directories and manipulate files in the /pcmem/pcmemn directory (where n represents the PCMCIA socket number).
This section describes the following tasks:
  • Formatting an unlabeled PCMCIA memory card
  • Reformatting a PCMCIA memory card
  • Mounting a PCMCIA memory card
  • Copying files
  • Ejecting a PCMCIA memory card

· Formatting an Unlabeled PCMCIA Memory Card


Note - The format utility cannot be used with PCMCIA memory cards. Only the fdformat utility will work.

  1. Insert the PCMCIA memory card into a PCMCIA socket.

  2. Enter a command to format the memory card with the desired file system (UNIX or MS-DOS).

    To format a memory card with an UNIX file system, type the following commands:


  % fdformat vol_alias_device_name  
  % newfs /vol/dev/aliases/vol_alias_device_name  

For example, to format a PCMCIA memory card in PCMCIA socket number 0 with a UNIX file system, type the following commands

  % fdformat pcmem0  
  % newfs /vol/dev/aliases/pcmem0  

Or, to format a memory card with an MS-DOS file system, type one of the following commands:

  % fdformat -t dos vol_alias_device_name  

or

  % fdformat -d vol_alias_device_name  

For example, to format a PCMCIA memory card in PCMCIA socket number 0 with an MS-DOS file system, type either of the following commands

  % fdformat -d pcmem0  

or

  % fdformat -t dos pcmem0  

  1. Remove and insert the PCMCIA memory card.

    This step is necessary so that the Volume Manager can remount the mounting directory /pcmem/pcmem0.

    Or you can perform the following steps without removing the PCMCIA memory card. Type:


  % eject pcmem0  
  % volcheck  

The Volume Manager automatically remounts the PCMCIA memory card.

· Reformatting a PCMCIA Memory Card

If you have already formatted your PCMCIA memory card, skip this section.
  1. Insert the PCMCIA memory card in the PCMCIA socket.

  1. Enter a command to reformat the memory card with the desired file system (UNIX or MS-DOS).

    To reformat a memory card with an UNIX file system, type the following commands:


  % fdformat -U vol_alias_device_name  
  % newfs /vol/dev/aliases/vol_alias_device_name  

For example, to format a PCMCIA memory card in PCMCIA socket number 1with a UNIX file system, type the following commands

  % fdformat pcmem1  
  % newfs /vol/dev/aliases/pcmem1  

Or, to reformat a memory card with an MS-DOS file system, type one of the following commands:

  % fdformat -U -t dos vol_alias_device_name  

or

  % fdformat -Ud vol_alias_device_name  

For example, to reformat a PCMCIA memory card in PCMCIA socket number 1 with an MS-DOS file system, type either of the following commands

  % fdformat -d pcmem1  

or

  % fdformat -t dos pcmem1  

  1. Remove and insert the PCMCIA memory card.

    This step is necessary so that the Volume Manager can remount the mounting directory /pcmem/pcmem0.

    Or you can perform the following steps without removing the PCMCIA memory card. Type:


  % eject pcmem0  
  % volcheck  

The Volume Manager automatically remounts the PCMCIA memory card.
The following table is a summary of options for the fdformat utility.
Table G-6 fdformat
OptionDescription
-UUnmounts the PCMCIA memory card
-dInstalls an MS-DOS file system (UNIX is the default)
-t dosInstalls an MS-DOS file system (UNIX is the default)

Copying Files

You can use commands such as cp, rm, diff, and ls to copy, remove, compare, and list the directory names for files on a PCMCIA memory card.
· Copying Files from a Hard Disk to a PCMCIA Memory Card
* Type:

  example% cp filename /pcmem/pcmem0/filename  

· Copying Files from a PCMCIA Memory Card to a Hard Disk
* Type:

  example% cp /pcmem/pcmem0/filename /pathname/filename  

· Ejecting a PCMCIA Memory Card Using the eject(1) Command
If you want to remove a PCMCIA memory cards while a file system is mounted, you must use the eject(1) command.

CAUTION Warning - Removing a PCMCIA memory card while mounted results in a system panic.

  1. Type:


  % eject vol_alias_device_name  

or type:

  % eject pcmem0  

A Removable Media Manager pop-up is displayed.
  1. Click on the OK button.

  2. Remove the PCMCIA memory card.


Note - If you want to continue using the PCMCIA memory card, leave it in the PCMCIA socket. Use the volcheck(1) command so Volume Manager can remount the PCMCIA memory card. To run this command, type volcheck.

Copying Files with Volume Management Disabled

This is the third of three sections that describe different methods for formatting a PCMCIA memory card and for copying files between it and a hard disk. This section describes the way to do such tasks when Volume Management is disabled on your system.
This section describes the following tasks:
  • Disabling Volume Management
  • Formatting a PCMCIA Memory Card
  • Mounting a PCMCIA Memory Card
  • Copying files
  • Enabling Volume Management

· Disabling Volume Management

  1. Choose Programs >> Command Tools from your Workspace menu.

  2. Become superuser by typing:


  example% su  
  Password: root_password  
  example#  

  1. Disable Volume Management by typing:


  # /etc/init.d/volmgt stop  

· Formatting a PCMCIA Memory Card

If you have already formatted your PCMCIA memory card, skip this section.
  1. Insert the PCMCIA memory card in the PCMCIA socket.

  2. Enter a command to format the memory card with the desired file system (UNIX or MS-DOS).


Note - The format utility cannot be used with PCMCIA memory cards. Only the fdformat utility will work.

To format a memory card with a UNIX file system, type the following commands:

  % fdformat device_name  
  % newfs device_name  

For example, to format a PCMCIA memory card in a disk drive with an assigned device name of /dev/dsk/c1t6d0s2, type:

  % fdformat /dev/dsk/c1t6d0s2  
  % newfs /dev/dsk/c1t6d0s2  

To format a memory card with an MS-DOS file system, type one of the following commands:

  % fdformat -d device_name  

or

  % fdformat -t dos device_name  

For example, to format a PCMCIA memory card in a disk drive with an assigned device name of /dev/dsk/c1t6d0s2, type:

  % fdformat -d /dev/dsk/c1t6d0s2  

or

  % fdformat -t dos /dev/dsk/c1t6d0s2  


CAUTION Warning - Removing a PCMCIA memory card while mounted results in a system panic.

· Mounting a PCMCIA Memory Card

* Mount a PCMCIA memory card with a UNIX file system by typing:

  # mount mount_directory device_name  

If there is no /mnt directory, type:

  example# mkdir /mnt  

For example, to mount a UNIX file system in the /mnt directory on a disk drive with an assigned address of c1t6d0s2, type:

  example# mount /dev/dsk/c1t6d0s2  /mnt  

* Mount a PCMCIA memory card with a MS-DOS file system by typing:

  # mount -F pcfs mount_directory device_name  

If there is no /pcfs directory, type:

  example# mkdir /pcfs  

For example, to mount an MS-DOS file system in the /pcfs directory on a disk drive with an assigned address of c1t6d0s2, type:

  example# mount -F pcfs  /dev/dsk/c1t6d0s2  /pcfs  

Copying Files

You can use commands such as cp, rm, diff,and ls, to copy, remove, compare, and list the directory names of files on a PCMCIA memory card.
· Copying Files from a Hard Disk to a PCMCIA Memory Card
* Type:

  example# cp filename    /pcfs/filename  

· From a PCMCIA Memory Card to a Hard Disk
* Type:

  example# cp /pcfs/filename    /pathname/filename  

If you accidentally remove the PCMCIA memory card while mounted, unmount the mount directory.
* Insert the memory card to the PCMCIA socket to unmount the mount directory by typing:

  # umount mount_directory  

For example:

  example# umount /pcfs  

· Enabling Volume Management
* Enable Volume Management by typing:

  # /etc/init.d/volmgt start  

Using a PCMCIA Serial/ModemCard

Refer to the product manual provided with your PCMCIA modem or serial interface card for information about operation of that device.

PCMCIA Serial/Modem Card Device Names

The device names for the PCMCIA serial devices are created in the /dev/term and /dev/cua directories.
The device names are pcN
where N is a PCMCIA socket number.
Eight entries are created in the /etc/remote directory that correspond to the first eight PCMCIA sockets.

PCMCIA Serial/Modem Cards and Power Management's Resume/Suspend Feature

This section provides additional information for systems that have PCMCIA cards and the Power Management software installed. For more information on Power Management, refer to the Power Management Guide.

CAUTION Caution - Do not insert or remove a PCMCIA card while your system is suspending or resuming. The PCMCIA card will not be recognized after the resume operation.

If an application is accessing a PCMCIA serial/modem card while the system is being suspended, a HANGUP condition may occur which may cause the application to terminate.
For example, if you used the tip command to access a PCMCIA serial/modem card while trying to suspend your system, the tip command automatically exits when your system resumes. Other applications, such as UUCP or PPP, may try to automatically access the PCMCIA serial or modem card.