I always thought than an umount /dev/sdX# for all partitions on /dev/sdX was enough for USB devices to be ejected, but there are three commands that (on most systems) actually power down USB drives (or USB to SD card adapters):
udisks --detach /dev/sdX(requires theudiskspackage which is obsolete)eject /dev/sdXseems not to be enough on some systems; it is part of theutil-linuxpackageudisksctl power-off -b /dev/sdXis equivalent to theudiskscommand; it is part of theudisks2package.
These will ensure that the disk is not part of the fdisk --list output any more.
The opposite of these is sg_start, which is from the sg3_utils package.
Source: [WayBack] Eject USB drives / eject command – Unix & Linux Stack Exchange
On MacOS, you can use diskutil eject /Volumes/<LABEL> (source: answer by efesaid on [WayBack] Eject USB drives / eject command – Unix & Linux Stack Exchange)
–jeroen











A very insightful talk: “Marrying U-Boot, uEFI and grub2 – Alexander Graf – openSUSE…”
To solve the problem, we can just add another layer of abstraction (grub2) on top of another layer of abstraction (uEFI) on top of another layer of abstraction (u-boot). Follow me on a journey on how all those layers can make life easier for the distribution and how much fun uEFI really is.
Slides: [