Since this is a major issue, I thought I’d spend a bit of time poking around in Vera to see how she handles the USB logging. This is what I’ve found. I’m far from an expert in Linux/OpenWRT, so if anyone has any other information or thoughts, I’d appreciate it…
Firstly, a word about how Linux seems to mount USB sticks - this might not be 100% right (feel free to correct me!) but is what I think happens. When you plug in a USB drive, Linux assigns it a device (eg /dev/sda1, /dev/sdb1 etc). This is not guaranteed to be the same every time, but there are 2 ways that you can work out what drive has been mounted. You can either assign a LABEL to the drive, and there is also a UUID (Universally Unique ID) that is assigned. From what I’ve seen, the UUID is assigned when you format the drive (at least, I’ve seen it changes after I formatted a drive under Windows!).
From looking through the files /www/cgi-bin/cmh/usb-stick.sh, and /usr/bin/UsbStick.sh, I believe that Vera is setting the Label to “MiOS”, and this is then being used to ensure that this USB stick is mapped to the /tmp/log/cmh directory so that you get your logs stored correctly. I think this is fine - so long as there’s only 1 drive with the label “MiOS”!!!
dataMine uses the UUID - this appears to be the recommended way to detect the USB stick and mount it to the right place. When you configure dataMine, you select/specify the UUID, and it ensures that the correct USB drive is used for dataMine logging…
So, all’s good in the world ![]()
However :![]()
You should ensure that you don’t have 2 drives with the label “MiOS”. If you do, I don’t know what happens - I believe it’s undefined. Looking at the documentation for fstab (the file system configuration under OpenWRT [url=http://wiki.openwrt.org/doc/uci/fstab]http://wiki.openwrt.org/doc/uci/fstab[/url]), it states that mapping occurs in the following order of priority - UUID highest, then LABEL, then the mount point. So, I think dataMine will always work as it uses UUID, and this is unique, however if you have 2 drives that have been formatted by Vera, they will (I think) both have the same Label (MiOS), then it may be random as to which one gets mapped. If it maps the wrong one - ie the same one as is being used for dataMine, then this will cause file system corruption to the drive. Both dataMine, and USB logging will suffer.
So…
I highly recommend that for dataMine, you DO NOT use Vera to format your USB stick. Use Windows, or Linux, or Mac - just don’t use the Vera USB logging to create another disk as I’m pretty sure this will end up with the label set to MiOS, and if you want to use USB logging for Vera logs, I think you’re heading for trouble…
I reiterate - I’m not an expert, so if anyone knows better, please post your thoughts as this area is probably the #1 problem people have with dataMine, and I’d really love to understand it better…
Cheers
Chris