samlu
Posts: 7
Joined: Sat Jul 06, 2013 7:16 pm

disk activity led blinks once a second

Sat Jan 31, 2015 3:46 am

Hopefully this is not an FAQ, but my Raspberry Pi's green disk activity LED is blinking faintly once a second. Is this normal? I'm worried about wearing it out my SD card.

I've killed almost every user processes. I've tried to use iostat and nmon but I'm still not able to identify the culprit that's causing the activity. Any ideas?
Last edited by samlu on Sat Jan 31, 2015 10:19 am, edited 1 time in total.

User avatar
Paul Webster
Posts: 781
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
Contact: Twitter

Re: disk activity led blinks once a second

Sat Jan 31, 2015 8:19 am

Do you have this in your config.txt?
dtparam=act_led_trigger=heartbeat
I am not certain that this is the effect that it would have but it does change the ACT led from indicating MMC activity to a more general activity indicator according to the docs.

User avatar
joan
Posts: 13916
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: disk activity led blinks once a second

Sat Jan 31, 2015 8:24 am

As far as I am aware it is normal.

Mine does the same, once a second. As you say, it normally indicates SD card access, it could be read or write.

User avatar
joan
Posts: 13916
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: disk activity led blinks once a second

Sat Jan 31, 2015 8:28 am

Paul Webster wrote:Do you have this in your config.txt?
dtparam=act_led_trigger=heartbeat
I am not certain that this is the effect that it would have but it does change the ACT led from indicating MMC activity to a more general activity indicator according to the docs.
The following shows the current driver in [] brackets.

cat /sys/class/leds/ACT/trigger

You can change it with this sort of invocation (this example switches the LED off).

sudo sh -c "echo none >/sys/class/leds/ACT/trigger"

samlu
Posts: 7
Joined: Sat Jul 06, 2013 7:16 pm

Re: disk activity led blinks once a second

Sat Jan 31, 2015 10:35 am

Thanks for the pointers.

I don't have any 'dtparam' lines in config.txt.

The LED is indeed set to trigger on disk activity:
[email protected] ~ $ cat /sys/class/leds/led0/trigger
none [mmc0] timer oneshot heartbeat backlight gpio cpu0 default-on rfkill0 phy0rx phy0tx phy0assoc phy0radio
Is there anyway to find out which process is actually doing the read or write once a second?

User avatar
joan
Posts: 13916
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: disk activity led blinks once a second

Sat Jan 31, 2015 10:49 am

You could try iotop

sudo apt-get install iotop

sudo iotop

(then press a to get accumulated stats).

Personally I think the LED is still flashed once a second even if there is no disk activity.

samlu
Posts: 7
Joined: Sat Jul 06, 2013 7:16 pm

Re: disk activity led blinks once a second

Sat Jan 31, 2015 11:44 am

Using iotop, the only thing I can see is the ext4 journal process occasionally writing something:
[email protected] ~ $ sudo iotop -obtqq
06:36:36 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:37 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:38 Total DISK READ: 0.00 B/s | Total DISK WRITE: 9.06 K/s
06:36:38 42 be/3 root 0.00 B/s 3.02 K/s 0.00 % 0.30 % [jbd2/mmcblk0p2-]
06:36:40 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:41 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:42 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:44 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:45 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:46 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:48 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:49 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:50 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
06:36:51 Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
All the while the ACT LED was blinking once a second. Mystery still unsolved.

User avatar
joan
Posts: 13916
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: disk activity led blinks once a second

Sat Jan 31, 2015 11:54 am

I don't think anything is being written. It happens too precisely every second, I just think it's a sort of I'm still working pulse.

User avatar
PeterO
Posts: 4539
Joined: Sun Jul 22, 2012 4:14 pm

Re: disk activity led blinks once a second

Sat Jan 31, 2015 12:20 pm

Joan,

Neither the A+ nor the B that are working on my desk at the moment are flashing their green leds.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
joan
Posts: 13916
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: disk activity led blinks once a second

Sat Jan 31, 2015 12:25 pm

PeterO wrote:Joan,

Neither the A+ nor the B that are working on my desk at the moment are flashing their green leds.

PeterO
You may not notice. The duration is of the order of 50 µs.
led_flash.png
led_flash.png (40.95 KiB) Viewed 3855 times

User avatar
PeterO
Posts: 4539
Joined: Sun Jul 22, 2012 4:14 pm

Re: disk activity led blinks once a second

Sat Jan 31, 2015 12:51 pm

joan wrote:
PeterO wrote:Joan,

Neither the A+ nor the B that are working on my desk at the moment are flashing their green leds.

PeterO
You may not notice. The duration is of the order of 50 µs.
Good grief ! That's hardly a "flash" ;)

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
joan
Posts: 13916
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: disk activity led blinks once a second

Sat Jan 31, 2015 12:56 pm

PeterO wrote: ...
Good grief ! That's hardly a "flash" ;)
...
Luckily I am blessed with terminal laziness. It was quicker for me to launch piscope rather than walk 6 feet to stare at the Pi's. I've just done the 12 foot round trip and I can see the B+ flash but not the one on my old Rev.1 B.

samlu
Posts: 7
Joined: Sat Jul 06, 2013 7:16 pm

Re: disk activity led blinks once a second

Sat Jan 31, 2015 3:00 pm

I admit I'm have OCD but I did say "faint" in my initial description. ;) My concern is more about the wear on the SD card if there is indeed write activity every second.

I still suspect there is indeed MMC activity going on because if I echo anything other than 'mmc0' to the trigger file, the blinking stops. And yes, I only notice this on my A+ model. Something unique to that build of the kernel?

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1897
Joined: Thu Jul 11, 2013 2:37 pm

Re: disk activity led blinks once a second

Sat Jan 31, 2015 3:47 pm

Because the SD card detect line isn't wired up (and is unreliable anyway), the kernel sends a "Send Status" command to the SD card once every 500ms or so. Getting a response means the card is still present. This activity is what is causing the faint blinking.
Rockets are loud.
https://astro-pi.org

samlu
Posts: 7
Joined: Sat Jul 06, 2013 7:16 pm

Re: disk activity led blinks once a second

Sat Jan 31, 2015 4:09 pm

Thanks for the definitive explanation. I can now rest easy. :)

User avatar
Burngate
Posts: 5868
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: disk activity led blinks once a second

Sun Feb 01, 2015 3:17 pm

jdb wrote:... the kernel sends a "Send Status" command to the SD card once every 500ms or so. Getting a response means the card is still present.
Forgive me, but ...

Why does the kernel need to know?
If I remove the card after it's finished reading or writing, and replace it before it next wants to read or write, why should it care?

I can see why it would panic if I replaced it with a different one, but even that is get-round-able - RISC OS manages it, by putting up a complaint window saying (I paraphrase) "Oy! Give me back my old card"

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1897
Joined: Thu Jul 11, 2013 2:37 pm

Re: disk activity led blinks once a second

Sun Feb 01, 2015 6:56 pm

Because the mere act of removal or insertion of a card means that the SD bus negotiation has to start all over again. The maximum initial frequency of the SD bus is 400kHz (in case an ancient card is inserted) and capabilities must be detected before transitioning to a higher speed mode.

Cards also need to be set into the proper mode - there's a very big set of state transition diagrams in the SD spec that detail what transactions/commands have to be done in order to get the card into a read/write mode.
Rockets are loud.
https://astro-pi.org

lissacoffey
Posts: 1
Joined: Sat Jan 31, 2015 10:03 am
Contact: Website

Re: disk activity led blinks once a second

Mon Feb 02, 2015 7:21 am

Thanks for the pointers.

I don't have any 'dtparam' lines in config.txt.

dfries
Posts: 9
Joined: Mon Mar 27, 2017 1:32 am

Re: disk activity led blinks once a second

Mon Mar 27, 2017 2:00 am

jdb wrote:the kernel sends a "Send Status" command to the SD card
But, the standard setup has the root filesystem on that SD card, yank it, and it is time to reset even if you put it right back in. So for the standard setup might as well just disable the polling because if you pull the SD card it is game over. Is that a software trigger for turning the LED on/off, can the Send Status be excluded? It is so annoying I just have to turn off the LED it lights up my room at night! Thanks for the pointer, I've added it to my to do list to disable.

Return to “General discussion”