MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!


 
 

*DocIndex - Hardware

Removable Storage V

* SCSI
* CD-R(OM/W)
* Tape Drives
* All Other SCSI Storage Devices

Related Resources:

The FAQ for comp.periphs.scsi
'scsi.txt' in 'linux/Documentation'
CDROM-HOWTO
CD-Writing-HOWTO
Linux - Optical Disk HOWTO
Zip Drive Mini-HOWTO
Jaz Drive HOWTO

Revision / Modified: Sep. 11, 2001
Author: Tom Berger

 

* SCSI

SCSI is regarded as the high-end standard for storage devices. While it isn't necessarily faster than IDE/ATA, it sports features like tagging, queuing and error correction. You can also 'hot swap' SCSI devices, i.e. connect and disconnect devices from the chain during system runtime. In contrast to IDE/ATA, SCSI requires quite an amount of electronics on the devices, which accounts for their higher price (although there certainly is a bit of marketing policy involved here, too).

Compatibility

Compatibility shouldn't be an issue, GNU/Linux supports almost all adapters available today, even the latest Ultra160 SCSI cards. And if you can connect a device to a SCSI bus, chances are it is supported by GNU/Linux, too. Devices include CD-R(OM/W), MODs, Flopticals, Bernoulli, WORM, Jaz, ZIP, ORB, PDs and more.
If you have trouble with GNU/Linux recognizing or working correctly with your SCSI host adapter, you may have to use some boot-prompt arguments to show GNU/Linux the right way.
Make sure you've set up the hardware correctly (cables, IDs, terminators).

Booting

Even if you want to boot from SCSI devices, you do not have to recompile the kernel. mkinitrd takes care of preloading necessary modules, so you only have to update '/boot/initrd.img' once if you add new SCSI hardware to the system you want to be bootable. Read man mkinitrd for more.

Hardware Detection

SCSI host adapters should be detected and configured automatically. Look for an entry in '/etc/conf.modules' that starts with alias scsi_hostadapter. If there isn't such an entry, refer to MUO's Hardware Configuration Guide for setup instructions.

A second way to check detection is dmesg, which shows the boot messages. You should see something like this:

scsi : 1 host
[first SCSI device]
[second SCSI device] etc.

Finally you can check the availability of SCSI devices in '/proc/scsi'. This directory includes subdirectories for configured SCSI-host adapters and SCSI hardware (less /proc/scsi/scsi).

Adding SCSI Devices During Runtime

Sometimes you want to access a device that wasn't powered on during boot. Power on the device and issue this command (as 'root'):

echo "scsi add-single-device [host] [channel] [ID] [LUN]" >/proc/scsi/scsi

Example: You have only one SCSI adapter and the device ID is 4:

echo "scsi add-single-device 0 0 4 0" >/proc/scsi/scsi

You can achieve the same more comfortably with the scsiadd programm.
Another - perhaps more 'legal' way - would be unloading and reloading the SCSI driver:

  1. Unmount all SCSI devices.
  2. Run modprobe -r scsi_hostadapter
  3. Run modprobe scsi_hostadapter

Of course this only works if you do not run GNU/Linux from a SCSI hard disk...

* section index * top

* CD-R(OM/W)

Device files are '/dev/scd0' for the first SCSI CD-R(W), '/dev/scd1' for the second etc.
In pre-LM 7 or if you're not using 'supermount', it might be necessary to issue this command via '/etc/rc.d/rc.local'

modprobe scsi_hostadapter

to be able to mount the drive later (e.g. with mount /dev/scd0 -t auto /mnt/cd or an entry in '/etc/fstab').

In some older releases, if your SCSI CD was a burner and you wanted to burn CD's as a normal user, you'd have to perform these steps (as 'root'):

  1. Add your 'normal' user name to the cdwriter group in '/etc/group'
  2. If the burner is the first or only SCSI CD drive in your computer ('dev/sdc0'), also run chgrp cdwriter /dev/scd0

These steps are not necessary in current releases.

* section index * top

* Tape Drives

SCSI tape drives are accessed via /dev/st0 resp. /dev/nst0 (no rewind). Tapes are usually used unmounted with the mt command and archiving programs like tar or afio (You can get an afio RPM from the 'contrib/RPMS' directory of your favorite Cooker server).
Example:

mt -f /dev/ftape retension

rewinds the tape. Read man mt for more (I've never used a tape drive, so I can be of no help here).

* section index * top

* All Other SCSI Storage Devices

They all use '/dev/sda' (first SCSI device) or '/dev/sdb' (second SCSI device) etc. as device files. You can have up to 128 SCSI devices.

Preformatted media come with different partition schemes: Jaz and ZIP disks have their data partition on the fourth primary partition (e.g. '/dev/sda4'), ORB disks on the first logical partition (e.g. '/dev/sda5'). Create mount directories for them in '/mnt' and add appropriate entries to '/etc/fstab' (see the article on mounting partitions).
Use the standard tools to partition and format them (cfdisk, mke2fs).

If you want to boot off these disks, follow the outline given in the Jaz-Drive-HowTo.

* section index * top

 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.