USB handling differences? [Solved]

If you want to talk about your personal paperweight, you've found the right place!

Moderator: Moderators

Post Reply
viking
Growing Hen
Posts: 182
Joined: Tue Dec 12, 2006 11:34
Location: uk stoke on trent

USB handling differences? [Solved]

Post by viking » Mon Oct 20, 2014 16:18

I put this in off topic because it is not really a support question just a request for information if anyone knows the answer, but feel free to move it to hardware if you think it more appropriate there.

I mentioned recently in another post that I just installed an SSD in my laptop. Obviously this left me with a spare drive which seemed a shame to waste as it is still in good condition, so I bought a cheap USB3 to sata drive enclosure to put the old drive into with a view to using it as a backup device.

Testing this today I got strange results. In Sabayon and Manjaro, coincidentally or perhaps not I don't know, both systemd distros, the device was not recognised when plugged into a USB3 port. I tried several different ports, and in every case the power light came on and I could hear the disk rotating, but the device partitions would not show up in Thunar, and any attempt to make them show up, for instance by refreshing the Thunar home page resulted in an instant system crash to a black screen loaded with 'fffffff' type memory addresses (on both distros).

But in both Ubuntu and Mint (neither of which use systemd) the device worked normally plugged into the same USB sockets, I could mount and use the partitions on the disk without any failures at all.

That is strange enough, but even more perplexing is that when I tried the device in a USB2 socket with Sabayon, it worked normally :?:

So what could be causing this? Does systemd have anything to do with USB handling or is that way off track? Why does USB2 work when USB3 wont - it is a USB3 device after all?

The device is not independently powered, so is there some difference in power output between USB2 and USB3? But if that is the case why would it work normally on Ubuntu and Mint but not Manjaro and Sabayon?
Last edited by viking on Wed Oct 22, 2014 11:46, edited 1 time in total.
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, Sabayon, all Xfce4 desktops.

svantoviit
Old Dear Hen
Posts: 730
Joined: Sun Feb 28, 2010 17:55
Contact:

Re: USB handling differences?

Post by svantoviit » Tue Oct 21, 2014 13:40

viking wrote:…the device was not recognised when plugged into a USB3 port.
You mean probably, that it wasn't mounted automatically.

You have to check with dmsg or journalctl ev. lsusb.
Another useful commands are mount or fdisk in this case.

viking
Growing Hen
Posts: 182
Joined: Tue Dec 12, 2006 11:34
Location: uk stoke on trent

Re: USB handling differences?

Post by viking » Tue Oct 21, 2014 14:14

svantoviit, you are single handedly giving me so much assistance that I am embarrassed to disagree with you, but I must.

I consider automounting of usb devices to be the work of the devil, and do my level best to disable it everywhere I can - an increasingly difficult battle as it happens - so no, automounting is not what I am referring to, I am referring to the disk being seen at all, by anything, including the kernel.

The situation is slightly worse than I stated in my previous post, I initially thought that it was an action such as refreshing the Thunar page that made the machine crash, but it isn't that. If you plug the drive into a USB3 slot and then completely leave the machine alone it will crash within 30 seconds or so - Manjaro does the same. This doesn't give you much time for experimentation with any command, so it is impossible to investigate your suggestions, I am also not very happy about having the machine crash so often, it isn't good for the external or internal disk, so I fear I will have to use the USB2 slot or use one of my debian based distros when I want to access this new device.

But thank you for replying.
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, Sabayon, all Xfce4 desktops.

viking
Growing Hen
Posts: 182
Joined: Tue Dec 12, 2006 11:34
Location: uk stoke on trent

Re: USB handling differences? [Solved]

Post by viking » Wed Oct 22, 2014 11:50

I solved my own problem. It isn't systemd but a kernel problem.

When I installed and booted the 3.13.11 kernel (the same kernel version used by Ubuntu and Mint) the device is properly recognised and configured and fully usable. When I go back to the 3.16 kernel it fails and causes a near instant crash.

So my guess is that there has been some change in between the two kernels (my guess is irq handling) that makes the device unusable on kernel 3.16.

I see 3.17 is available now so I will try that and see if that works.
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, Sabayon, all Xfce4 desktops.

viking
Growing Hen
Posts: 182
Joined: Tue Dec 12, 2006 11:34
Location: uk stoke on trent

Re: USB handling differences? [Solved]

Post by viking » Wed Oct 22, 2014 12:09

No, the 3.17 kernel is affected as well, so I think I will just stick with the 3.13 one for now, I can see no advantages in the later ones only problems. I will keep 3.17 around as a backup but boot 3.13 as default.
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, Sabayon, all Xfce4 desktops.

viking
Growing Hen
Posts: 182
Joined: Tue Dec 12, 2006 11:34
Location: uk stoke on trent

Re: USB handling differences? [Solved]

Post by viking » Thu Oct 23, 2014 13:36

I found a better solution to this on the Arch forum (better because it allows you to keep running the up to date kernel). It works in Manjaro, but the technique is not exactly transferable to Sabayon due to differences in handling. This is the technique I used in Manjaro:

Code: Select all

 First obtain the Vendor and Product ID of the misbehaving device using lsusb, then

touch /etc/modprobe.d/ignore_uas.conf

leafpad /etc/modprobe.d/ignore_uas.conf

Add the line:

options usb-storage quirks=Vendor_ID:Product_ID:u

Substituting the Vendor and Product ID you noted earlier.

In a root terminal cd to /boot and run:


mv initramfs-316-x86_64.img  initramfs-316-x86_64.img.old

Then in the same terminal run:


mkinitcpio -g initramfs-316-x86_64.img
It is all doable in Sabayon right up until the last line, but Sabayon has no command 'mkinitcpio'. I understand that the equivalent would be

Code: Select all

genkernel initramfs
But running this gives me the following errors

Code: Select all

genkernel initramfs
* Gentoo Linux Genkernel; Version 58
* Running with options: initramfs

* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

* Linux Kernel 3.17.0-sabayon for x86_64...
* .. with config file /usr/share/genkernel/arch/x86_64/kernel-config
* busybox: >> Applying patches...
*           - 1.18.1-openvt.diff
*           - busybox-1.20.1-strict-atime.patch
*           - busybox-1.20.2-glibc-sys-resource.patch
*           - busybox-1.7.4-signal-hack.patch
* busybox: >> Configuring...
* ERROR: Failed to compile the "oldconfig" target...
* 
* -- Grepping log... --
* 
*           - busybox-1.7.4-signal-hack.patch
* busybox: >> Configuring...
*COMMAND: make -j2 CC="gcc" LD="ld" AS="as"  
*  HOSTCC  scripts/basic/fixdep
*/bin/sh: gcc: command not found
*scripts/Makefile.host:104: recipe for target 'scripts/basic/fixdep' failed
*make[1]: *** [scripts/basic/fixdep] Error 127
*Makefile:356: recipe for target 'scripts_basic' failed
*make: *** [scripts_basic] Error 2
Can anyone tell me what to do about them or suggest another technique to recompile the initramfs?

BTW the error is something to do with 'uas' or 'usb attached scsi' and it is know to the kernel developers.
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, Sabayon, all Xfce4 desktops.

viking
Growing Hen
Posts: 182
Joined: Tue Dec 12, 2006 11:34
Location: uk stoke on trent

Re: USB handling differences? [Solved]

Post by viking » Thu Oct 23, 2014 17:16

Well the answer to the above question is fairly simple. Compiling goes a lot more smoothly if you have a compiler installed (gcc).

However this technique does not seem to work on Sabayon even with a recompiled initramfs, the reasons for that are beyond my level of understanding.

Shame though, it is a very neat workround on Manjaro.
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, Sabayon, all Xfce4 desktops.

viking
Growing Hen
Posts: 182
Joined: Tue Dec 12, 2006 11:34
Location: uk stoke on trent

Re: USB handling differences? [Solved]

Post by viking » Thu Oct 23, 2014 17:52

Correction to my last post, the answer is not beyond my level of understanding, it is simply that in Manjaro the usb_storage module is loaded through modprobe whereas in Sabayon it is built in to the kernel. Therefore trying to influence it through 'modprobe.d' is futile. How to influence it as a builtin, I have no idea, I could recompile the entire kernel to remove its builtin status, but that is really a sledgehammer to crack a nut, it is not worth the effort.

Run out of ideas now.
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, Sabayon, all Xfce4 desktops.

User avatar
Fitzcarraldo
Sagely Hen
Posts: 8116
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: USB handling differences? [Solved]

Post by Fitzcarraldo » Fri Oct 24, 2014 7:48

Ah, but you can pass parameters to drivers that are built-in to the kernel rather than built as kernel modules. See, for examples, my posts Re: Request for advice on making a Media Centre and Would a quirk do it?. So, in order to experiment, you could first edit /boot/grub/grub.cfg and add what is known as a kernel quirk 'usb-storage.quirks=Vendor_ID:Product_ID:u' to the end of the kernel boot line. If that works, you can add it 'properly' by adding it to /etc/default/sabayon-grub and running the command 'grub2-mkconfig -o /boot/grub/grub.cfg'.

viking
Growing Hen
Posts: 182
Joined: Tue Dec 12, 2006 11:34
Location: uk stoke on trent

Re: USB handling differences? [Solved]

Post by viking » Fri Oct 24, 2014 10:40

Hey man that solution works perfectly!! Thank you so much :D
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, Sabayon, all Xfce4 desktops.

Post Reply