Page 1 of 2

USB Devices "Eject"

Posted: Mon Jan 25, 2016 3:37 pm
by jdupuis
Hi,

Would like to see right-click "Eject" on external USB devices as eject would wait for tasks to complete to inform that device is safe to remove. ( Yeah, I know, more GUI stuff )

Cheers!!

John

Re: USB Devices "Eject"

Posted: Mon Jan 25, 2016 3:54 pm
by samo79
+1 ;)

Re: USB Devices "Eject"

Posted: Tue Jan 26, 2016 12:13 am
by tonyw
Use the "DisMount" command?

(edit)
Sorry, that isn't going to work, another reference to the device will simply mount it again.
(/edit)

Re: USB Devices "Eject"

Posted: Tue Jan 26, 2016 3:40 am
by jdupuis
tonyw wrote:Use the "DisMount" command?

(edit)
Sorry, that isn't going to work, another reference to the device will simply mount it again.
(/edit)
Yes, "DisMount" works. So does the Eject Button in Media ToolBox. That being said, I thought it would be a nice shortcut to include in the Right-Click Menu when right clicking on the USB Thumbdrive or External USB HDD Icon instead of opening up Shell and such. It was just a thought. Thanks.

Cheers!!

Re: USB Devices "Eject"

Posted: Tue Jan 26, 2016 8:41 am
by thomasrapp
There are thousands of Eject programs on Aminet, just use one of them.

But Eject is by far not a "safe remove". It's the same as removing the drive, just programmaticaly. It does not wait for anything to finish.

Re: USB Devices "Eject"

Posted: Thu Jan 28, 2016 4:00 pm
by Belxjander
My own personal option is to stop all programs accessing the USB device, and then apply the "C:DiskChange" command to it ...before hot-removal

This usually forces the filesystem to flush caches and sync the USB device afaik

the only time I have run into errors with this was 3 identical USB sticks where only the serial numbers differed.

Re: USB Devices "Eject"

Posted: Thu Jan 28, 2016 4:40 pm
by salass00
Belxjander wrote:My own personal option is to stop all programs accessing the USB device, and then apply the "C:DiskChange" command to it ...before hot-removal

This usually forces the filesystem to flush caches and sync the USB device afaik
I don't recall exactly what DiskChange does but assuming it's just inhibit/uninhibit then it should do just that.

Dismount is better though if the filesystem supports it.

Re: USB Devices "Eject"

Posted: Fri Mar 04, 2016 2:11 pm
by Belxjander
salass00 wrote:
Belxjander wrote:My own personal option is to stop all programs accessing the USB device, and then apply the "C:DiskChange" command to it ...before hot-removal

This usually forces the filesystem to flush caches and sync the USB device afaik
I don't recall exactly what DiskChange does but assuming it's just inhibit/uninhibit then it should do just that.

Dismount is better though if the filesystem supports it.

Well this would mean that "C:DiskChange <DOSdriver>:" followed by "C:Dismount <DOSdriver>:" would work within an ARexx script
given usage of "ContextMenus" and "Workbench ARexx" features being present

Anyone want to give that idea a go? maybe throw it on os4depot.net or provide it as an OS ARexx script for just such a purpose?

Personally I need to deal with force-reloading the USB stack when a heartbeat fails as I run into breaking it often having many USB sticks only different by serial codes.

Re: USB Devices "Eject"

Posted: Thu Mar 10, 2016 3:01 am
by Daedalus
Belxjander wrote:Well this would mean that "C:DiskChange <DOSdriver>:" followed by "C:Dismount <DOSdriver>:" would work within an ARexx script
given usage of "ContextMenus" and "Workbench ARexx" features being present

Anyone want to give that idea a go? maybe throw it on os4depot.net or provide it as an OS ARexx script for just such a purpose?
I've just given it a go, and it doesn't work. Well, it sort of works, but the Dismount permanently dismounts the device, meaning that it won't mount again until you reboot. I tried using Dismount USB0:, which removed the device but even removing the drive and plugging it into a different USB socket wouldn't make it reappear. Doing a Dismount VolumeName: doesn't work, and using Dismount USB0: SOFT means that the drive simply remounts a couple of seconds later, similar to how Diskchange USB0: behaves.

It seems like it might need a custom little tool that disables a device until it's removed, then resets to normal. Anyone got any ideas of a simple way of achieving this?

Re: USB Devices "Eject"

Posted: Fri Mar 11, 2016 12:58 am
by Belxjander
Daedalus wrote:
Belxjander wrote:Well this would mean that "C:DiskChange <DOSdriver>:" followed by "C:Dismount <DOSdriver>:" would work within an ARexx script
given usage of "ContextMenus" and "Workbench ARexx" features being present

Anyone want to give that idea a go? maybe throw it on os4depot.net or provide it as an OS ARexx script for just such a purpose?
I've just given it a go, and it doesn't work. Well, it sort of works, but the Dismount permanently dismounts the device, meaning that it won't mount again until you reboot. I tried using Dismount USB0:, which removed the device but even removing the drive and plugging it into a different USB socket wouldn't make it reappear. Doing a Dismount VolumeName: doesn't work, and using Dismount USB0: SOFT means that the drive simply remounts a couple of seconds later, similar to how Diskchange USB0: behaves.

It seems like it might need a custom little tool that disables a device until it's removed, then resets to normal. Anyone got any ideas of a simple way of achieving this?
Then an Equivalent action to the Eject/Inject functionality shown in MediaToolbox for optical drives with commands to match?

This is already part of the trackdisk/scsi device driver specs from older OS versions... Can we reuse that for this USB functionality?