Partitioning USB HDD for EmonCMS

I’m about to switch to a spinny HDD for EmonCMS. I have EmonCMS working on a USB flash drive currently with the latest Raspbian from April 10 2017, so it’s working in USB-only mode.

However, I’m stuck on this:

Currently, to take an image of a MicroSD or USB stick, I use Win32DiskImager, which creates an .IMG file the size of the drive (not just the partition size).

I very much dislike the idea of taking a 512gb backup of an EmonCMS Pi image.

How do you handle full backups like this?

I see the backup instructions for backing up EmonCMS + data, but would feel better about having periodic backups of an entire image to avoid having to go through the whole EmonCMS build process again.

There is no “OEM” recommended way of doing what you ask but you could take a look at

  • using DD to create an image of any size set by you
  • reducing the hdd partition size to a more manageable size to create smaller images more easily and increase that size as and when more space is needed.
  • using rsync to just backup any changes to the FS (once the initial backup is made)

If you have one, you could boot a Linux Live CD on your Wndows box to do the job. That gives you an environemnt where you can create/format/resize partitions, as well as copy and edit files, etc.

Interesting. So, I have a Ubuntu Virtualbox machine I use for doing similar things. I’ll look into doing that. Surely the partition resize tool will move things around on the disk appropriately so nothing gets abandoned.

On a side note, I noticed in another topic, somebody mentioned “speed” as a reason to go with a USB HDD (rather than MicroSD) for EmonCMS. Would that be a misstatement?

Sounds like you’ve got a handle on it with the VB machine.

I run a USB HDD on a Pi, but since it’s an early version (256MB RAM), there’s not much difference in boot/app-load speed, if any. I’ve not tried it with a Pi2 or 3, so don’t have any point of reference for those.