When I charge my GoPro with a wall-charger I'm able to still use it and take photos, but when I connect it to my Linux computer I can't. I want to be able to programmatically control how my computer is connected to this device. So I can charge it and switch to the storage connection mode to manage files on it.

Is it possible to only charge the device, so it won't know it's connected to the computer?


By default, a connected USB device capable of mass storage will be treated as a storage device (with associated /dev entry, etc). Cameras (and e-readers, and assorted other devices) treat being connected using the mass storage protocol as an "unusable" state, since you could be writing to device storage from the computer at the same time as the drive is in use by the device. Some other operating systems don't connect to storage devices by default in this way, so the interface on the device is often misleading about what's happening.

To work around this, you can eject the storage device. When you do, it will stop being connected as a mass storage device, but retain its power supply. Something like:

sudo eject /dev/sdb

(for the appropriate device name) will do what you want. On a Mac, the drag-to-trash or right-click-eject options should do the same.

If the device supports other protocols as well (HID, video), those aren't affected by the ejection. Only the storage device disappears.

  • Thanks for your response. I've tried ejecting the camera on a Mac, but the GoPro still states it's connected, could this be because of other protocols? Is there a way to see what other protocols there are? And will I be able to terminate them all? – Tim Baas Aug 6 '14 at 10:37
  • I don't have your particular device to test with, but I've just tried the ones I do have on a Mac and right-click/drag-to-trash eject has worked, so I don't know what else there would be to do for you. The other protocols are things like audio and video capture - those don't usually get in the way. – Michael Homer Aug 6 '14 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.