Raspberry Pi disk usage fix
Posted: Mon Aug 31, 2015 10:41 am
Hi,
I saw a problem in the info page with disk usage wrong on a Raspberry Pi running raspbian.
Here is a simple way to fix it.
/path/to is where ever YOUR 123solar path is installed.
Replace rootfs with /dev/root in the last two DISK lines
OR just copy the below:
To a new file save it as raspbian_ARM.php to the directory /path/to/123solar/scripts/distros/
Change permissions of the file as required then go to admin page.
Select the raspbian_ARM distro on admin page, restart 123solar if needed.
Cheers,
Steve
I saw a problem in the info page with disk usage wrong on a Raspberry Pi running raspbian.
Here is a simple way to fix it.
Code: Select all
cp -a /path/to/123solar/scripts/distros/debian_ARM.php /path/to/123solar/scripts/distros/raspbian_ARM.php
vi /path/to/123solar/scripts/distros/raspbian_ARM.php
Replace rootfs with /dev/root in the last two DISK lines
Code: Select all
:%s/rootfs/\/dev\/root/g
Code: Select all
<?php
# Commands
$UPTIME="uptime";
$CPUUSE="ps aux|awk 'NR > 0 { s +=$3 }; END {print \"cpu %\",s}' | awk '{ print $3 }'";
$MEMTOT="free -m | grep 'Mem' | awk '{print $2}'";
$MEMUSE="free -m| grep 'buffers/cache' | awk '{print $3}'";
$MEMFREE="free -m| grep 'buffers/cache' | awk '{print $4}'";
$DISKUSE="df -h | grep /dev/root | awk '{print $3}'";
$DISKFREE="df -h | grep /dev/root | awk '{print $4}'";
?>
Change permissions of the file as required then go to admin page.
Select the raspbian_ARM distro on admin page, restart 123solar if needed.
Cheers,
Steve