1

I've read (here: Is the Raspberry Pi suitable for running continuously, 24/7?) that using a Raspberry Pi 24/7 is possible as long as you don't write too much on the SD card. So, how do you know if your system/application writes on it ? Are there kind of log of this ?

To be more precise, in my case I'm using the Raspberry as a DSP and I guess I'm not writing anything on it but, how to be sure ?

Corentoulf
  • 33
  • 4

4 Answers4

3

Assuming you are no longer talking about logs in particular.

Have a look at /proc/diskstats. If you cat /proc/diskstats you will see statistics for various devices.

Each device has 11 entries as follows.

Name            units         description
----            -----         -----------
read I/Os       requests      number of read I/Os processed
read merges     requests      number of read I/Os merged with in-queue I/O
read sectors    sectors       number of sectors read
read ticks      milliseconds  total wait time for read requests
write I/Os      requests      number of write I/Os processed
write merges    requests      number of write I/Os merged with in-queue I/O
write sectors   sectors       number of sectors written
write ticks     milliseconds  total wait time for write requests
in_flight       requests      number of I/Os currently in flight
io_ticks        milliseconds  total time this block device has been active
time_in_queue   milliseconds  total wait time for all requests

See https://www.kernel.org/doc/Documentation/block/stat.txt for further detail.

joan
  • 71,024
  • 5
  • 73
  • 106
1

Yes there are logs, most should be under /var/log.

Use the command ls /var/log -lrt to get a reverse time ordered list of files in that directory.

You can tune some logging with the file /etc/rsyslog.conf. If you want to disable as much logging as possible add a line with *.* ~ just after the #### RULES #### comment block.

Not all logging may be controlled in this fashion. Some programs bypass this configuration file and have their own configuration file for logging.

joan
  • 71,024
  • 5
  • 73
  • 106
  • Thanks! So, you mean I can disable log to prevent a few writes. But is there a way to control if the app I'm running is writing things on the SD card to work ? – Corentoulf Jan 22 '16 at 23:29
  • If you run an app which writes to a file wouldn't you want that output? If you don't want the output perhaps get the app to write to a file on a RAM disc. That won't impose any wear on the SD card. – joan Jan 22 '16 at 23:37
  • Relevant: http://unix.stackexchange.com/a/84905/25985 – goldilocks Jan 23 '16 at 02:41
  • I don't know if the app is writing on the SD card. I'm looking for a way to detect if the app writes things on the SD card.Managing log's writes is another point. – Corentoulf Jan 24 '16 at 23:19
0

You could use my Nard SDK as a platform base. It doesn't use the SD card at all after bootup. One can even remove the SD card and the system will continue to operate just fine.
http://www.arbetsmyra.dyndns.org/nard

Ronny Nilsson
  • 898
  • 5
  • 13
  • This looks really interesting... Will I be able to run any Raspbian binary within the Raspbian emulator or is it limited ? – Corentoulf Jan 24 '16 at 23:16
  • All console based Raspbian Wheezy binaries should work. Avoid applications depending on a GUI and X-Windows though. There is a list at the website with tested examples applications. – Ronny Nilsson Jan 25 '16 at 10:40
  • Okay, I'll may give it a try so. – Corentoulf Jan 25 '16 at 11:00
0

If you are looking for Raspbian that can be read only on demand, there is a special blackout-proof flavor of Raspbian called IPE – Industrial Perennial Environment R1. http://nutcom.hu/ipe-r1

avra
  • 1,273
  • 8
  • 9