1

My laptop has a very small internal SSD so I have move /home to my SDXC card. I have the fstab set up as below. It works fine for awhile when I first boot up, but then it loses the mount and cant get it back.

I've tried all sorts of things from the web. I even turned off usb automount thinking maybe it was interfering, but no luck.

Im wondering if it is disabling the USB hub the SDXC communicates through over time. Any good suggestions on how to tell Ubuntu 18.04 nto to ever turn off USB or disconnect external drives?

   # /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p6 during installation
UUID=e7980c7d-441b-4814-a0cc-74ac44139f12 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p2 during installation
UUID=E018-1B48  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
UUID=62f48898-00de-40c1-842d-6623583219c4   /home   ext4     errors=remount-ro 0       2

UPDATE: Tried this,

https://hamwaves.com/usb.autosuspend/en/

I got stalled at the first step... This is the card's lsusb entry

Bus 002 Device 010: ID 045e:090c Microsoft Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x045e Microsoft Corp.
  idProduct          0x090c 
  bcdDevice           29.10
  iManufacturer           1 Microsoft
  iProduct                2 SD Card
  iSerial                 3 201408282030
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           44
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 CARD READER
:

And this is my usb /devices dir

1-0:1.0  1-1.4:1.0  1-4.1:1.0  1-6:1.0  2-1:1.0    2-1.3:1.0  2-4.1:1.0  usb2
1-1  1-4        1-4.3      1-6:1.1  2-1.2      2-4        2-4.2
1-1:1.0  1-4.1      1-4.3:1.0  2-0:1.0  2-1.2:1.0  2-4.1      2-4.2:1.0
1-1.4    1-4:1.0    1-6        2-1  2-1.3      2-4:1.0    usb1

I did a recursive grep and the product id 0x090c and its not in any of those files?

2ND UPDATE: grep -r 090c (no 0x) found the file and then these instructions seem to have fixed my issue!

3rD UPDATE: Half-way there. It doesnt drop when I disconnect power any more, but it still seemingly randomly drops during use :/

4th Update: removing tlp allowed this solution to set the control parameters to on reliably.... but it still drops the volume

8
  • It appears that one way to trigger it dropping the card reliably is to disconnect the power, even for a moment Commented Apr 13, 2019 at 2:25
  • It's probably the autosuspence feature of USB. Here is how to disable ...hamwaves.com/usb.autosuspend/en Commented Apr 13, 2019 at 7:04
  • So, I got stalled at the first step... this is the card's lsusb entry Commented Apr 13, 2019 at 16:24
  • Looks like there is /sys/bus/usb/devices/usb2/, and also, grep for 045e/090c without 0x. Commented Apr 13, 2019 at 16:46
  • Thanks, ill try that if I still have problems. I installed tlp and set the USB_BLACKLIST and that seems to be workign so far Commented Apr 13, 2019 at 17:14

1 Answer 1

1

Okay.

FIRST make sure you aren't running TLP or any other power management add on. While there is theoretically a way to make TLP leave the USB devices alone, I couldn't make it work.

Then, this solution works: https://hamwaves.com/usb.autosuspend/en/

Note that your device control file may not be in the place this article says it is. You don't need that to use the permanent solution but you do need it to test that its working. In my case it was actually in 3 separate places in the /sys/bus/usb file tree (/sys/bus/usb/devices/usb2/2-1/2-1.3/power/control, /sys/bus/usb/devices/2-1/2-1.3/power/control and /sys/bus/usb/devices/2-1.3/power/control).

I found them by recursive grepping for the idProduct without the leading 0x (eg 090c NOT 0x090c). The command was "grep -r 090c *" executed in the /sys/bus/usb directory.

I had to set power/control to on as well as power/autosuspend and power/autosuspend_delay_ms to -1. And I had to do this for both the SD card device and my usb hubs.

This is what my rules file looks like:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="090c", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="090c", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="090c", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="091a", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="091a", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="091a", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="090b", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="090b", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="090b", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"

Finally I had to turn automount back on (I had turned it off) because my machine still seems to drop the connection occasionally but with automount it seems to come right back.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .