Operating System - Linux
1820310 Members
2404 Online
109623 Solutions
New Discussion юеВ

/dev/st0: no such device aka. where is my tape drive, PART 2

 
SOLVED
Go to solution
Runar J├╕rgensen
Frequent Advisor

/dev/st0: no such device aka. where is my tape drive, PART 2


Greetings

I'm returning to this thread (/dev/st0: no such device aka. where is my
tape drive, ITRC Mar 20, 2003; hint search ITRC for C1529), because
struggling with something else provided the means to solve this
problem. However, there are still a couple of issues though. I'll honor
whoever provides good leads with ten-pointers even if I deserve at least
one myself. :-)

This whole issue boils down to modules, and how and when to load
them. Sequence seems important, as does who to automate module loading.
I'm struggling with both.

Earlier in the thread referred, I've stated that modules where
loaded. That's still true at least for scsi_mod. I needed another module
namely aic7xxx. In /etc/modules.conf I have the following line

alias scsi_hostadapter aic7xxx

Obviously that's not enough. Also changed in the setup. Originally I had
the tape drive assigned to SCSI ID 3. It's now SCSI ID 6. Shouldn't be
important though. When booting dmesg reports:

SCSI subsystem driver Revision: 1.00
PCI: Found IRQ 10 for device 00:10.0
PCI: Sharing IRQ 10 with 00:07.5
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.5

aic7880: Ultra Wide Channel A, SCSI Id=7, 16/253 SCBs
Vendor: HP Model: C1533A Rev: AN04
Type: Sequential-Access ANSI SCSI revision: 02
st: Version 20020205, bufsize 32768, wrt 30720, max init. bufs 4, s/g segs 16
Attached scsi tape st0 at scsi0, channel 0, id 6, lun 0
(scsi0:A:6): 10.000MB/s transfers (10.000MHz, offset 15)
st0: Block limits 1 - 16777215 bytes.
scsi : 0 hosts left.

But tar, mt and dd fails to read any tape device (ref. earlier thread)

First I unload all the SCSI modules
# rmmod sg scsi_mod ide_scsi sr

# modprobe -v scsi_hostadapter
# modprobe -v st

Now dsmeg tells me:
SCSI subsystem driver Revision: 1.00
PCI: Enabling device 00:10.0 (0116 -> 0117)
PCI: Found IRQ 10 for device 00:10.0
PCI: Sharing IRQ 10 with 00:07.5
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.5

aic7880: Ultra Wide Channel A, SCSI Id=7, 16/253 SCBs

Vendor: HP Model: C1533A Rev: AN04
Type: Sequential-Access ANSI SCSI revision: 02
st: Version 20020205, bufsize 32768, wrt 30720, max init. bufs 4, s/g segs 16
Attached scsi tape st0 at scsi0, channel 0, id 6, lun 0
(scsi0:A:6): 10.000MB/s transfers (10.000MHz, offset 15)

Now I have access to the tape drive.

What do I need to do be relieved from manual unloading/loading of modules?

Remember, there are ten-pointers here to the ones who wants them.

Regards,
Runar J├Г┬╕rgense
11 REPLIES 11
Roberto Polli
Trusted Contributor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

a few quests
1)what do you mean with
"Obviously that's not enough. Also changed in the setup." ?

2) I suppose your tape is always on ;-)
3) did you change /etc/modules.conf or /lib/modules/_kernel_/modules.dep

It is possible you have to specify the correct sequence of module loading in modules.conf and in modules.dep

Post the difference between system loadin sequence and your one.


Peace, R.
Mark Grant
Honored Contributor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

You have two choices. the first (my favourite if resources allow) is to compile the drivers direct into the kernel and forget about all that mucking about with modules.

Secondly, you need to add an entry to /etc/conf.modules or /etc/modules.conf depending on your distro and "alias" the major number of your tape device to the modules you want loaded. Then, when anything accesses the driver specified by that major device number, the module automatically gets loaded. Exciting isn't it!
Never preceed any demonstration with anything more predictive than "watch this"
Runar J├╕rgensen
Frequent Advisor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

Hello

A couple of followup answers. Hopefully in chronological order.

First phrasing was bad. I appologise. What I ment was that assigning an alias to aic7xxx
is not enough to get it loaded. But I'm on thin ice here.

The setup change is a different thing. Only related to the change of SCSI ID from 3 to 6.
Hope this takes care of the confusion.

Further, yes the tape is always on. What
off-button? Is there one? :-)

There has not been any change in modules.conf. Might have been in modules.dep. What should I look for?
# grep aic /lib/modules/`uname -r`/modules.dep
/lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/aic7xxx/aic7xxx.o: /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/scsi_mod.o
/lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/aic7xxx_old.o: /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/scsi_mod.o

I'm sorry Roberto, But your last question throws me off. I need your help in more detail to provide you with what you need.

Mark, recompiling the kernel is something that I rather not do at this stage. I've got almost everything else to work (sound, graphics, etc.) so I hope not to mess around with kernel compiles.

However, your comment on major number is very informative. I've assigned major numbers in /etc/modules.conf, but mainly to get rid of all the noise in /var/log/messages
I looked through /usr/src/linux-2.4.18-3/Documentation/devices.txt, but that's probably not what you ment. I do have
alias char-major-21 sg
in my /etc/modules.conf. But how it got there I really don't know. Is major number for scsi tape 9 and what about the aic7xxx? Does it get loaded as well?

Regards,
Runar Joergensen
Roberto Polli
Trusted Contributor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

hi Runar,
1) I haven't see your tape and mine has a switch on|off :-DD
2) you don't have to rebuild your kernel
3) modules.dep is a file where are listed dependencies between modules. An entry like

/lib/modules/2.4.7-10/kernel/drivers/scsi/st.o: /lib/modules/2.4.7-10/kernel/drivers/scsi/scsi_m
od.o

tells the kernel to load scsi_mod.o before module st.o is loaded, so you can check your module loading-order looking in that file. Being the '\' a end-of-line protector, you can't use grep to get useful info.

Peace, R.
Roberto Polli
Trusted Contributor
Solution

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

forum has bad-split my post.

this is _only_ an _example_ about modules.dep:
---example!!!!!----
let's say we've 3 modules
aicxxx needs sg
st needs aicxxx ghost_module
sg needs nothing
---example!!!---
in modules.dep you'll find

sg.o:
aicxxx.o: sg.o
st: aicxxx.o \
ghost_module


Hope it's clear.

Post pls. your #lsmod
after, during, and before unloading


Pax, r/.




Mark Grant
Honored Contributor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

Runar,

It should be that char-major-9 should be aliased to whatever driver you use when you "modprobe" manually.

If you are having a bit of difficulty dertermining what is actually happening, try creating the directory /var/log/ksymoops. Various things ought to get logged in there if it exists.
Never preceed any demonstration with anything more predictive than "watch this"
Runar J├╕rgensen
Frequent Advisor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

Hello

I admit it, I know I don't have to recompile the kernel. I just don't want to compile modules either right know. It's a another very long story.

Here's the lsmod listing

[root@rujpc root]# lsmod
Module Size Used by Tainted: P
usbserial 20640 0 (autoclean) (unused)
parport_pc 18436 1 (autoclean)
lp 8768 0 (autoclean)
parport 33888 1 (autoclean) [parport_pc lp]
nls_iso8859-1 3520 1 (autoclean)
via82cxxx_audio 20384 1 (autoclean)
uart401 7808 0 (autoclean) [via82cxxx_audio]
ac97_codec 11808 0 (autoclean) [via82cxxx_audio]
sound 71212 0 (autoclean) [via82cxxx_audio uart401]
soundcore 6468 5 (autoclean) [via82cxxx_audio sound]
mga 106992 13
agpgart 39168 3
autofs 11716 0 (autoclean) (unused)
pcnet32 14720 1
keybdev 2560 0 (unused)
mousedev 5152 0 (unused)
hid 20928 0 (unused)
input 5792 0 [keybdev mousedev hid]
usb-uhci 24420 0 (unused)
usbcore 72864 1 [usbserial hid usb-uhci]
ext3 66528 5
jbd 48440 5 [ext3]
[root@rujpc root]#
[root@rujpc root]# modprobe -v scsi_hostadapter
/sbin/insmod /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/scsi_mod.o
Using /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/scsi_mod.o
Symbol version prefix ''
/sbin/insmod /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/aic7xxx/aic7xxx.o
Using /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/aic7xxx/aic7xxx.o
[root@rujpc root]# modprobe -v st
/sbin/insmod /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/st.o
Using /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/st.o
Symbol version prefix ''
[root@rujpc root]# lsmod
Module Size Used by Tainted: P
st 29236 0 (unused)
aic7xxx 122048 0 (unused)
scsi_mod 106160 2 [st aic7xxx]
usbserial 20640 0 (autoclean) (unused)
parport_pc 18436 1 (autoclean)
lp 8768 0 (autoclean)
parport 33888 1 (autoclean) [parport_pc lp]
nls_iso8859-1 3520 1 (autoclean)
via82cxxx_audio 20384 1 (autoclean)
uart401 7808 0 (autoclean) [via82cxxx_audio]
ac97_codec 11808 0 (autoclean) [via82cxxx_audio]
sound 71212 0 (autoclean) [via82cxxx_audio uart401]
soundcore 6468 5 (autoclean) [via82cxxx_audio sound]
mga 106992 13
agpgart 39168 3
autofs 11716 0 (autoclean) (unused)
pcnet32 14720 1
keybdev 2560 0 (unused)
mousedev 5152 0 (unused)
hid 20928 0 (unused)
input 5792 0 [keybdev mousedev hid]
usb-uhci 24420 0 (unused)
usbcore 72864 1 [usbserial hid usb-uhci]
ext3 66528 5
jbd 48440 5 [ext3]

I think I understand your example Roberto. When I do this manually (see above) scsi_hostadapter (aka. aic7xxx) has a dependency to scsi_mod. From modules.dep I see that st also has a dependency to scsi_mod.
/lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/st.o: /lib/modules/2.4.18-3pcnet32-patched/kernel/drivers/scsi/scsi_mod.o

You want me to add aic7xxx to this? So that st also have a dependeny to aic7xxx? How is the sequensing should I enter aic7xxx before or after scsi_mod? Can I use a text editor for this or is there a tool for it?

Mark,
I had a look at /etc/modprobe.conf.dist. Looks like the major number is already covered by default. But I need a dependency to aic7xxx also.

/etc/modprobe.conf.dist:alias char-major-9 st

Can I alias this to several drivers?
Perhaps this is best fixed in modules.dep?

But what happens if depmod is run again? Is this info lost?

Regards, Runar
Roberto Polli
Trusted Contributor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

I don't remember if you can specify custom dependencies in modules.conf but there you can do a lot of things.

1) do you need both modules (st+aic7xxx) to use scsi tape?
2) do you need the previous sequence of load?
3) I'm out of office for a week.

so Peace, & good luck
R
Runar J├╕rgensen
Frequent Advisor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

Hello

Answers to Roberto's questions
1) I dunno know, but it works that way so apparently they don't conflict. Maybe with something else?

2) That's the way I've got this to work. By first loading scsi_mod (low_level) and then in order aic7xxx and st.

3) Not me. I'm stuck here.

Searching on the net I found that I could use

alias scsi_hostadapter aic7xxx
pre-install st modprobe scsi_hostadapter

in /etc/modules.conf. I did, but nothings changed after reboot. The only thing that happenend during boot was that I got "unresolved symbols" for cdfs.o and ntfs.o. Haven't seen those before either. Couldn't relocate those in dmesg or /var/log/messages
Mark proposed adding /var/log/ksymoops.
What would be logged there?
What else am I missing?

Regards,
Runar Jorgensen
Roberto Polli
Trusted Contributor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

Hi Runar.
Did yuo try with a script to run at boot, such

modprobe sg
modprobe aic7xxx
modprobe st

?

Does st depend from aic7xxx?



Peace, R.

Runar J├╕rgensen
Frequent Advisor

Re: /dev/st0: no such device aka. where is my tape drive, PART 2

Hello guys

Finally I think Ive got this solved.

Indeed I need to load the st module. I tried without it and mt, dd, tar, cpio hung and was impossible to get rid of. Even kill -KILL didn't work. I found one solution though.
Unload all modules except scsi_mod (can't be done anyway), go to rinlevel 3, unload scsi_mod, go back to runlevel 5 (in my case).

Another thing I found was to use mkinitrd AFTER ANY CHANGE TO /etc/modules.conf. I'm not screaming, just emphasising. I had to update the ramdisk to get this to work. Especially after doing stuff with scsi. It's probably a RTFM, but I really didn't even know what this mkinitrd was about.

Summary: This is working at the moment.
Add in /etc/modules.conf.

alias scsi_hostadapter aic7xxx
pre-install st modprobe scsi_hostadapter

Run in /boot

# mv initrd-2.4.18-3pcnet32-patched.img initrd-2.4.18-3pcnet32-patched.img.old
#mkinitrd -f -v initrd-2.4.18-3pcnet32-patched.img 2.4.18-3pcnet32-patched

Thanks to the ITRC Forums for all help.
Points are under way.

Regards,
Runar Joergensen