Configuration
=============
In most situations Wattsworth should work well with the default settings.
For more complex setups involving systems that may loose power, are connected
through networks, or other special cases the reference material in this section
shows how to fine tune the installation to meet these needs.
Storage
-------
Make sure you set up data journaling on the nilmdb partition. This will prevent
data corruption if the computer looses power without properly shutting down.
Edit ``/etc/fstab`` and add the ``data=journal`` option to the parition with the
nilmdb database.
.. code-block:: bash
# /etc/fstab: static file system information.
#
#
This section explains how to properly format and configure
an extra hard drive for a NILM system. It is usually a good idea to place the Nilm Database on a seperate hard drive. This prevents the database from filling the primary drive to the point
where the system become unusable and also makes it easy to retrieve collected data from an installation by simply swapping out the extra harddrive.
Formatting a drive After installing the drive and booting the system, the first step to use
the drive is to place a usable filesystem on it. There are many tools that can be used for this but one of the easiest is GParted. This program must be run as root. From the command line type type the following:
Select the extra drive from the dropdown menu as shown. Generally the extra drive should be /dev/sdb
but this is not always the case. If the drive already has multiple partitions this most likely means it is the primary drive.
Select Device > Create Partition Table to bring up the Create Partition dialog. Select msdos and click Apply. Select Partition > New to bring up the New Partition dialog. Add a new ext4 partition to the drive and assign it the full extents of the disk (this is the default). Click Add to close the dialog. Finally click Apply to format the disk and then close the program.
To use the drive for the Nilm database it must be mounted to the correct location in the filesystem. Edit /etc/fstab in a word processor and add the following line where /dev/sdX1 is the name of the drive you just formatted. The number one refers to the first (and only) partition. Note that you will need to run the word processor as root (sudo) in order to edit this file.
/dev/sdX1 /opt/data ext4 errors=remount-ro 0 1
When using an external drive as the primary storage volume, drive letters cannot be used since they change. The UUID is a unique drive partition identifier that should be used instead. Running sudo lsblk /dev/sdX1 will print out the UUID. The new line in /etc/fstab should resemble the following.
UUID=XXXXXXXX-XXXXX-XXXX-XXXX-XXXXXXXXXXXX /opt/data ext4 errors=remount-ro 0 1
Run the following commands to mount the drive and setup the permissions. Use df to verify the configuration:
The output from df should look similar to that below:
Filesystem Size Used Avail Use% Mounted on /dev/sda1 1.8T 5.3G 1.7T 1% / ... other mount points ... /dev/sdc1 917G 72M 871G 1% /opt/data
If you have already configured your meters and want to start collecting data, run: