Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: USB drives switch off after a while

  1. #1
    Join Date
    Apr 2021
    Beans
    13

    Question USB drives switch off after a while

    Hello Ubuntu community.

    I recently switched to Ubuntu, but I have a bit of a problem. After a while, the USB drives switch off, and the kammara is no longer available either. T
    hat happens after a different amount of time, sometimes after 5 minutes and sometimes after a few hours after I have activated it. I looked it up on the internet, but I have not found a case where this problem occurred. Are there some settings to solve this? Does anyone have any idea?
    when I restart the laptop everything works for a while.
    I have a Lenovo E15 laptop.



    I wrote lsusb
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 003: ID 8087:0029 Intel Corp.
    Bus 003 Device 002: ID 06cb:00da Synaptics, Inc.
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    This is how it looks when the USB drives are switched off. When these are switched on, other devices appear.


    Certain folders do not appear in the path /sys/bus/usb/devices either.
    1-0:1.0 3-0:1.0 3-3:1.0 3-4:1.0 4-0:1.0 usb2 usb4
    2-0:1.0 3-3 3-4 3-4:1.1 usb1 usb3



    I have set /sys/bus/usb/devices/1-1/power/autosuspend to '-1'
    and /sys/bus/usb/devices/1-1/power/level to 'on'
    also /sys/bus/usb/devices/1-1/power/control to 'on'
    but these switch off anyway.
    Last edited by phile-mitti99; April 5th, 2021 at 01:35 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: USB drives switch off after a while

    Maybe hdparm can tell the drives to never spin down? Not all drive firmware and controllers support that, however.
    What happens on a non-laptop?
    Are the drives powered separately from the USB connection? I'd guess the laptop is going into power-saving mode if there. Try to power external spinning drives from dedicated plug power, not USB.

  3. #3
    Join Date
    Apr 2021
    Beans
    13

    Re: USB drives switch off after a while

    It does not depend on the battery level. I'm still not sure, how could you find out?

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: USB drives switch off after a while

    Quote Originally Posted by phile-mitti99 View Post
    It does not depend on the battery level. I'm still not sure, how could you find out?
    Laptops behave differently when on wall power and battery.
    External storage should always be plugged into wall power for best performance and to prevent spinning down - not get power from the laptop.
    I don't know how to say this clearer.

  5. #5
    Join Date
    Apr 2021
    Beans
    13

    Re: USB drives switch off after a while

    do you happen to know some commands to reduce power consumption?
    Last edited by phile-mitti99; April 5th, 2021 at 10:23 PM.

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: USB drives switch off after a while

    Quote Originally Posted by phile-mitti99 View Post
    do you happen to know some commands to reduce power consumption?
    hdparm has some options. The manpage for hdparm spells those out. Access it with man hdparm or use xman. Whenever doing things like this, it is critical to read the manpage for the commands. May want to search all manpages for "power" .... apropos power will search the command summaries in all manpages. That's very helpful when you don't know where to start, plus the manpages on you system ARE FOR the command versions ON YOUR SYSTEM, unlike google.

    If you want to reduce power use, unplug devices, turn down the screen brightness, and most importantly - PLUG IN ALL THE DEVICES TO THE WALL for power. You seem to ignore that statement. Perhaps you've already done everything suggested, but if you don't tell us what you are doing, how can we know?

  7. #7
    Join Date
    Apr 2021
    Beans
    5

    Re: USB drives switch off after a while

    Hello,

    I think that you may have better luck with smartctl then with hdparm.

    You can install it with
    sudo apt install smartmonotools
    sudo update-smart-drivedb

    Then you can view a list of drives with
    sudo smartctl --scan

    and view device info with
    sudo smartctl --xall /dev/sdb

    (replace /dev/sdb with the drive name from smartctl --scan).

    You can try disabling spinoff with
    sudo smartctl --set=apm,off /dev/sdb
    or
    sudo smartctl --set=apm,254 /dev/sdb
    (only one of them may do the trick).

    That said, I have two external hard drives from TOSHIBA, that turn off after some inactivity time no matter what I do. There simply is no way I have found to make them stop doing so. In the past, I have used a small shell script to periodically poll them and keep them awake.

    Edit: in case of these two TOSHIBA hard drives: the drives spin down after inactivity, but still are reachable. If they are accessed again, they simply spin up. The drives you describe seem to be inaccessible after spindown.

    When these are switched on, other devices appear.
    Please provide output of lsusb with these drives switched on.

    Edit: please also provide model name and number of these drives.
    Last edited by mat-jonczyk; April 6th, 2021 at 06:08 PM. Reason: added two blocks

  8. #8
    Join Date
    Apr 2021
    Beans
    13

    Re: USB drives switch off after a while

    Hey,

    I can try these commands,
    but when I do 'sudo smartctl --xall / dev / sdb'enter see' this directory was not found '.

  9. #9
    Join Date
    Apr 2021
    Beans
    5

    Re: USB drives switch off after a while

    There should be no spaces around the slash marks: "/"

    sudo smartctl --xall /dev/sdb

    not:

    sudo smartctl --xall / dev / sdb

  10. #10
    Join Date
    Apr 2021
    Beans
    13

    Re: USB drives switch off after a while

    Selection_012.png
    There is no space between the '/'. Shoud I create this folder?
    Last edited by phile-mitti99; April 6th, 2021 at 07:07 PM.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •