How to Configure Power USB Ubuntu

By Scott Cimarusti

Most portable media devices sync data to a desktop or laptop computer via the USB port. The batteries in these devices can also be charged by that same powered USB connection. There may be situations, however, when you may need to change the default power settings of a particular USB port so the device connected to it does not interfere with the your computer's performance. For example, some types of devices connected to a computer's USB port can prevent the computer from going into its power-saving "sleep" mode. In Ubuntu Linux, there is a way to modify the power settings for the USB ports.

Step 1

Boot your computer and connect the desired devices to their respective USB ports.

Step 2

Navigate to the following directory: /sys/bus/usb/devices. Note the folders labeled "usbx," where "x" is a number.

Step 3

Double-click on one of these folder icons to open it.

Step 4

Double-click on the folder icon labeled "power." Note the files inside this directory named "autosuspend," "level" and "wakeup." Determine which of these setting files you need to edit for achieving the change in power settings you desire. For example, if you need to change the power settings on one of the USB ports so a device does not prevent the system from waking from suspend mode, the "wakeup" setting file may be the one.

Step 5

Open a terminal window by pressing the following keys simultaneously: "Ctrl," "Alt" and the letter "T."

Step 6

Type: "sudo gedit /sys/bus/usb/devices/usb#/power/setting_file," where "usb#" is the name of one of the directories described in step 1, and "setting_file" is the name of one of the files described in step 3. Enter your administrative password when prompted.

Step 7

Change the integer value of the "autosuspend" setting file, if desired. This value represents the number of seconds a device connected to that USB port should remain idle before it will be automatically suspended by the Linux kernel. A value of "0" will result in "autosuspend" as soon as the device is idle, and a value of "-1" will disable "autosuspend." Save the file after editing is completed by selecting "Save" from the "File" menu.

Step 8

Edit the text string value of the "level" setting file, if needed. The file will already consist of one of three text strings: "on," "auto" or "suspend." "On" means that the device connected to that USB port should be resumed and "autosuspend" is disabled. "Auto" is the normal state in which the Linux kernel is able to automatically suspend and resume the device connected to that USB port. "Suspend" means that the device connected to that USB port should remain suspended and "autoresume" is disabled. Save the file after editing is completed by selecting "Save" from the "File" menu.

Step 9

Edit the text string value of the "wakeup" setting file, if needed. If there is no value in this file, the device connected to that USB port does not support remote wakeup from suspend mode. Otherwise, the file will consist of one of two text strings: either "enabled" or "disabled." Each value will determine if remote wakeup will be enabled or disabled the next time the device connected to that USB port is suspended. Save the file after editing is completed by selecting "Save" from the "File" menu.

Tips & Warnings

  • Take note of the default settings for each of the three setting files described, in the event your modifications result in unintended consequences for the power settings of your computer or USB devices.