09-30-2016 08:29 AM - edited 09-30-2016 08:29 AM
We have been experiencing some trouble with SD cards and USB sticks formatted to FAT32 on some long term monitoring devices based on Linus RT (mainly cRIO-9035's). It seems that the drives are vulnerable to power fluctuations and unexpected restarts (which are unavoidable on these locations). Aborted write operations render the drives damaged, thereby sabotaging logging after restart.
We have identified two solutions; implementing both gives the best redundancy:
1) Installing UPS's (uninterrupted power supplies/battery backups) - accomplished
2) Using the seemingly more robust file system "ext3", which is available on Linux RT targets (FAT32, ext2 and ext3) - failed so far:
-> I have not been able to correctly format a USB stick to ext3. I use the MiniTools Partition Manager, and get no errors when creating and formatting the partitions. But they appear as "read only" when inserted in the RT chassis. All attempts to access them, other than observing the empty sdxx-folder in "/media" returns errors.
Has anyone had any luck with using ext3 formatted drives as data drives on Linux RT targets? Is it worth the effort to solve my problems or should I resort to FAT32 and the risks observed?
Solved! Go to Solution.
09-30-2016 08:42 AM - edited 09-30-2016 08:45 AM
You probably have to change something in the configuration files about how the ext3 file memory sticks get mounted automatically. Not sure right now if NI Linux also is fstab based but you would normally edit the /etc/fstab file to add an entry for the device node that the USB stick normally would get and then specify the attributes that should be used to mount it. NI Linux may by default use read only access rights for removable ext3 file systems. That's arguably debatable if it is a useful default, but definitely the safest option, especially since the internal file system is not ext3 but UBIFS.
10-03-2016 11:33 AM
I too am interested in alternate file systems. FAT32 on this OS just seems a bit off, and I haven't been running any long term stuff yet but am a bit conserned if you are saying it just doesn't work well.
Here is my fstab BTW, not sure what it all means:
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-03-2016 11:35 AM
@rolfk wrote:especially since the internal file system is not ext3 but UBIFS.
That's not true for this hardware, the x86 based controllers have a ext4 file system.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-03-2016 05:14 PM - edited 10-03-2016 05:18 PM
Ahh well, seems fstab is only for the boot configuration. automount of USB (and other plugin media devices) seems to be normally done by usbmount. Not sure if NI Linux uses that too, and can't control it rght now, but would not see why not. Configuration is at /etc/usbmount/usbmount.conf.
@Hooovahh wrote:
@rolfk wrote:especially since the internal file system is not ext3 but UBIFS.
That's not true for this hardware, the x86 based controllers have a ext4 file system.
Thanks for that info.
10-04-2016 05:44 AM
I think the right place to look is /etc/udev/; it has mounting rules, a script that generates "/media/sdxy/", "/u" etc.
There is a case structure checking "$ID_FS_TYPE" with only one case: vfat
I'm unfortunately not familiar with this language.
10-04-2016 07:21 AM
While we wait for (hopefully) someone from NI, you can feel free to post over on the Linux RT community page. The people monitoring that board are extremely familiar with the Linux RT OS and platform. Over there I found other similar questions asking about USB and SD card formatting but didn't see a HowTo on setting it up.
https://decibel.ni.com/content/groups/ni-linux-real-time
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-04-2016 07:44 AM
I don't consider this but a temporary solution:
I've been running into issues when using MiniTools Partition Wizard to partition and format my thumb drives on Win10. Some unidentified change makes the drives inaccessible, and freeze the file navigation on the PC when I try to delete the partition. It was quite annoying!
I decided to try another partition tool, and went for the EaseUs Partition Master (Free version for now). I successfully formatted one of the troublesome drives with it (to add some uncertainty to the solution I used another, brand sp*anking new, PC to do it). The drive now mounts as read/write and allows the startup application to create the folders I want to store files in.
I'm very curious about the difference between the two partition tools and their formatting...
10-04-2016 04:37 PM
Maybe this link will help some more: https://linuxconfig.org/automatically-mount-usb-external-drive-with-autofs
It describes how a USB flash disk can be installed as a persistant device, rather than the default /dev/sd<x><#> and then how you can mount that with autofs to a specific mount point.
10-05-2016 03:27 AM
This is interesting (and a little daunting), but the whole "what will the path to the usb device be?"-problem I've solved by making a tool/.vi that searches for a specific ini file on mounted devices; the file contains a check value for the system name, and a priority. This allows me to insert several (two usb sticks and an SD card) storage targets, and have the system write files to the one with highest priority. Some error handling even allows you to hot-swap usb sticks while the program is running! I originally intended it as a backup against failed FAT32s, but will probably continue using it for critical cases.