Correct way to dismount usb drives ?

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
mlehto
Posts: 54
Joined: Thu Jun 23, 2011 12:39 pm

Correct way to dismount usb drives ?

Post by mlehto »

How to be sure, that buffered data is written to USB drive/stick?

Made that way with NTFS drive. Answering cancel causes system freeze.
Attachments
usb_disconnect.jpg
usb_disconnect.jpg (30.42 KiB) Viewed 2033 times
chris
Posts: 552
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Correct way to dismount usb drives ?

Post by chris »

"Dismount USB0:" or via the massstorage commodity (ctrl+alt+m)

Personally I just wait until the light stops flashing and then yank it out - AmigaOS doesn't usually do write caching.
It might be useful to have dismount added to the disk context menu.
mlehto
Posts: 54
Joined: Thu Jun 23, 2011 12:39 pm

Re: Correct way to dismount usb drives ?

Post by mlehto »

@chrish

Missed contextual menuentry allso.

Seems to work, if I dismount it as "assign amigantfs: dismount" rather than usb0:

Using usb0: causes requester and freeze.

I can dismount my 8gb memorystick without freeze, but 300 gt disk not.

Still good, that accessing ntfs is here :)
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 521
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: Correct way to dismount usb drives ?

Post by salass00 »

@mlehto

As chris already said you should use the c:dismount command and not "c:assign dismount". The latter only removes the doslist entry and doesn't actually send an ACTION_SHUTDOWN packet to the filesystem or cause it to flush any buffers for that matter.
mlehto
Posts: 54
Joined: Thu Jun 23, 2011 12:39 pm

Re: Correct way to dismount usb drives ?

Post by mlehto »

Ok, point taken. Old habits...
mlehto
Posts: 54
Joined: Thu Jun 23, 2011 12:39 pm

Re: Correct way to dismount usb drives ?

Post by mlehto »

@salass00

Dismount works flawless, yes.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 521
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: Correct way to dismount usb drives ?

Post by salass00 »

chris wrote: Personally I just wait until the light stops flashing and then yank it out - AmigaOS doesn't usually do write caching.
It might be useful to have dismount added to the disk context menu.
NTFS3G on AmigaOS does have a write cache that is flushed to disk after either 10 or 0.5 seconds depending on if there is continuous write activity or not. If there has been 0.5 seconds without any additional writes all cached writes are flushed to disk immediately at that point. If there are continuous writes then it may take up to 10 seconds before they are flushed to disk.

These are the default filesysbox.library values for active and inactive update timeouts. Other filesystem implementations may override them if necessary for speed/usability reasons and in the new dos.library there is also a way to get and set them on a per device basis using IDOS->FileSystemAttrs() which filesysbox.library also supports.
Post Reply