OpenWindows Advanced User's Guide

G.4 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:

This section describes the following tasks:

G.4.1 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
    

  3. 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.

G.4.2 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.

  2. 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
    

  3. 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 Utility Options

    Option 

    Description 

    -U

    Unmounts the PCMCIA memory card 

    -d

    Installs an MS-DOS file system (UNIX is the default) 

    -t dos

    Installs an MS-DOS file system (UNIX is the default)

G.4.3 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.

G.4.3.1 Copying Files from a Hard Disk to a PCMCIA Memory Card

    Type:

    example% cp filename /pcmem/pcmem0/filename
    

G.4.3.2 Copying Files from a PCMCIA Memory Card to a Hard Disk

    Type:

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

G.4.3.3 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 - Caution -

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.

  2. Click on the OK button.

  3. 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.