Operating System - Linux
1829103 Members
2498 Online
109986 Solutions
New Discussion

FC Tape Drive for Redhat V4

 
SOLVED
Go to solution
Graham Smith_8
Advisor

FC Tape Drive for Redhat V4

I am new to Linux, but have been using tru64 for years. I need to install a FC tape library on a Linux server and don't have much of a clue where to start.
In tru64 I would use
# hwmgr -scan scsi

Is there an equivalent function in redhat linux?
12 REPLIES 12
Ivan Ferreira
Honored Contributor
Solution

Re: FC Tape Drive for Redhat V4

HP fibreutils packages provides the hp_rescan command. You can also download a script called rescan-scsi-bus.sh to rescan the devices.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Hemmetter
Esteemed Contributor

Re: FC Tape Drive for Redhat V4

Hi Graham,

first you need to know your fibre-HBA.
$ lspci | grep -i fibre

the (re)load the apropriate driver:
e.g. lpfc or qla2200v6 or ...

$DRVR=lpfc
$ #modprobe -r $DRVR # remove driver
$ modprobe $DRVR # load driver

then check if you see your tape(s):
$cat /proc/scsi/scsi

Then check Tape status:
$ mt -f /dev/st0 status




rgds
HGH


Ivan Ferreira
Honored Contributor

Re: FC Tape Drive for Redhat V4

See also:

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/release-notes/as-s390/RELEASE-NOTES-U3-s390-en.html

Support for fabric rediscovery through sysfs is now available in Red Hat Enterprise Linux 4 Update 3. For the Qlogic (qla2xxx) and Emulex (lpfc) Fibre Channel HBA drivers, run the following commands to perform redisocvery and rescan for new storage:


echo "1" > /sys/class/fc_host/hostXYZ/issue_lip
echo "- - -" > /sys/class/scsi_host/hostXYZ/scan


In some Fibre Channel configurations, an operating system will automatically detect the addition of a new target device while the system is running. In other configurations, it is necessary to issue the following command to detect a new target device:


echo 1 > /sys/class/fc_host/hostn/issue_lip

Where hostn corresponds to the appropriate adapter.

When a new Logical Unit is created on a particular target, a command such as the following is required to detect and configure it:


echo "b t l" > /sys/class/scsi_host/hostn/scan

Where b is the bus, t is the target, and l is the LUN to be scanned on hostn.

Wild cards can also be used, such as the following example:


echo "- - -" > /sys/class/scsi_host/host2/scan

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
dirk dierickx
Honored Contributor

Re: FC Tape Drive for Redhat V4

using RH4 with QLA cards, everything goes automatic. The robot itself is accessable through the generic scsi device file, while the tape drives are the standard /dev/rmt# types.

like i said, in my case all is detected at boot (no need for extra drivers or tools), which can be checked easily with dmesg.
Graham Smith_8
Advisor

Re: FC Tape Drive for Redhat V4

Gentlemen, Thank you very much for your valuable input, it is greatly appreciated.
I have scanned the scsi device and can see the changer and (i think) tape drive in /proc/scsi/scsi. All good. But still no /dev/st0 or /dev/rmt# or /dev/changer.
Do I need to reboot the server for these changes to take effect?
Thanks in advance.

Graham
Hemmetter
Esteemed Contributor

Re: FC Tape Drive for Redhat V4

Hi Graham,

check if "st" kernel module is loaded:

$ lsmod | grep -w st
# if not loaded (re)load it:
($ rmmod st )
$ modprobe st

What do you see in /proc/scsi/scsi?
(try attached script).

rgds
HGH







Graham Smith_8
Advisor

Re: FC Tape Drive for Redhat V4

[root@dcpbl01 ~]# lsmod | grep -w st
[root@dcpbl01 ~]# modprobe st
[root@dcpbl01 ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: HSV200 Rev: 6000
Type: RAID ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 00 Lun: 01
Vendor: HP Model: HSV200 Rev: 6000
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 00 Lun: 02
Vendor: HP Model: HSV200 Rev: 6000
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: HP Model: HSV200 Rev: 6000
Type: RAID ANSI SCSI revision: 05
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: HSV200 Rev: 6000
Type: RAID ANSI SCSI revision: 05
Host: scsi1 Channel: 00 Id: 02 Lun: 00
Vendor: HP Model: HSV200 Rev: 6000
Type: RAID ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 02 Lun: 02
Vendor: COMPAQ Model: MSL5000 Series Rev: 0518
Type: Medium Changer ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 02 Lun: 05
Vendor: HP Model: NS E1200-160 Rev: 568c
Type: RAID ANSI SCSI revision: 04
Hemmetter
Esteemed Contributor

Re: FC Tape Drive for Redhat V4

Hi Graham,

does the script from my last post show a device file for your changer?

can you give the output of:
$ ls -l /sys/bus/scsi/devices/0:0:2:2/


rgds
HGH
Rob Leadbeater
Honored Contributor

Re: FC Tape Drive for Redhat V4

Hi Graham,

You might need to add the following line to /etc/modules.conf

options scsi_mod max_scsi_luns=128

and rebuild your kernel.

Take a look at the following RedHat article:

http://kbase.redhat.com/faq/FAQ_43_2706.shtm

Hope this helps,

Regards,

Rob
Graham Smith_8
Advisor

Re: FC Tape Drive for Redhat V4

/sys/bus/scsi/devices/0:0:2:2
[root@dcpbl01 0:0:2:2]# ls -l /sys/bus/scsi/devices/0:0:2:2
lrwxrwxrwx 1 root root 0 Jun 25 09:44 /sys/bus/scsi/devices/0:0:2:2 -> ../../../devices/pci0000:00/0000:00:02.0/0000:03:00.0/0000:04:03.0/host0/target0:0:2/0:0:2:2
Hemmetter
Esteemed Contributor

Re: FC Tape Drive for Redhat V4

Hi Graham,

can you give the output of:
$ ls -l /sys/bus/scsi/devices/0:0:2:2/*
With "*" (sorry it was lost in copy'n paste)

Have you tried my script? Does it show some tapes?

rgds
HGH




Graham Smith_8
Advisor

Re: FC Tape Drive for Redhat V4

[root@dcpbl01 0:0:2:2]# ls -l /sys/bus/scsi/devices/0:0:2:2/*
--w------- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/delete
-rw-r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/detach_state
-r--r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/device_blocked
-rw-r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/dump
lrwxrwxrwx 1 root root 0 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/generic -> ../../../../../../../../class/scsi_generic/sg6
-r--r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/model
-rw-r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/queue_depth
--w------- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/rescan
-r--r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/rev
-r--r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/scsi_level
-rw-r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/state
-rw-r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/timeout
-r--r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/type
-r--r--r-- 1 root root 4096 Jun 26 10:52 /sys/bus/scsi/devices/0:0:2:2/vendor

/sys/bus/scsi/devices/0:0:2:2/power:
total 0
-rw-r--r-- 1 root root 4096 Jun 26 10:52 state
[root@dcpbl01 0:0:2:2]#