Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Kernels and mounting USB devices

  • 27-12-2004 10:04pm
    #1
    Closed Accounts Posts: 4,943 ✭✭✭


    Basically, i want to be able to mount my usb memory stick and my MP3 player (no drivers needed for this in windows, it acts as "mass storage") in linux. Whats the best way to go about this?

    I've tried a few guides, but couldn't get the damn things to work right. I keep coming up with things telling me to mount "sda1", but i have no sda1 on my install! Thats one problem i come up against. I also tried using the app "usb-mount" but couldn't get that to work, or if it was working, it gave no visible signs. However, if i run "lsusb" my devices do show up as being connected.

    Anyway, i fecked up my linux with all the messing around i was doing, and i decided to reinstall it. While on my search to get the USB devices mounted, i came across this . It seems to be recommending the 2.6.x kernel as opposed to the 2.4.x kernel, as the newer kernel has better hotplug support. Would the newer kernel make it easier to do this? Or should i stick with 2.4.X?

    Thanks.

    EDIT: I'm running Debian (Sarge)


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Might this article be of any help? It uses the 2.4.2 kernel as its reference one, though I suppose anything higher would work just as well...


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    In answer to your last question, when I plug in an MP3-layer/USB key it's automatically recognised and mounted to /mnt/removable (kernel 2.6.x on Mandrake 10).

    If you plug the device in before booting, does kudzu (or whatever) not detect it and ask you if you want to add it to fstab? Even if you don't say yes, it should tell you the device name (/dev/sdasomethingorother).

    Something like this might do the trick;
    su -c "/sbin/modprobe usb-storage; mount -t vfat /dev/sda /mnt/usb; /etc/rc.d/init.d/usb start; chmod -R 777 /mnt/usb"


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    Doodle, thats the exact article i linked in my first post. That didn't work for me. I don't think i have my linux install configured correctly to allow me to do what i need to do, but i don't know what i have to alter/install.

    The guides are telling me to: mount /dev/sda1, etc. But i can't do that. I don't have sda1, or sda2, or any sda's. I think part of the problem is i havn't loaded the usb-storage module, so how do i do that? And what other modules need to be loaded?

    The bottom of that guide tells you how to do it in kernel 2.6.x, and that made me think maybe 2.6.x was a better plan of action.


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Doodle, thats the exact article i linked in my first post.
    Ah, completely missed that. Damn "Blue" theme...


  • Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭Syth


    Doodle, thats the exact article i linked in my first post. That didn't work for me. I don't think i have my linux install configured correctly to allow me to do what i need to do, but i don't know what i have to alter/install.

    The guides are telling me to: mount /dev/sda1, etc. But i can't do that. I don't have sda1, or sda2, or any sda's. I think part of the problem is i havn't loaded the usb-storage module, so how do i do that? And what other modules need to be loaded?

    The bottom of that guide tells you how to do it in kernel 2.6.x, and that made me think maybe 2.6.x was a better plan of action.
    Try with /dev/sdb1, sdb2, sdc1 etc. It might have but it there, USB stuff is a bit of a pain. I'm sure there has to be some better way to do it.

    I've got my USB flash stick mounted, here's the contents of my lsmod:
    root@nayru:~# lsmod
    Module                  Size  Used by    Not tainted
    usb-storage            66176   1
    snd-pcm-oss            37736   0  (unused)
    snd-mixer-oss          12504   0  [snd-pcm-oss]
    usb-ohci               19240   0  (unused)
    ehci-hcd               17580   0  (unused)
    usbcore                59308   1  [usb-storage usb-ohci ehci-hcd]
    snd-intel8x0           18924   1
    snd-ac97-codec         49500   0  [snd-intel8x0]
    gameport                1420   0  [snd-intel8x0]
    snd-pcm                56072   1  [snd-pcm-oss snd-intel8x0]
    snd-timer              13604   0  [snd-pcm]
    snd-page-alloc          6328   0  [snd-intel8x0 snd-pcm]
    snd-mpu401-uart         3200   0  [snd-intel8x0]
    snd-rawmidi            12740   0  [snd-mpu401-uart]
    snd-seq-device          3888   0  [snd-rawmidi]
    snd                    30852   0  [snd-pcm-oss snd-mixer-oss snd-intel8x0 snd-ac97-codec snd-pcm snd-timer snd-mpu401-uart snd-rawmidi snd-seq-device]
    soundcore               3396   4  [snd]
    tulip                  40352   1
    crc32                   2880   0  [tulip]
    ohci1394               24112   0  (unused)
    ieee1394               42276   0  [ohci1394]
    pcmcia_core            39972   0
    ide-scsi                9328   0
    agpgart                43940   0  (unused)
    

    See if modprobing the relevant usb modules works.


  • Advertisement
  • Closed Accounts Posts: 4,763 ✭✭✭Fenster


    mount -t vfat /dev/sda1 /mnt/flash

    Never fails for me.


  • Registered Users, Registered Users 2 Posts: 1,419 ✭✭✭nadir


    no problems here either.

    basically you just need to compile the mass storage option in the kernel. I compile it as a module myself, i usually keep all my usb stuff modular.

    once thats done you can just mount /dev/sd** /mnt/whatever

    A simplified explanation of the workings is that the kernel module detects a usb device and assigns it a proc id, i.e /proc/bus/usb/NNN/NNN
    you can see this in the kernel log also. cat /var/log/messages or such.
    this then gets mapped as a device (scsi device) in /dev/sd**
    if it doesnt get mapped as a device you can try to trouble shoot it with the usbmodules application.
    usbmodules --device /proc/bus/usb/NNN/NNN
    but basically it should just work. If it still doesnt post up the relevant areas of you logs, i.e /var/log/kernel.log or if you use metalog /var/log/kernel/current


Advertisement