LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   system not seeing memory card (https://www.linuxquestions.org/questions/slackware-14/system-not-seeing-memory-card-627641/)

jukebox55 03-12-2008 09:01 PM

system not seeing memory card
 
hey,

ive got an external usb card reader, and a memory stick duo pro phone card.

now if i put this card into the reader before booting, the system sees it when i log in as root and do 'blkid', and i can mount it and R/W to it. but if i plug the card into the card reader after booting, and do blkid, the system wont see it.
i know the light on the card reader flashes when '/etc/rc.d/rc.modules2.6.18' is started at boot, but im not sure where to go from here.

duryodhan 03-12-2008 10:51 PM

when the card works ....
do lsmod and save the output to a file.

then restart and go to the scenario where the card doesn't work. Connect the card, and do lsmod.

do a diff on the outputs or post it here.

jukebox55 03-13-2008 07:05 AM

this is the diff

Code:

2a3,6
> nls_iso8859_1          4096  0
> nls_cp437              5760  0
> vfat                  10240  0
> fat                    46108  1 vfat
21d24
< joydev                  8256  0
22a26
> joydev                  8256  0
24d27
< nvidia              7813056  0
26d28
< evdev                  8192  0
27a30
> nvidia              7813056  0
30c33,34
< pcspkr                  2560  0
---
> e1000                121664  0
> evdev                  8192  0
31a36
> i2c_i801                6924  0
34,35c39
< i2c_i801                6924  0
< e1000                121664  0
---
> pcspkr                  2560  0


duryodhan 03-14-2008 12:57 AM

just modprobe everything that is there when it is working, but not there when it is not working. see if it works !

jukebox55 03-14-2008 12:29 PM

got it working.

i have to unload then reload the usb-storage module (rmmod usb-storage, modprobe usb-storage), then run /etc/rc.d/rc.scanluns.

what i dont understand, is the system always sees the card reader, so why is it necessary to have to unload then load the module, for scanluns to see the memory card.

and i dont want a user to be able to load and unload modules at will, just so i can use my memory card.

any ideas?

*edit* just thought maybe i can do this with the sudoers file.

osor 03-14-2008 01:59 PM

Try setting up HAL to do it for you.

jukebox55 03-14-2008 02:21 PM

ive now got it working for my normal user.

ive edited the sudoers file so that the user can run 'rmmod usb-storage', 'modprobe usb-storage', and 'rescan-scsi-bus -l' commands,

then i created a script on the desktop to run through those commands.

but ive come across a weird problem. the script will not work on its 3rd execution ??

it works once, it works twice, then it fails.
it works once, it works twice, then it fails.

i dont get it. lol

anyone?

jukebox55 03-15-2008 11:23 AM

just a thought here, but couldnt i fool the computer into thinking the memory card is in the card reader and connected at boot, even if it isnt? so that when i do plug the card into the reader sometime after boot, i wouldnt have to unload/load the module, i could just have to mount it? is this possible?

evilDagmar 03-16-2008 04:33 AM

There's an option in the kernel config (which Patrick had set off by default when I last looked) that makes most of these kinds of things go away. I've got a combination thumbdrive and sdcard reader that functions flawlessly once the kernel knows to probe for more than one LUN per device by default, without needing to run rc.scanluns.

Look under Device Drivers->SCSI Device Support for "Probe all LUNs on each SCSI device". Enabling that in a kernel should eliminate the need to run the scanluns script.

jukebox55 03-16-2008 11:42 AM

interesting, thanks evilDagmar.

i think its probably high time i had a go at building a custom kernel, as there are a few other features i would like to use too, but ive been stalling cus it looks difficult!

Bruce Hill 03-17-2008 06:25 PM

Building a custom kernel does not have to be terribly difficult. There
are different schools of thought. One is to take the present working kernel's
config file and use it to build a new kernel. Doing this can achieve the
desired result, but you won't learn much (if anything) about kernel building.
You'll also still have a very large kernel.

When I first starting using GNU/Linux, it was amazing to me that I could
actually rebuild my kernel, excluding drivers (modules) for hardware that is
not in my computer. That's one of the things that makes Windows "easy to use"
for a lot of PCs, and has allowed it to dominate the desktop market. There are
drivers included for hundreds, if not thousands, of pieces of hardware.

Building, compiling, and installing a custom kernel takes reading and learning,
and patience. Today it seems there is a dearth of people willing to read, even
man pages or online HOW-TOs, in order to learn.

These are some resources that will help you learn how to build a custom kernel:
Start by downloading the latest source from Kernel.org (2.6.24.3 as of this post).

Unpack the source and open ./linux-2.6.x.y/README -- and do just that. The book
Linux Kernel in a Nutshell will educate you beyond measure. It is available in
both PDF and DocBook formats. Since I haven't yet learned about DocBook, I d/led
the tarball of the pdf files and used pdftk to make one file of them.

Follow the guide above and Linus' advice in the README file. For the actual install
you have to be root (and can even use sudo), but none of the normal build should
require that. Don't take the name of root in vain.

You might not get a bootable kernel the first time, which is why you should follow
the advice in my guide about leaving your old kernel in place.

Another thing I do is add append="panic=15" to /etc/lilo.conf so that if I mess up and
get a kernel panic, the system will reboot itself after 15 seconds. If you think you'll
need more time to read the onscreen output, increase the time.

Building a custom kernel teaches one a lot about their system. There is so much
more included in the kernel than simple hardware support.


EDIT: Also, for your problem, make sure that /etc/rc.d/rc.scanluns is
executable. If not, issue "chmod +x /etc/rc.d/rc.scanluns" as root.

andrew.46 03-17-2008 09:06 PM

Thanks for the long post Bruce. I have just ordered the book you spoke of (Linux Kernel in a Nutshell) and I hope to 'roll my own' in my leave in April. Looking forward to it :-)

Andrew

rworkman 03-18-2008 01:43 AM

Quote:

Originally Posted by evilDagmar (Post 3090126)
There's an option in the kernel config (which Patrick had set off by default when I last looked) that makes most of these kinds of things go away. I've got a combination thumbdrive and sdcard reader that functions flawlessly once the kernel knows to probe for more than one LUN per device by default, without needing to run rc.scanluns.

Look under Device Drivers->SCSI Device Support for "Probe all LUNs on each SCSI device". Enabling that in a kernel should eliminate the need to run the scanluns script.

Unless something's changed, this makes some real scsi drives lock up.
That's why it's off in the stock kernels.

jukebox55 03-18-2008 12:38 PM

thanks Bruce, and thanks Robby for the additional info.

onebuck 03-19-2008 08:46 AM

Hi,
Quote:

Originally Posted by Bruce Hill (Post 3091986)
<snip>

Another thing I do is add append="panic=15" to /etc/lilo.conf so that if I mess up and
get a kernel panic, the system will reboot itself after 15 seconds. If you think you'll
need more time to read the onscreen output, increase the time.

Building a custom kernel teaches one a lot about their system. There is so much
more included in the kernel than simple hardware support.

Bruce, would it be better to place a 'addappend="panic=15" within the new stanza for the test/compiled kernel? I think the 'addappend' can be used more than once but for one image. Therefore you could place the 'addappend=' within a stanza. Since you will be creating a new stanza within the '/etc/lilo.conf' for the new kernel then your global would be left intact.


All times are GMT -5. The time now is 09:33 AM.