1

I want to create a tempfs for specific photo-gallery app which supposed to have very high performance. More specificely, I have a code that creates a tmpfs, and I want a 3rd party photo-gallery app to access files in that tmpfs.

I created a tempfs and mounted it to some node in the filesystem. Then I copied the specific list of photos from the sdcard into my tmpfs ordinarily. (Remember that the filesystem on the sd-card is VFAT)

The files are well copied to the tmpfs destination but I got a very anoying problem: it seems that there is no option of setting the umask attribute to the tmpfs (also, you can see that this attribute gets 0 in the fstab file) and thus, all the files that I copy from sdcard to the tmpfs are getting no permissions, i.e., my app cannot read/write them (but they're exist).

How can I solve it?

Bush
  • 2,433
  • 5
  • 34
  • 57

1 Answers1

0

So edit your fstab and add a different umask. e.g. mode=644 to allow "read/write" access for the user, and only "read" for the user's group and everyone else.

DBedrenko
  • 4,871
  • 4
  • 38
  • 73
  • As far as I know the fstab doesn't support a umask attribute for a tmpfs filesystem. Are you speaking from your experience or just suggesting to try? – Bush Jun 03 '14 at 13:12
  • @Bush I'm not speaking for experience, but I guessed that you could do it. Maybe the option is called `mode` rather than `umask` (see: http://www.softpanorama.org/Internals/Unix_filesystems/linux_tmpfs.shtml). – DBedrenko Jun 03 '14 at 13:15
  • Nope, it seems to have no effect. – Bush Jun 05 '14 at 11:29
  • @Bush Look at `man 8 mount`, the `mode` option is there. Run `mount` and check that the new mode has actually been set on the tmpfs. – DBedrenko Jun 05 '14 at 11:51