Vector Linux 5

Information Center

 

External Storage

CONTENTS

1. Introduction
2. Floppy Drive
3. CDROM
4. CDWRITER
5. USB Storage
6. How They Work
7. Credits

 


1. Introduction

Many new Linux users, especialy those that come from Windows, are immediately struck by the inconvenient floppy or cdrom access.

Quote: 4ebees on www.vectorlinux.com/forum

Just one quick question though: Is it usual to have to manually mount the floppy (via command line) in VL,
or does can you make it mount when the floppy is inserted?

Well, it was usual, but not anymore. Let's see how Vector Linux can help you. We will quickly point out the feature. If it does not work, please go to the last section to understand the underlying mechanism, and hopefully you can be a bit smarter to tinker it by yourself.

Top


2. Floppy Disk

We assume that you are working with one of the provided VL window managers. It could be a Fluxbox, IceWM, XFCE or KDE. The most important thing is, you should see desktop icons, and one of them is "Floppy". To work with a floppy, simply:

  1. Insert your floppy in the floppy drive
  2. Click the floppy icon. A file manager will be launched for you. It could be ROX-Filer (on IceWM/Fluxbox), EmelFM (if ROX does not exist), or konqueror (on KDE).
  3. The floppy is usually mounted on /mnt/floppy. You may use the file manager to read/write the data from/to the floppy.
  4. After finished, you MUST close the file manager.
  5. Take out the floppy

Thatīs all. If you want to know the detail, clicking the floppy icon mounts the floppy and launches the file manager. Then when you close the file manager, the floppy will be unmounted. Simple huh ? You must remember one thing though,
DO NOT take out the floppy before you close the file manager, or the floppy-drive light is still flashing. Doing so could damage your data !

Top


3. CDROM

Same as the floppy. Simply:

  1. Insert your cdrom in the cdrom drive.
  2. Click the cdrom icon. A file manager will be launched for you with the CDROM contents on the /mnt/cdrom folder.
  3. Use the file manager to read the data from the cdrom.
  4. After you're finished, you MUST close the file manager.

Top


4. CDWRITER

Ok, this is a bit different. We can't use a file manager to write data into a cdwriter. Thus if you click the cdwriter icon, a cd-burning program will be launched. It could be k3b (on VL SOHO) or xcdroast (on the other VLs).

However, before ordinary users can use these programs, they must have been set up by root.

  1. if you want to use k3b, use root to launch k3b first.
  2. For xcdroast, launch it as root. It will ask you to allow users access.

Top


5. USB-Storage

Technically, USB-Storage (including Pen Drive, Flash disk, etc) is a different story than floppy or CDROM because they are handled by the hotplug system. Fortunately, VL is able to make it work similarly on IceWM, Fluxbox, or XFCE.

  1. Insert the usb-storage in one of the USB slots
  2. Click the floppy icon. A file manager will be launched so you can browse the contents on /mnt/usb-storage.
  3. After you're finished, you MUST close the file manager.
  4. Take out the usb-storage.

In KDE, it will be even more convenient. When you plug-in the usb-storage, a pendrive Icon should pop up on the desktop. Just click it to access the pendrive contents. After you unplug the pendrive, the icon will disappear. Writing is not cached, so there is little chance of losing data when unplugging, but if you've just written something important and want to make sure, use the right mouse button over the pendrive icon and select "unmount" from the actions available before unplugging. Nice, isn't it ?

Top


6. How They Work

This is the explanation if you want to know the underlying mechanism. Normally, all of these are configured by VL autosetup. However, problem can happen. You can check it out by yourself.

6.1 Floppy and CDROM

They both work on the same principle.

  1. Firstly, during the install Vector Linux autodetection makes a symlink to the actual device. Usually, /dev/floppy links to /dev/fd0 and /dev/cdrom links to one of IDE controller (/dev/hdb, /dev/hdc, etc). Think of the symlink as an alias that hides the actual device. You can check it out by using

    tux@engrob4:$ ls -l /dev/cdrom
    lrwxrwxrwx  1 root root 8 2004-10-06 00:33 /dev/cdrom -> /dev/hdc

    You may set that up manually, or use vcdset.

  2. Then, the symlik is registered on /etc/fstab like this
    # The 'noauto' option indicates that the file system should not be mounted
    # with 'mount -a' 'user' indicates that normal users are allowed to mount it
    /dev/cdrom      /mnt/cdrom      iso9660 defaults,noauto,ro,user 0 0
    /dev/fd0        /mnt/floppy     auto    defaults,noauto,user    0 0
  3. When the user clicks the floppy/cdrom icon, it launches a script that actually does the mounting for you. This is the simplified version.

    #!/bin/sh
    mount /mnt/cdrom
    file_manager /mnt/cdrom/
    umount /mnt/cdrom
  4. Look at the script, after launching the file manager, it waits for it to exit then unmounts the /mnt/cdrom. That's why you have to close the file manager.

 

6.2 CDWRITER

For CDWRITER, k3b and xcdroast will access the device directly. So we don't have to bother about mounting it. However, the most common problem is to set up the device corretly.

Linux kernel 2.6.x is better at handling this, because it is able to access the cdwriter directly through the IDE driver . For Linux kernel 2.4.x, there are some caveats.

  1. Firstly, your Linux must be booted with the special parameter "hdc=ide-scsi". Here, hdc is the actual device (it could be hdb, hdc, or hdd). Actually, ide-scsi is a kernel driver that is a wrapper to the IDE device, so it can be accessed as an SCSI device. To enable this, call vliloconf and specify that parameter. To make sure, look at the file /etc/lilo.conf, it should contain a line like this

    append = "hdc=ide-scsi"
  2. Then, Linux must load the ide-scsi module during boot time. This is done through /etc/rc.d/rc.modules with the following command:
    modprobe ide-scsi
  3. Next, we need the cdwriter symlink. It should point to the emulated scsi device, not to the actual IDE device.
    tux@engrob4:$ ls -l /dev/cdwriter
    lrwxrwxrwx  1 root root 8 2004-10-06 00:33 /dev/cdwriter -> /dev/scd0

    You may set that up manually, or use vcdset.

     

6.3 USB-STORAGE

USB storage is handled by hotplug. Hotplug on Linux was designed to be as smart as Plug&Play on Windows. However, both of them have also proved to be troublemakers. So yeah, if everything goes right, your USB-storage works this way:

  1. When you plug in the pendrive, the hotplug system will detect it.
  2. The hotplug system launches the registered script, in this case "usb-mount". You may check the registration on /etc/hotplug/usb.
  3. To run properly, usb-mount needs root privilege. So it should have an entry on /etc/sudoers.
  4. The usb-mount script will automatically mount the device into /mnt/usb-storage/device-0 (or -1, -2, etc as appropiate)
  5. If KDE is running, usb-mount creates a desktop icon.
  6. When you unplug the device, the hotplug system calls usb-umount.
  7. The usb-umount script deletes the desktop icon and unmounts the /mnt/usb-storage/device-0.

Actually it is not quite that simple, but you get the picture, right ?

Top


7. Credits

Copyright 2004 Vector Linux
Released under [GNU Free Document License [ http://www.gnu.org/licenses/fdl.html ]
Contributed By: Kocil, Joe1962

Top