Managing Removable Media

Accessing removable media, such as CD-ROMs and floppy disks, is handled differently than accessing fixed media, such as hard disks or even networked resources. Traditionally, the management of removable media has fallen under the umbrella title of volume management.

In Solaris 9, volume management has been improved to recognize more media types, including DVD-ROMs and USB Zip and Jaz drives. These are in addition to the already-supported floppy disks and CD-ROMs. Another major improvement for Solaris 9 is the inclusion of the rmformat command. The rmformat command replaces the old fdformat command and has improved features over its predecessor.

Volume Management

The question, then, is: why is volume management of removable media such a big deal? There are a couple of reasons. First, you must have superuser rights to mount and unmount volumes. You certainly don't want to have to give regular users superuser rights just to use a floppy disk or CD-ROM. Second, removing mounted media causes Solaris to panic. If you were to remove a hard disk that was mounted, Solaris would give you error messages. The same applies to removing a mounted floppy disk or CD-ROM.

There was an obvious need for a mechanism to control removable media, including mounting, unmounting, and proper security access, without causing problems for the operating environment. The mechanism was developed and it was called volume manager. Volume manager works through its own daemon, vold. To summarize, Volume Manager provides three major benefits:

  • Users can access removable media without needing superuser privileges.

  • Removable media is automatically mounted, simplifying use.

  • Administrators can grant other computers on the network automatic access to removable media located in your computer.

vold automatically mounts CD-ROM and DVD-ROM disks when they are inserted into your computer. If you wish to access files on a floppy disk or removable hard disk (Zip or Jaz drive), you will need to insert the disk and type volcheck at a command prompt.

If you don't want your computer to automatically mount removable media devices, you can stop the vold service. To do this, log on as the superuser or assume an equivalent role, and execute the following command:

 # /etc/init.d/volmgt stop 

To restart the volume manager, execute:

 # /etc/init.d/volmgt start 

Accessing Removable Media

To access files on removable media, you must insert the media and mount it. If vold is enabled, mounting is easy. For floppy disks and Zip and Jaz drives, insert the disk and type volcheck at a command prompt. For CD-ROMs, DVD-ROMs, and PCMCIA cards, just insert the media and wait a few seconds for vold to mount the media. If you have disabled vold, you will need to mount the media manually by using the mount command.

Note 

PCMCIA (Personal Computer Memory Card International Association) cards, also known as PC Cards, are removable expansion cards for laptops. Typically, PCMCIA devices are hot swappable.

After your removable media is inserted and mounted, accessing files on it is just like accessing any other files in your directory tree. You just need to know where to find them. Solaris makes finding files easy, by providing the following base directories:

  • Files on the first floppy disk drive will be located in /floppy.

  • Removable hard disk files will be in either /rmdisk/zip0 or /rmdisk/jaz0.

  • Files on the first CD-ROM will be in /cdrom.

  • Files on the first DVD-ROM will be in /dvd.

  • PCMCIA files will be located in /pcmem.

Note 

These directories will not exist by default unless you have the required device. For example, if you don't have a Zip or Jaz drive, you will not have an /rmdisk directory.

If you have a floppy disk named labdocs, the full pathname to the disk would be /floppy/ labdocs, or alternately, /floppy/floppy0 if it's in the first floppy disk drive (/floppy/floppy1 for the second disk drive, and so on). Knowing the general location /floppy/floppy0 is handy if you don't know the name of your disk, or the disk has no volume label.

The naming convention indicated for floppy drives holds true for multiple instances of other removable device drives as well. For example, the first CD-ROM is /cdrom/cdrom0, the second CD-ROM device is /cdrom/cdrom1, the third CD-ROM device is /cdrom/ cdrom2, and so on.

File management for removable devices is just like file management in other directories on a hard disk. The management commands you are used to, such as ls, cp, rm, and cat, work just as they would on files on a hard disk. You can even run fsck on floppy disks.

After you have finished accessing the removable media, you can eject it. Although for CD-ROMs, DVD-ROMs, and floppy disks, you can just press the eject button on the device, it's highly recommended you first alert vold that you are going to eject the device. Execute the eject command, followed by the device you wish to eject:

 # eject cdrom 

Formatting Removable Media

Formatting removable media is done with the rmformat command. The rmformat command replaces the old fdformat command, although fdformat is still available in Solaris 9.

One of the new features of rmformat is the ability to provide read/write protection on selective rewritable media such as Zip and Jaz drives. The read/write protection can also include a password. The rmformat command has three options:

quick This command formats the media without certifying the tracks on the media.

long This formats the removable media completely and certifies all tracks.

force This formats completely without any user confirmation. If the media is password protected, the password is cleared and the media is formatted. If there is no password protection, a long format is performed.

Note 

Floppy disks formatted as UFS on a SPARC computer cannot be used on an IA computer, and floppy disks formatted as UFS on an IA computer cannot be used on a SPARC computer. The same holds true for formatted PCMCIA memory cards.

The rmformat options are initiated by the -F switch, as in rmformat -F force /floppy/ floppy0. The -b volname option enables you to provide a volume name.

Floppy disks and PCMCIA memory cards can be formatted with the UFS or PCFS file systems. CD-ROMs can be formatted in either UFS or HSFS, but HSFS is recommended for compatibility reasons.




Solaris 9. Sun Certified System Administrator Study Guide
Solaris 9 Sun Certified System Administrator Study Guide
ISBN: 0782141811
EAN: 2147483647
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net