LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help? Using Ext3 file system on USB stick on Linux RT Target

Solved!
Go to solution

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?

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
Message 1 of 10
(3,902 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 10
(3,891 Views)

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:

 

Spoiler
# stock fstab - you probably want to override this with a machine specific one

/dev/root / auto defaults 1 1
proc /proc proc defaults 0 0
securityfs /sys/kernel/security securityfs defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0

# uncomment this if your device has a SD/MMC/Transflash slot
#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0

LABEL=nibootfs /boot ext4 sync 0 0
LABEL=niconfig /etc/natinst/share ext4 sync 0 0
0 Kudos
Message 3 of 10
(3,847 Views)

@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.

0 Kudos
Message 4 of 10
(3,844 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 10
(3,826 Views)

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.

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 6 of 10
(3,812 Views)

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

0 Kudos
Message 7 of 10
(3,805 Views)
Solution
Accepted by topic author JarleEkanger

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...

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 8 of 10
(3,799 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 10
(3,788 Views)

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.

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 10 of 10
(3,778 Views)