WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Pi 3] SD activity with no partitions mounted?  (Read 5773 times)

Offline jefferee

  • Newbie
  • *
  • Posts: 31
[Pi 3] SD activity with no partitions mounted?
« on: June 22, 2017, 11:43:24 AM »
Pi 3, running piCore 8.1.5.

I'm using copy mode, with copy2fs.flg in /mnt/mmcblk0p2/tce.


Furthermore, in /opt/bootlocal.sh, I have the line
umount /mnt/mmcblk0p2
so that the SD card is unmounted after bootup.


But I am still seeing the green "ACT" light flash when I start up some software on the Pi... does this mean I still have I/O accessing the SD card, or is the ACT light indicating something else?


The software is for industrial control, using TCP sockets and tty ports (tty through a USB/RS-232 dongle) to communicate with external devices.
We really want to ensure that we aren't accessing the SD card at all following boot, to reduce the probability of the SD card being corrupted.


Any ideas? Can I see what processes might be accessing the SD card?
Thanks for your wisdom.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: [Pi 3] SD activity with no partitions mounted?
« Reply #1 on: June 22, 2017, 12:04:56 PM »
I believe the green light indicates general activity and not only µSD read/writes.

Maybe this helps you find out:
Simple disk activity monitor script
http://forum.tinycorelinux.net/index.php/topic,16256.msg96390.html#msg96390
Download a copy and keep it handy: Core book ;)

Offline jefferee

  • Newbie
  • *
  • Posts: 31
Re: [Pi 3] SD activity with no partitions mounted?
« Reply #2 on: June 22, 2017, 01:12:26 PM »
I believe the green light indicates general activity and not only µSD read/writes.

Maybe this helps you find out:
Simple disk activity monitor script
http://forum.tinycorelinux.net/index.php/topic,16256.msg96390.html#msg96390

Thanks. I took a look through the script and figured for my purposes just a simple command-line call
Code: [Select]
cat /proc/diskstats | grep mmcwold work well enough.

Definitely seeing the ACT light blinking without any changes to the numbers, and I can confirm that the numbers for mmcblk0 and mmcblk0p2 *do* change when I run filetool.sh... So I think this verifies that the ACT light must also show general activity, at least on the Pi 3.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: [Pi 3] SD activity with no partitions mounted?
« Reply #3 on: June 22, 2017, 02:04:56 PM »
Google says you can control it via /sys/class/leds/led0/trigger. What are the default contents (cat that file)?
The only barriers that can stop you are the ones you create yourself.

Offline jefferee

  • Newbie
  • *
  • Posts: 31
Re: [Pi 3] SD activity with no partitions mounted?
« Reply #4 on: June 27, 2017, 12:33:59 PM »
Google says you can control it via /sys/class/leds/led0/trigger. What are the default contents (cat that file)?
Had a look... for my purpose as long as I'm sure the SD card is not being accessed I can cheerfuly ignore the light.  8)

But anyway:
Code: [Select]
tc@box:/sys/devices/platform/soc/soc:leds/leds/led0$ cat trigger
none kbd-scrollock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock [mmc0] mmc1 timer oneshot heartbeat backlight gpio cpu0 cpu1 cpu2 cpu3 default-on input

so... bunch of stuff in there by default.

Offline xpector

  • Newbie
  • *
  • Posts: 16
mounting mmcblk0p2 read-only
« Reply #5 on: June 29, 2017, 05:02:26 AM »
jefferee,
from what I know, during the bootup, mmcblk0p2 is mounted rw, until umount /mnt/mmcblk0p2 in /opt/bootlocal.sh is executed.
Wouldn't it be nice to let mmcblk0p2 be mounted read-only, to reduce the probability of the SD card being corrupted even further?
(@all - how to accomplish this?)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: [Pi 3] SD activity with no partitions mounted?
« Reply #6 on: June 29, 2017, 07:23:34 AM »
Code: [Select]
sudo mount -o remount,ro /mnt/mmcblk0p2
Download a copy and keep it handy: Core book ;)

Offline xpector

  • Newbie
  • *
  • Posts: 16
Re: [Pi 3] SD activity with no partitions mounted?
« Reply #7 on: June 29, 2017, 10:32:00 AM »
Misalf,
wouldn't mmcblk0p2 stay mounted rw (at least for some time) before this command runs (from bootlocal.sh I guess)? If yes, could one change it to ro from the very beginning? (/etc/fstab ?)
Code: [Select]
sudo mount -o remount,ro /mnt/mmcblk0p2

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11701
Re: [Pi 3] SD activity with no partitions mounted?
« Reply #8 on: June 29, 2017, 01:23:38 PM »
Hi xpector
... could one change it to ro from the very beginning? (/etc/fstab ?)
No,  /etc/fstab  is not persistent. It gets rebuilt from scratch during startup.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: [Pi 3] SD activity with no partitions mounted?
« Reply #9 on: June 29, 2017, 01:35:20 PM »
You'd have to edit rebuildfstab and remaster to have it always mounted ro. But remember that SD cards can corrupt themselves even when mounted read-only.
The only barriers that can stop you are the ones you create yourself.