NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting SD card in ext3

Hi,

I'd like use an sd card to store logged data on the 9651 board. I'd like to format in ext3 to have better reliability for an embedded device, but I'm having trouble formatting the card. I tried using a linux PC to format the card and use it in the sbRIO but I have some troubles. Via FTP everything works, while trying to programmatically write on the card I get a permission error (error 8). So I tried to format the card on the sbRIO, but I've found that the mkfs command is missing. Any ideas on how to overcome the problem?

Message 1 of 3
(4,043 Views)

... I'll be watching this one as I was about to ask similar questions. 

To make the thread even more complete, is there a tool (free or otherwise) that can be used to format and/or read ext3 SD-cards on a Windows (7) system?

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 2 of 3
(3,223 Views)

Hello Valbo10 and QFang, welcome!

The issue that you're running into here is that any proper UNIX/Linux filesystem has the notion of file and folder permissions and ownership. When you've created the ext3 filesystem, it will be owned by root:root (UserID 0, GroupID 0) with permissions that prevent you from adding things to the folder as the under-priviledged lvuser (the user that is running the LabVIEW RT system on the controller).

You have a few options:

  1. Make a sub-folder under the the SD card root, change the owner to lvuser (chown -R lvuser /path/to/sdcard/subfolder). You now can write to the subfolder as the lvuser user
  2. Make a subfolder, as noted in 1., but simply make the permissions more open (chown 777 /path/to/sdcard/subfolder)
  3. Tweak the udev rules used to mount the sdcard to play around with the way that the filesystem is mounted to give it more permissions (read up on the "users" and "umask" options)

Also, the targets should have the mkfs.ext3 tool on them. Normally, the mkfs tool will simply turn around and call these fs-specific versions anyway.

0 Kudos
Message 3 of 3
(3,223 Views)