The Dropped Connection
To maximize battery life on laptops, Ubuntu’s Linux kernel employs aggressive power management techniques. One of these features is USB autosuspend. If the operating system detects that a plugged-in USB device (like a mouse, an external hard drive, or a Wi-Fi dongle) has been idle for a few seconds, it will automatically cut the power to that specific USB port. While this saves battery, it is disastrous for devices that require a constant connection. A suspended USB Wi-Fi dongle will drop your internet connection, and a suspended external hard drive might corrupt data if it powers down in the middle of a delayed write operation.
Disabling Autosuspend
To ensure maximum hardware reliability and stop Ubuntu from automatically suspending power to your USB devices, you must modify the kernel boot parameters.
You need to tell the kernel to disable this feature globally during startup. Open your terminal (Ctrl+Alt+T). Type sudo nano /etc/default/grub and press Enter. Look for the line that starts with GRUB_CMDLINE_LINUX_DEFAULT=. It likely says something like "quiet splash". You need to append a new parameter inside those quotation marks. Carefully change the line to read: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1". The -1 value tells the USB core to never suspend devices. Press Ctrl+O to save, Enter to confirm, and Ctrl+X to exit the editor. Finally, you must apply the changes by running sudo update-grub. Restart your computer for the new power rules to take effect.