Posts: 42
Joined: Sat May 28, 2016 8:27 am

[Solved] rPi3 on USB drive: What is constantly accessing the drive?

Sat May 05, 2018 5:24 am

I made a rPi3 bootable from USB drive... all good... it runs Stretch.

The image is stock standard; with my user added to dialout for serial access.
I have written a python script to read from the serial port and write to disk every second.
This will create a short blib on the USB drive for the write access. (This is for testign only, the final script collects 60 records and writes every minute).

The USB key gets busy on a regular basis; e.g. every 45 seconds or so, for some 10-15 seconds reading from or writing to disk; thus interrupting the logging of the serial port (as a result creating incorrect timestamps); see below...

2018-05-05 15:13:00.325,55.9,0.1,-0,100.0,0
2018-05-05 15:13:03.638,55.9,0.0,-0,100.0,0
2018-05-05 15:13:03.664,55.9,0.0,-0,100.0,0
2018-05-05 15:13:04.620,55.9,0.0,-0,100.0,0
2018-05-05 15:13:06.045,55.9,0.1,-0,100.0,0
2018-05-05 15:13:07.441,55.9,-0.1,-0,100.0,0
2018-05-05 15:13:08.874,55.9,0.0,-0,100.0,0
2018-05-05 15:13:10.287,55.9,0.1,-0,100.0,0
2018-05-05 15:13:22.163,55.9,0.1,-0,100.0,0
2018-05-05 15:13:22.173,55.9,0.2,-0,100.0,0
2018-05-05 15:13:22.197,55.9,0.3,-0,100.0,0
2018-05-05 15:13:22.217,55.9,0.2,-0,100.0,0
2018-05-05 15:13:22.226,55.9,0.3,-0,100.0,0
2018-05-05 15:13:22.235,55.9,0.2,-0,100.0,0
2018-05-05 15:13:22.244,55.9,0.1,-0,100.0,0
2018-05-05 15:13:22.253,55.9,0.0,-0,100.0,0
2018-05-05 15:13:23.128,55.9,0.1,-0,100.0,0

2018-05-05 15:13:26.072,55.9,0.1,-0,100.0,0
2018-05-05 15:13:26.082,55.9,0.1,-0,100.0,0
2018-05-05 15:13:27.376,55.9,0.3,-0,100.0,0

The same script logs perfectly every second on another rPi3.

Meaning, the script is not the issue!
The rPi behaves the same way without anything running on it.

How can I figure out what is either reading or writing to the USB stick?
Last edited by Max_G on Sat May 05, 2018 6:00 am, edited 1 time in total.

Posts: 42
Joined: Sat May 28, 2016 8:27 am

Re: rPi3 on USB drive: What is constantly accessing the drive?

Sat May 05, 2018 5:59 am

Have installed iotop and atop and found the process causing it.

It was daemontools looking for a service I had yet not created; I had created the directory, but not he run file; it seems it was looking for it, and thinking to long what to do next. :)

Anyway... problem solved.

Return to “Troubleshooting”