Does high sierra eject external USB drives upon logoff? I have both a USB hub that has a flash USB and an external USB drive. A family member often pulls it out without ejecting, and I'm trying to ease the effects of that. I put an AppleScript on the Desktop in hopes that they'll use it, and am now looking for auto-eject of both drives upon logoff. It's not foolproof, but better than nothing.

Does anyone have a good overall solution to this problem--and more specifically, can someone tell me if the drives are ejected upon logout?
This answer assumes by logoff/logout you're meaning the Log Out option under Apple > Log Out and not shutting down your Mac.

By default the behaviour of macOS High Sierra is to unmount all volumes except for the boot volume. 

However, if more than one user is logged in, then all volumes remain  mounted so that they're still available to the other users.

NOTE: The above behaviour is the same regardless of any network file sharing that is active. That is, if a user is connected to your Mac via file sharing (e.g. SMB etc) this does not change the default behaviour above. They would still be able to access the boot volume of your Mac (even if you're logged out) but they will no longer be able to access other volumes.



Shutting down

[This edit explains what happens if you shut down your Mac instead of logging out]

In all situations of a normal1 Mac shutdown any mounted drives will be unmounted/ejected and no longer available (assuming those drives are connected to that Mac in the first place).

This means that any:


internal drives (SSD or HDD) will be unmounted upon a shutdown
external drives connected directly to the Mac via USB/Firewire/Thunderbolt etc will be unmounted/ejected upon a shutdown
external drives connected directly to the Mac via a hub (e.g. a USB hub) will be unmounted/ejected upon a shutdown
external drives not connected directly to the Mac (i.e. they're being shared on a network by another device) will be unmounted from that Mac upon shutdown but are still available on the network to other devices that also access those volumes.


It's important to note, however, that just because a volume is unmounted/ejected doesn't necessarily mean that it's powered down. If the volume is USB powered (i.e. it is powered by its USB connection, not by another power source) then it will be powered off upon a shutdown. However, if it has its own power supply and/or is connected via a powered hub, the drive may remain powered up. If this is the case it still isn't accessible and also shouldn't pose any problems  - but nevertheless it's an important distinction to make.

1. By a 'normal' shutdown I mean you have shut down the computer normally (e.g. Apple > Shut Down) and not because of a power failure or forced shutdown. In the case of a power failure or forced shutdown any  mounted drive will still be unavailable (unless it's a network drive shared by another device) but it won't have gone through the proper unmount/eject procedure. In these instances it is possible for data loss or corruption, and in very rare cases for damage to the physical drive itself.