Solved USB Eject

What is the proper way to eject an USB memstick?
When it is a data stick I would mount it, then unmount using umount.

Problem is when I write a disk image with dd to da0 I never mount the device.
So umount does not work. If i manually mount it after image burn then eject it works fine.

But in both cases the LED on the memstick stays lit, While on Windows on eject the LED turns off.

I am a firm believer in proper device eject so I usually shutdown the machine.
Today I am compiling a new Turbot kernel via SSH and don't wanna shutdown.

How do I power down the USB stick after filesystem eject?
 
Code:
root@Testing:~ # usbconfig list
ugen0.1: <Intel EHCI root HUB> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.1: <Intel EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <vendor 0x8087 product 0x0024> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <vendor 0x8087 product 0x0024> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.3: <Sierra Wireless, Incorporated MC7354> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen1.4: <Broadcom Corp 5880> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen1.5: <USB007 USB Mass Storage Device> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (98mA)
root@Testing:~ # usbconfig -u 1 -a 5 power_off
 
If you don't mount it (possibly automatically), you don't need to unmount it.
It's not always about unmounting. I just realized, that my Kindle cannot be used when plugged in my FreeBSD laptop: it literally tells that if I want to use, it has to be ejected (although not mounted). Its Linux configures it as USB storage when plugged in, and its screen gets locked.
I found this old thread, and camcontrol(8) indeed works: camcontrol eject /dev/da0.
The device still gets USB power, i.e. what I need sometimes.
 
I had the same problem and using usbconfig -u 0 -a 10 power_off disconnected my Kindle after transferring some files. So it can go on charging at the same time I keep accessing it screen. Real deal!
 
It's not always about unmounting. I just realized, that my Kindle cannot be used when plugged in my FreeBSD laptop: it literally tells that if I want to use, it has to be ejected (although not mounted). Its Linux configures it as USB storage when plugged in, and its screen gets locked.
I found this old thread, and camcontrol(8) indeed works: camcontrol eject /dev/da0.
The device still gets USB power, i.e. what I need sometimes.

Ok, but it didn't work until I entered the command usbconfig power_off ...

$ doas mount_msdosfs /dev/da2 /media/kindle
$ mount

Code:
...
/dev/da2 on /media/kindle (msdosfs, local)
$ doas camcontrol eject /dev/da2
Code:
 Unit stopped successfully, Media ejected

Sure, it stopped but no eject. kindle screen remains blocked with that charging battery icon!

$ doas usbconfig list
Code:
...
ugen0.10: <vendor 0x1949 Internal Storage> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
$ doas usbconfig -u 0 -a 10 power_off
Now the kindle main screen shows up!
 
Back
Top