HDD Setup, Creating a local EmonCMS installation on a Raspberry Pi with HDD

The HDD Setup instructions, referenced here:

https://github.com/emoncms/emoncms/blob/bufferedwrite/docs/hddsetup.md

Are referencing an older image, emonSD-21-7-14.img.zip

Can I follow the instructions when using the latest image, emonSD-23-02-15.img.zip  ?

In those instructions, it references an "alternative guide" as noted:

Paul (pb66) from the OpenEnergyMonitor forums has written an alternative guide for setting up the Pi with file system on a hard drive which should be easier for those running Windows, see forum post:http://openenergymonitor.org/emon/node/5092

However, the guide includes instructions to install emoncms from a repro. That doesn't make sense, because I believe the SD card already has the latest emoncms?

Where can I find the instructions to install the local only, low-write emoncms on a Raspi with a HDD?

Thanks

 

pb66's picture

Re: HDD Setup, Creating a local EmonCMS installation on a Raspberry Pi with HDD

That "alternative guide" was written before emoncms was included in a SDcard image.Some would say that it makes more sense to install a full version of emoncms fresh from the repo rather than take a "low-write" version of emoncms that has been optimised for installation to a "read-only"  SD card and install it to a hdd that doesn't require any of the restrictions imposed by a SDcard whilst giving a full feature set.

However if you wish to install the pre-built SDcard image to a hdd, you can, Just install the image to the hdd like you would normally to a SDcard (using win32diskimager), when you boot up the Pi it will still be running off the sd card and you will need to implement at some changes to the image installed to the hdd before you can boot to it. to do that you must mount it to the OS, use the following taken from the "alternative guide"

If the SDcard you are currently running on is Read-only you will need to exit read-only mode to be able to do the changes which is done by running rpi-rw first, 

sudo tune2fs -U random -L hdd  /dev/sda2

sudo mkdir /media/hdd

sudo mount /dev/sda2 /media/hdd

then edit the hdd's fstab

sudo nano /media/hdd/etc/fstab

change " /dev/mmcblk0p2 " to " /dev/sda2 " and " /dev/mmcblk0p3 " to " /dev/sda3 " then Ctrl+x, y, enter,

The first command is optional but recommended as it gives the partition a new UUID. The rest is essential. You will also need to "point" the SDcard at the hdd for it to boot to the hdd and restart

sudo sh -c 'echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait" > /boot/cmdline.txt'

sudo shutdown -r now

When the Pi boots up it will be running the "Pre-built SDcard image" read-only on the hdd and will need emoncms enabled as per the "SDcard guide".

You will need to remember any future edits or amendments you use that are intended for the "SD card image" will need "redirecting" whenever a "mmcblk0p " is used you need "sda ". You will also need to use rpi-rw to make any changes whilst running read-only.

Paul

 

tgmaxx's picture

Re: HDD Setup, Creating a local EmonCMS installation on a Raspberry Pi with HDD

Paul,

I decided to install the full version of emoncms from the Master branch.

​Thank you!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.