Welcome, Guest. Please login or register.

Author Topic: flush buffers to disk  (Read 5803 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline orangeTopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2003
  • Posts: 2796
    • Show only replies by orange
flush buffers to disk
« on: September 30, 2011, 02:18:35 PM »
um, perhaps i already asked this one but can't remember the answer..
how do you make sure buffers have been written to disk before using reset or poweroff?
(with pfs3 filesystem, if that matters)
Better sorry than worry.
 

Offline olsen

Re: flush buffers to disk
« Reply #1 on: October 02, 2011, 11:51:07 AM »
Quote from: orange;661975
um, perhaps i already asked this one but can't remember the answer..
how do you make sure buffers have been written to disk before using reset or poweroff?
(with pfs3 filesystem, if that matters)


Unless you want to write a short program to do the job (either send an ACTION_FLUSH packet to the file system, followed by a CMD_UPDATE command to the underlying disk driver, or just send an ACTION_INHIBIT packet to the file system), the straightforward approach is to wait a little bit.

All Amiga file systems which work on removable writable media are supposed to flush all "dirty buffers" to the disk as soon as possible. This operation may be delayed if the file system still has more important work to be done. For example, while you are still reading data from a file, the file system may wait until that operation has concluded before it flushes unwritten data to disk. The original Amiga file system used to wait for about five seconds for all disk read/write activity to conclude before it would begin mopping up after the write access. During this time the floppy LED would stay lit, and once the drive light went out, it was generally safe to remove the disk. A similar timeout was used by the FFS.

That's the long and short of it: wait :)
 

Offline dcutugno

  • Newbie
  • *
  • Join Date: Sep 2024
  • Posts: 5
  • Country: it
  • Gender: Male
    • Show only replies by dcutugno
Re: flush buffers to disk
« Reply #2 on: May 16, 2025, 03:45:37 PM »
For all that want to issue a fast reboot and be sure all buffers are wrote to disks, i did this program Diskflush soon will be published on Aminet:
                   
INTRODUCTION
===========================================================================

DiskFlush is a utility that ensures all filesystem buffers are written to
disk. It's especially useful before performing a fast reboot to prevent any
data loss from cached writes that haven't yet been committed to disk.

When the Amiga filesystem caches data, there's always a short delay before
it actually writes that data to physical media. DiskFlush forces an immediate
write of all cached data across all mounted volumes.


REQUIREMENTS
===========================================================================

- AmigaOS 2.0 or higher


INSTALLATION
===========================================================================

Simply copy DiskFlush to a location in your path, such as:
    C:      (System commands directory)
    SYS:Tools  (Common tools directory)
   

USAGE
===========================================================================

    DiskFlush [QUIET]
   
Options:
    QUIET   - Suppresses all progress messages


OPERATION
===========================================================================

DiskFlush performs the following operations for each mounted volume:

1. Sends ACTION_FLUSH packet to write all dirty buffers to disk
2. Sends ACTION_INHIBIT with DOSTRUE to perform disk driver update
3. Sends ACTION_INHIBIT with DOSFALSE to release the inhibition

This ensures a complete synchronization of all cached data with physical
media across all mounted drives in your system.


EXAMPLES
===========================================================================

Standard use:
    DiskFlush
   
Silent operation (useful in scripts):
    DiskFlush QUIET
   
Before reboot:
    DiskFlush
    reboot