Mounted USB External Drive Automatically Suspending When idle

Hi everyone!

I have an external USB HDD mounted in my /etc/fstab. I use that external drive daily. For some reason, whenever my computer goes idle Linux is unmounting that HDD. This is a pretty big problem, because I use a service that stores data in it from time to time and, sometimes, when it tries to do during night (when I’m sleeping) it simply can’t since the driver is not mounted anymore.

During day, while I’m using the computer, the driver is mounted as expected. But, as soon as I leave my chair for a few minutes, when I go back to the computer the driver is not mounted anymore.

I’m using Gnome DE and I’ve already changed the Power > Automatic Suspend settings to Off.

Also, I’ve changed the /sys/bus/usb/devices/usb4/4-3/power/control from auto to on

I’ve also tried to change my /etc/udev/rules.d/50-usb_power_save.rules file to the following:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bc2", ATTR{idProduct}=="231a", TEST=="power/control", GOTO="power_usb_rules_end"

ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="auto"
LABEL="power_usb_rules_end"

And my /etc/udev/rules.d/usb-power.rules to the following:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bc2", ATTR{idProduct}=="231a", TEST=="power/control", ATTR{power/control}="on"

But it seems that none of those approaches worked.

Hello,
Check TLP settings. You can use tlpui as a GTK+ user interface for it …

1 Like

Disabling USB autosuspend might work as well:

In GRUB add to cmdline:
usbcore.autosuspend=-1

then update grub and reboot

to check:
cat /sys/module/usbcore/parameters/autosuspend
should return -1
default was 2

After suspending the disk automatically with TLP, does it really also unmount the drive? I would assume that it should remount the drive when it’s accessed. Otherwise, what’s the point?