Alexander V. Makartsev wrote: 
> I'm guessing "umount" command is just as good to safely unmount filesystems
> during shutdown, but the actual process (systemd units?) that does it could
> be getting interrupted by timeout.
> IIRC 1 minute 30 seconds is the default timeout for systemd units.
> If a slow USB storage device has a few gigabytes of cached writes it won't
> make it in time.
> SATA\M.2 connected storage devices are not affected because they are many
> times faster and the connection is more robust.
> I've never actually tested this and never tried to shutdown a PC with a few
> terabytes of pending writes to the root filesystem.

You would need to have terabytes of RAM in order to do that...
which is possible, but very expensive.

Also, the kernel tries to flush the write buffers whenever enough time has
gone by:

/proc/sys/vm/dirty_writeback_centisecs = 500
        (every 5 seconds)

/proc/sys/vm/dirty_ratio = 20
        (or when 20% of memory is writable buffers)

If you set these to lower values, the disks will be written to
more often; larger values will space writes further apart.

Unfortunately, these are system-wide values. Whatever is optimal
for primary storage is usually not quite right for relatively slow
USB-connected storage.

-dsr-

Reply via email to