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

Pendrive problem

  • 23-04-2005 12:17am
    #1
    Closed Accounts Posts: 4,763 ✭✭✭


    I originally posted this on the [url=http://forums.gentoo.org/viewtopic-t-323724.htmlGentoo forums[/url], but nothing suggested has helped any.

    Essentially, I can't use any USB storage on my laptop, in Gentoo. I can use it perfectly fine in Fedora and Windows on my desktop and in Windows on my laptop. But not in Gentoo, Ho hum.

    If I try to mount a USB storage device, I get the below:
    mount: /dev/sda1 is not a valid block device
    

    First off, I've the mount set correctly in /etc/fstab:
    /dev/sda1		/mnt/flash	auto		user,rw,noauto,umask=077	0 0
    

    The usb device is correctly detected and set to /dev/sda1. Here's a snippet from dmesg:
    usb 1-3: USB disconnect, address 3
    usb 1-3: new high speed USB device using ehci_hcd and address 4
    usb 1-3: configuration #1 chosen from 2 choices
    scsi1 : SCSI emulation for USB Mass Storage devices
    usb-storage: device found at 4
    usb-storage: waiting for device to settle before scanning
      Vendor: Apple     Model: iPod              Rev: 2.70
      Type:   Direct-Access                      ANSI SCSI revision: 04
    SCSI device sda: 2032640 512-byte hdwr sectors (1041 MB)
    sda: assuming Write Enabled
    sda: assuming drive cache: write through
    SCSI device sda: 2032640 512-byte hdwr sectors (1041 MB)
    sda: assuming Write Enabled
    sda: assuming drive cache: write through
     sda: sda1
    Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
    Attached scsi generic sg0 at scsi1, channel 0, id 0, lun 0,  type 0
    usb-storage: device scan complete
    

    It was suggested that I check my USB kernel settings:
    CONFIG_BLK_DEV_IDEDISK=y
    CONFIG_IDEDISK_MULTI_MODE=y
    
    CONFIG_USB=y
    
    CONFIG_USB_DEVICEFS=y
    
    CONFIG_USB_ARCH_HAS_HCD=y
    CONFIG_USB_ARCH_HAS_OHCI=y
    
    [i](I know its advised that I only use one or the other, but I've problems without both enabled)[/i]
    
    CONFIG_USB_EHCI_HCD=y
    CONFIG_USB_OHCI_HCD=y
    
    CONFIG_USB_STORAGE=y
    CONFIG_USB_STORAGE_DEBUG=y
    
    CONFIG_USB_HID=y
    CONFIG_USB_HIDINPUT=y
    

    However, I don't ultimately feel this is a kernel problem. My USB mouse and printer both work perfectly fine. Its only /dev/sda that reports problems. I've tried 2.6.10 and 2.6.11 kernels, besides that.

    I created a custom udev rule in 10-local.rules, but it hasn't affected things one way or the other:
    BUS="usb", SYSFS{serial}="000A2700101B423A", KERNEL="sd?1", NAME="%k", SYMLINK="sda1"
    

    Lastly, both the hotplug and coldplug services are emerged and started.

    Most of the advice going around the net boils down to "recompile the kernel!", but its absolutely failed to help me out. :(


Comments

  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    Could you post the output of lsmod and uname -a ?

    I see you have both ohci (a USB1 driver) and ehci (a USB2 driver)
    compiled into the kernel. I've used both before, but they were both
    set up as modules. Maybe the issue is close to here.

    You also seem to have usb-storage compiled in rather than available as a module. This could well be breaking the hotplug scripts.

    Boot your gentoo system using your fedora kernel and see where that
    gets you. If that doesn't work, it's not likely to be the kernel.

    Make sure you have the (fedora):/lib/modules/fedora-kernel directory copied over to (gentoo):/lib/modules before you reboot, but it's simple enough to do.

    Your extra udev rule shouldn't be necessary, but you've been struggling
    with this longer than I have ;-)

    NiallB


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


    lsmod:
    fenster root # lsmod
    Module                  Size  Used by
    snd_pcm_oss            50080  0
    snd_mixer_oss          18944  1 snd_pcm_oss
    snd_seq_oss            36096  0
    snd_seq_midi_event      7168  1 snd_seq_oss
    snd_seq                53648  4 snd_seq_oss,snd_seq_midi_event
    snd_seq_device          8332  2 snd_seq_oss,snd_seq
    snd_atiixp             18272  2
    snd_ac97_codec         76536  1 snd_atiixp
    snd_pcm                85380  4 snd_pcm_oss,snd_atiixp,snd_ac97_codec
    snd_timer              22916  2 snd_seq,snd_pcm
    snd                    50660  12 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_atiixp,snd_ac97_codec,snd_pcm,snd_timer
    snd_page_alloc          8836  2 snd_atiixp,snd_pcm
    
    fenster root # uname -a
    Linux fenster 2.6.11-gentoo-r5 #18 SMP Sat Apr 16 00:22:26 IST 2005 i686 Mobile Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux
    

    I'll try the Fedora kernel as soon as I have a chance.


  • Technology & Internet Moderators Posts: 28,830 Mod ✭✭✭✭oscarBravo


    niallb wrote:
    You also seem to have usb-storage compiled in rather than available as a module. This could well be breaking the hotplug scripts.
    This rings a bell with me. I've had problems with things compiled in instead of modules - that would be my first port of call.


  • Registered Users, Registered Users 2 Posts: 71,159 ✭✭✭✭L1011


    oscarBravo wrote:
    This rings a bell with me. I've had problems with things compiled in instead of modules - that would be my first port of call.

    Monolithic breaks a lot of stuff - no sound and networking on my Macs without modules

    I'm using a totally monolithic here (on x86), including usb mass storage and sbp2, and hotplug works fine, but it varies wildly from system to system.


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


    I'll post kernel .config details in a bit, but I recompiled as advised (w/ USB Storage as a module). No change. :(


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    Yep, compile a nice modular kernel. The USB stuff HATES being part of the kernel seemingly (same with Bluetooth)


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


    yep same experience here,, modular is the only way to go.


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


    So should I compile USB support entirely as modular? I will add that I get nasty mouse problems when I do that.

    EDIT: I more or less compiled in all USB and SCSI entries as modules, no change. Below is my full ,config, relevant entries:
    # Loadable module support
    #
    CONFIG_MODULES=y
    CONFIG_MODULE_UNLOAD=y
    # CONFIG_MODULE_FORCE_UNLOAD is not set
    CONFIG_OBSOLETE_MODPARM=y
    # CONFIG_MODVERSIONS is not set
    # CONFIG_MODULE_SRCVERSION_ALL is not set
    CONFIG_KMOD=y
    CONFIG_STOP_MACHINE=y
    
    
    #
    # SCSI device support
    #
    CONFIG_SCSI=m
    CONFIG_SCSI_PROC_FS=y
    
    #
    # SCSI support type (disk, tape, CD-ROM)
    #
    CONFIG_BLK_DEV_SD=m
    # CONFIG_CHR_DEV_ST is not set
    # CONFIG_CHR_DEV_OSST is not set
    # CONFIG_BLK_DEV_SR is not set
    CONFIG_CHR_DEV_SG=m
    
    #
    # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
    #
    CONFIG_SCSI_MULTI_LUN=y
    # CONFIG_SCSI_CONSTANTS is not set
    # CONFIG_SCSI_LOGGING is not set
    
    #
    # USB support
    #
    CONFIG_USB=y
    # CONFIG_USB_DEBUG is not set
    
    #
    # Miscellaneous USB options
    #
    CONFIG_USB_DEVICEFS=y
    # CONFIG_USB_BANDWIDTH is not set
    # CONFIG_USB_DYNAMIC_MINORS is not set
    # CONFIG_USB_SUSPEND is not set
    # CONFIG_USB_OTG is not set
    CONFIG_USB_ARCH_HAS_HCD=y
    CONFIG_USB_ARCH_HAS_OHCI=y
    
    #
    # USB Host Controller Drivers
    #
    CONFIG_USB_EHCI_HCD=m
    # CONFIG_USB_EHCI_SPLIT_ISO is not set
    # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
    CONFIG_USB_OHCI_HCD=m
    CONFIG_USB_UHCI_HCD=m
    # CONFIG_USB_SL811_HCD is not set
    
    #
    # USB Device Class drivers
    #
    # CONFIG_USB_AUDIO is not set
    # CONFIG_USB_BLUETOOTH_TTY is not set
    # CONFIG_USB_MIDI is not set
    # CONFIG_USB_ACM is not set
    CONFIG_USB_PRINTER=y
    
    #
    # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
    #
    CONFIG_USB_STORAGE=m
    CONFIG_USB_STORAGE_DEBUG=y
    CONFIG_USB_STORAGE_RW_DETECT=y
    CONFIG_USB_STORAGE_DATAFAB=y
    CONFIG_USB_STORAGE_FREECOM=y
    CONFIG_USB_STORAGE_ISD200=y
    CONFIG_USB_STORAGE_DPCM=y
    CONFIG_USB_STORAGE_HP8200e=y
    CONFIG_USB_STORAGE_SDDR09=y
    CONFIG_USB_STORAGE_SDDR55=y
    CONFIG_USB_STORAGE_JUMPSHOT=y
    
    #
    # USB Input Devices
    #
    CONFIG_USB_HID=m
    CONFIG_USB_HIDINPUT=y
    # CONFIG_HID_FF is not set
    # CONFIG_USB_HIDDEV is not set
    
    #
    # USB HID Boot Protocol drivers
    #
    # CONFIG_USB_KBD is not set
    # CONFIG_USB_MOUSE is not set
    # CONFIG_USB_AIPTEK is not set
    # CONFIG_USB_WACOM is not set
    # CONFIG_USB_KBTAB is not set
    # CONFIG_USB_POWERMATE is not set
    # CONFIG_USB_MTOUCH is not set
    CONFIG_USB_EGALAX=m
    # CONFIG_USB_XPAD is not set
    # CONFIG_USB_ATI_REMOTE is not set
    
    #
    # USB Imaging devices
    #
    # CONFIG_USB_MDC800 is not set
    # CONFIG_USB_MICROTEK is not set
    
    #
    # USB Multimedia devices
    #
    # CONFIG_USB_DABUSB is not set
    


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    Compile all of the USB Storage as modules.


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


    sjones wrote:
    Compile all of the USB Storage as modules.

    It won't allow me to compile them as modules.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    sjones wrote:
    Compile all of the USB Storage as modules.

    That shouldn't make so much of a difference once storage itself
    is a module.

    I'll suggest again to boot gentoo with the fedora kernel
    to see the problem with a known good kernel.
    No point recompiling your kernel again and again
    if the problem is elsewhere. If the fedora kernel
    works with the gentoo scripts, then use its .config
    as a starting point for your gentoo build.

    Does your motherboard support booting from a USB attached device?

    Is there any difference in behaviour when you
    boot with the device already attached (i.e. using coldswap
    rather than hotswap)

    NiallB


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


    niallb wrote:
    That shouldn't make so much of a difference once storage itself
    is a module.

    I'll suggest again to boot gentoo with the fedora kernel
    to see the problem with a known good kernel.
    No point recompiling your kernel again and again
    if the problem is elsewhere. If the fedora kernel
    works with the gentoo scripts, then use its .config
    as a starting point for your gentoo build.

    Does your motherboard support booting from a USB attached device?

    Is there any difference in behaviour when youe, I
    boot with the device already attached (i.e. using coldswap
    rather than hotswap)

    NiallB

    Aye, I was going to mention coldplug. It mentions an unexpected filesystem encountered on /dev/sda1. However, I tried formatting it with both fdisk within Linux and natively within Windows as well.
    fenster root # fdisk -l /dev/sda
    
    Disk /dev/sda: 1040 MB, 1040711680 bytes
    128 heads, 40 sectors/track, 397 cylinders
    Units = cylinders of 5120 * 512 = 2621440 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1         397     1016300    b  W95 FAT32
    

    I'll try the native .config later, although it will probably take some doing to do.


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


    I'm trying the Fedora kernel now-I'm getting a kernel panic as my desktop is ext3 and my laptop is reiser. Lemme guess, I gotta recompile? :p


  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    Nope, you need to also use the initrd from fedora.
    It'll have the reiser module on it.

    Are you using grub or lilo?
    Slightly different approaches for the two.

    NiallB


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


    niallb wrote:
    Nope, you need to also use the initrd from fedora.
    It'll have the reiser module on it.

    Are you using grub or lilo?
    Slightly different approaches for the two.

    NiallB

    I copied the initrd also. I also use grub and copied the grub.conf entries over, although changed them for Gentoo:
    default 2
    timeout 5
    splashimage=(hd0,1)/grub/splash.xpm.gz
    
    #title=Gentoo Linux 2.6.11-gentoo-r5
    #root (hd0,1)
    #kernel /kernel-2.6.11-gentoo-r5 root=/dev/hda4
    
    title=Windows 2000
    rootnoverify (hd0,0)
    makeactive
    chainloader  +1
    
    title=Gentoo Linux 2.6.11-gentoo-r5
    root (hd0,1)
    kernel /kernel-2.6.11-gentoo-test3 root=/dev/hda4 
    
    title=Gentoo test2
    root (hd0,1)
    kernel /kernel-2.6.11-gentoo-test2  root=/dev/hda4
    
    title=Fedora Kernel (2.6.10)
    root(hd0,1)
    kernel /vmlinuz-2.6.10-1.770_FC3 root=/dev/hda4
    initrd /initrd-2.6.10-1.770_FC3.img
    


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


    Still no change :(


  • Registered Users, Registered Users 2 Posts: 1,496 ✭✭✭jlang


    Can't remember the exact circumstances, but I had a case of a USB drive not mounting properly because it had a file on it with Chinese characters in the filename. Deleted the file on a Windows box and it mounted fine back in Linux.


  • Registered Users, Registered Users 2 Posts: 549 ✭✭✭declan_lgs


    I haven't really used the 2.6 kernel much (2.4 instead), but have you tried (is this a bad idea?) mknod'in a /dev/sda + /dev/sda1 device, and checking the permissions?

    I remember it took me a while to get my iPod working in linux, finally got it working by scanning the SCSI bus with this script (thanks to http://www.cs.duke.edu/~geha/ipod/). Probably different in a 2.6 kernel though.


  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    I think I've managed to duplicate your problem.

    When/If I get it fixed, I'll let you know :-)

    NiallB


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


    Well the script certainly detected the pen drive, but it didn't change anything, alas.
    Host adapter 0 (usb-storage) found.
    Scanning hosts  0 channels 0 for 
     SCSI target IDs  0 1 2 3 4 5 6 7 , LUNs  0
    Scanning for device 0 0 0 0 ...
    OLD: Host: scsi0 Channel: 00 Id: 00 Lun: 00
          Vendor: Apple    Model: iPod             Rev: 2.70
          Type:   Direct-Access                    ANSI SCSI revision: 04
    

    I give up, I think.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    jlang wrote:
    Can't remember the exact circumstances, but I had a case of a USB drive not mounting properly because it had a file on it with Chinese characters in the filename. Deleted the file on a Windows box and it mounted fine back in Linux.

    Most likely your vfat module didn't have the correct code page compiled in. FAT32 doesn't use unicode.


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


    niallb wrote:
    I think I've managed to duplicate your problem.

    When/If I get it fixed, I'll let you know :-)

    NiallB

    Argh, did you find anything, the suspense is killing me! :p


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


    Threade of olde, arise from thy grave...

    I'm starting to be convinced that this isn't a kernel-related problem. I'm installing Gentoo on my desktop, out of the sake of putting a spare HD to use. Out of curiousity I used identical USB and SCSI settings as on my laptop, with the same kernel. Lo and behold, all USB devices work, flash drive included.

    Verbose feedback in dmesg, on my laptop, is reporting that the flash drive has bad blocks-I'll edit in the whole message after I get home. It could be hot or coldplug on my laptop are causing this problem.


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    Hmm that is interesting, lets keep this thread alive.


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


    Forgot to post dmesg last night, here it is:
    Linux version 2.6.11-gentoo-r5 (root@fenster) (gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)) #8 SMP Sun May 8 23:28:40 IST 2005
    
    ...
    
    usb 1-3: new high speed USB device using ehci_hcd and address 3
    usb 1-3: configuration #1 chosen from 2 choices
    scsi0 : SCSI emulation for USB Mass Storage devices
    usb-storage: device found at 3
    usb-storage: waiting for device to settle before scanning
      Vendor: Apple     Model: iPod              Rev: 2.70
      Type:   Direct-Access                      ANSI SCSI revision: 04
    SCSI device sda: 2032640 512-byte hdwr sectors (1041 MB)
    sda: assuming Write Enabled
    sda: assuming drive cache: write through
    SCSI device sda: 2032640 512-byte hdwr sectors (1041 MB)
    sda: assuming Write Enabled
    sda: assuming drive cache: write through
     sda: sda1
    Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
    Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
    usb-storage: device scan complete
    


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


    Fixed.

    At long last, fixed. I spent a few hours this evening on the problem. I finally did emege-sync and recompiled the latest kernel (using my desktop's config as a base) and usb utils from scratch. Works fine now.

    Huzzah!


Advertisement