1

Other than right click the device and select eject (this is not unmount, because it completely delete the device in diskutil), and then replug the device, is there a way to do this via terminal?

For example, if I eject a USB Mass Storage device, it will be removed from diskutil list output. I can find it again via ioreg -p IOUSB -l -w 0 with output as such:

Mass Storage@1d160000  <class AppleUSBDevice, id 0x1000009d8, registered, matched, active, busy 0 (1 ms), retain 14>
    {
      "sessionID" = 8439571007835
      "iManufacturer" = 1
      "bNumConfigurations" = 1
      "idProduct" = 25479
      "bcdDevice" = 262
      "Bus Power Available" = 250
      "USB Address" = 2
      "bMaxPacketSize0" = 64
      "iProduct" = 2
      "iSerialNumber" = 3
      "bDeviceClass" = 0
      "Built-In" = No
      "locationID" = 487981056
      "bDeviceSubClass" = 0
      "bcdUSB" = 512
      "USB Product Name" = "Mass Storage"
      "PortNum" = 6
      "non-removable" = "no"
      "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
      "bDeviceProtocol" = 0
      "IOUserClientClass" = "IOUSBDeviceUserClientV2"
      "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=3,"CapabilityFlags"=65536,"MaxPowerState"=4,"DriverPowerState"=3}
      "kUSBCurrentConfiguration" = 1
      "Device Speed" = 2
      "USB Vendor Name" = "Generic"
      "idVendor" = 1423
      "IOGeneralInterest" = "IOCommand is not serializable"
      "USB Serial Number" = "29FEA949"
      "IOClassNameOverride" = "IOUSBDevice"
    }
2
  • Good question. I’m not sure anyone has tried to trace that eject code but if th end goal is something other than having a clean diskutil output, feel free to edit that in the post and ping @ me in this comment. – bmike May 5 '18 at 13:35
  • You can do the eject from terminal with diskutil eject /dev/disk3, but I guess your real question is how to detect it again without physically replugging the device? – wisbucky Aug 26 '19 at 23:18

You must log in to answer this question.

Browse other questions tagged .