I'm writing some bytes to the filesystem. Afterward I'm calling
sync to ensure the buffered data is flushed to the SD card. This command takes several seconds!
I'm working with raspbian. My SD Card is a 16GB Kingston Class 10 (industrial).
Logging the disk io with
sudo iotop -o -d 1 -a say, that only some 100 KBytes are written to disk.
To find out the source of the problem I'm doing following:
- Watching the output of
sudo iotop -o -d 1 -ain one Terminal
- Run some application that writes about every minute some 100Kbytes
time syncin an other terminal after the write is done. This one takes sometimes several seconds (up to 5sec). (if nothing is written to disk it takes only some milliseconds)
Whats wrong that
sync takes as long?