USB Devices "Eject"

AmigaOS users can make feature requests in this forum.

USB Devices "Eject"

Postby jdupuis » Mon Jan 25, 2016 4:37 pm

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
jdupuis
 
Posts: 223
Joined: Sat May 09, 2015 8:19 am
Location: Baton Rouge, Louisiana USA

Re: USB Devices "Eject"

Postby samo79 » Mon Jan 25, 2016 4:54 pm

+1 ;)
User avatar
samo79
 
Posts: 511
Joined: Sat Jun 18, 2011 12:13 am
Location: Italy

Re: USB Devices "Eject"

Postby tonyw » Tue Jan 26, 2016 1:13 am

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
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1248
Joined: Wed Mar 09, 2011 2:36 pm
Location: Sydney, Australia

Re: USB Devices "Eject"

Postby jdupuis » Tue Jan 26, 2016 4:40 am

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
jdupuis
 
Posts: 223
Joined: Sat May 09, 2015 8:19 am
Location: Baton Rouge, Louisiana USA

Re: USB Devices "Eject"

Postby thomasrapp » Tue Jan 26, 2016 9:41 am

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.
User avatar
thomasrapp
 
Posts: 241
Joined: Sun Jun 19, 2011 12:22 am

Re: USB Devices "Eject"

Postby Belxjander » Thu Jan 28, 2016 5:00 pm

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

Re: USB Devices "Eject"

Postby salass00 » Thu Jan 28, 2016 5:40 pm

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

Re: USB Devices "Eject"

Postby Belxjander » Fri Mar 04, 2016 3:11 pm

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

Re: USB Devices "Eject"

Postby Daedalus » Thu Mar 10, 2016 4:01 am

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

Re: USB Devices "Eject"

Postby Belxjander » Fri Mar 11, 2016 1:58 am

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

Next

Return to AmigaOS Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest