fatrace — Find out which process is accessing which filepath and causing your HDD to spin up undesirably

  • The HDD in your OMV NAS is spinning up although it shouldn't? You want to find out why?

    I recommend this command line tool:

    fatrace (File Activity Trace)

    fatrace reports file access events (Open, Read, Write, Close) from all running processes.

    Its main purpose is to find processes which keep waking up the disk unnecessarily and thus prevent some power saving.


    When running in real time it outputs one line per file event in this format:

    <timestamp> <process-name(pid)>: <file-event> </path/to/file>


    For example:

    23:10:21.375341 Plex Media Serv(2290): W /srv/dev-disk-by-uuid-DISK-UID/Plex/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log

    From which you easily get all the necessary infos

    • WHEN: Timestamp, if using the --timestamp option
    • WHO: Process name (that causes the file activity)
    • WHAT: File event type (O-pen, R-read, W-rite, C-lose)
    • WHERE: Filepath (where is it writing to).
    • SCOPE You can limit the search scope with --current-mount to only record events on the partition/mount of your current directory.
      • So simply cd into the volume which corresponds to your spinning HDD first, and there run ftrace with the --current-mount option.
      • Without this option, all (real) partitions/mount points are being watched.

    Super practical

    • In comparison to other Linux file/disk activity monitoring apps you can very quickly and efficiently find out which process so far unknown to you is causing what file activity so far unknown/unexpected to you.
    • I would even recommend to include that in the OMV distro and mention it in the official documentation as a very good tool to troubleshoot disk I/O.
    • At least it's featured here now as a recommended Guide.

    Easy to install

    sudo apt install fatrace


    Some tweaking / tips

    All file events of all processes on all devices

    $ fatrace

    Get a timestamped output and limit scope to HDD

    # We cd to our HDDs filepath as a preparation to limit filtering scope

    cd /srv/dev-disk-by-uuid-YOUR-DISK/

    $ fatrace --timestamp --current-mount


    Shorten those longs "dev-disk-by-uuid" filepath a bit to make the output more readable


    $ fatrace --timestamp --current-mount | sed -En 's!/dev-disk-by-uuid-[^/]+/!/•••/!p'


    Suppress repeating lines (e.g. continuous read access to same file)


    $ fatrace --current-mount | sed -En 's!/dev-disk-by-uuid-[^/]+/!/•••/!p' | uniq

    #Note: You must omit the --timestamp, otherwise each line is unique.

  • KM0201

    Hat das Thema freigeschaltet.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!