title: mount jffs2 filesystem from /etc/fstab with user permissions
body: <p>My rootfs is squashfs and I am trying to mount three JFFS2 partition on my flash device. But I want to set permissions for those partitions/directories. </p>
  
  <blockquote>
    <p>The requirement is  /readerconfig is only accessible by user with id
    1001.  /platform is only accessible by user with id 1001 /apps is only accessible (read,write and execute) by user with id 1000.</p>
    
    <p>Below is my fstab entry. </p>
  
  <pre><code>rootfs               /                    squashfs   defaults              0  0 
  proc                 /proc                proc       defaults              0  0
  /dev/mtdblock12      /readerconfig        jffs2      rw,umask=0077,uid=1000,gid=1000,exec,noatime      0  0 
  /dev/mtdblock13      /platform            jffs2      rw,umask=0077,uid=1000,gid=1000,exec,noatime      0  0 
  /dev/mtdblock15      /apps                jffs2      rw,umask=0077,uid=1001,gid=1001,exec,noatime      0  0 
  tmpfs                /var                 tmpfs      mode=0777                              0  0
  tmpfs                /tmp                 tmpfs      mode=0777                              0  0
  sysfs                /sys                 sysfs      nosuid,noexec,nodev                    0  0
  /dev/mtdblock14      /etc                 jffs2      rw,mode=0777,uid=0,gid=0,noatime       0  0
  </code></pre>
  </blockquote>
  
  <p>Upon implementing, I found that the mount options like uid and gid are not set for JFFS2 file system mount points. </p>
  
  <p>Here is the output of mount command on the target board. </p>
  
  <pre><code>&gt; root@ti-omap3-am3517-evm:~# mount 
   &gt;rootfs on / type rootfs (rw)
  &gt; /dev/root on / type squashfs (ro,relatime)
  &gt; devtmpfs on /dev type devtmpfs (rw,relatime,size=127428k,nr_inodes=31857,mode=755) 
  &gt; proc on  &gt; /proc type proc (rw,relatime)
  &gt; /dev/mtdblock15 on /apps type jffs2  (rw,noatime)
  &gt; tmpfs on /var type tmpfs (rw,relatime,mode=777) 
  &gt; tmpfs on /tmp type tmpfs (rw,relatime,mode=777) 
  &gt; sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
  &gt; /dev/mtdblock12 on /readerconfig type jffs2 (rw,noatime) 
  &gt; /dev/mtdblock13 on /platform type jffs2 (rw,noatime)
  </code></pre>
  
  <p>How do I set permissions for the directories /readerconfig, /platform and /apps directory? 
   Is it limitation of JFFS2 / mount command? or I can do it from rcS script? All alternatives are invited.</p>