USB Devices "Eject"

AmigaOS users can make feature requests in this forum.
User avatar
jdupuis
Posts: 223
Joined: Sat May 09, 2015 7:19 am
Location: Baton Rouge, Louisiana USA

USB Devices "Eject"

Post 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
C= A500 2 megs RAM with A590 w/40 MB SCSI HD and Workbench 1.3
C= A3000 25 MHz with Workbench 3.1
AmigaOne X1000 4 GB RAM, XFX Radeon HD 6670 1GB GDDR5 GPU and AmigaOS 4.1 FE/Ubuntu 12.04.5 LTS/Ubuntu Mate 16.04 LTS
Sam460ex 2GB DDR2 800 MHz RAM, XFX Radeon HD 5450 2GB GDDR3 GPU, 3114 SATA Raid, ENVY24HT sound card and AmigaOS 4.1 FE
User avatar
samo79
Posts: 572
Joined: Fri Jun 17, 2011 11:13 pm
Location: Italy

Re: USB Devices "Eject"

Post by samo79 »

+1 ;)
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: USB Devices "Eject"

Post 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)
cheers
tony
User avatar
jdupuis
Posts: 223
Joined: Sat May 09, 2015 7:19 am
Location: Baton Rouge, Louisiana USA

Re: USB Devices "Eject"

Post 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!!
C= A500 2 megs RAM with A590 w/40 MB SCSI HD and Workbench 1.3
C= A3000 25 MHz with Workbench 3.1
AmigaOne X1000 4 GB RAM, XFX Radeon HD 6670 1GB GDDR5 GPU and AmigaOS 4.1 FE/Ubuntu 12.04.5 LTS/Ubuntu Mate 16.04 LTS
Sam460ex 2GB DDR2 800 MHz RAM, XFX Radeon HD 5450 2GB GDDR3 GPU, 3114 SATA Raid, ENVY24HT sound card and AmigaOS 4.1 FE
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: USB Devices "Eject"

Post 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.
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: USB Devices "Eject"

Post 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.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: USB Devices "Eject"

Post 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.
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: USB Devices "Eject"

Post 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.
User avatar
Daedalus
Posts: 42
Joined: Sat Jun 18, 2011 12:30 am
Location: From Ireland, living in Glasgow
Contact:

Re: USB Devices "Eject"

Post 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?
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: USB Devices "Eject"

Post 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?
Post Reply