On Linux, it is possible to power off a USB device using command line. It’s perfect for my USB backup drive. I can power it off after backup every night, and power it on before the job starts. This saves power, reduce heat, and more importantly, prevent accidental or unexpected changes as the device is completely offline.

The command to turn off/on a USB device requires the USB address. To find it, I look for “Toshiba” in dmesg and 2-1 is the address.

Now I have the address, I can power off the device with the following command

To bring it back on

And when it’s powered on, the kernel reported the device as if it’s just plugged in:

Now if you run a Linux desktop like I do and you don’t want the system to automatically mount the drive under a generated path, simply add a “noauto” option to fstab and mount it in the backup script.

Leave a Comment