View Single Post
Mara's Avatar
Posts: 1,310 | Thanked: 820 times | Joined on Mar 2006 @ Irving, TX
#1747
Originally Posted by Mara View Post
I have been looking around the config files etc. to see if I can pinpoint where the issue is. So far no success.

In the etc/fstab I have /dev/mmcblk0p1 /home/user/MyDocs vfat defaults 0 2

The fstab is generated by the script etc/event.d/rcS-late. I looked into this script and didn't notice anything unusual there.

The config file for user's filesystems seems to be the etc/default/mount-opts. I have there lines for "home-opts=" which I don't think applies for MyDocs case. The second line says: fat-opts="noauto,nodev,noexec,nosuid,noatime,nodiratim e,utf8,uid=29999,shortname=mixed, dmask=000,fmask=0133,rodir". I did try changing the fmask to 000 and rodir to rwdir, after which I mounted MyDocs, but it did not help. (Then I changed them back to original.)

There is another config file /etc/default/mount-opts.dpkg-dist, but there I have pretty much the same options except the fmask=0000, which should work fine?

The file etc/profile file I have line "umask 022" but when I changed it to "umask 000" it did not fix the problem. (Then I changed it back.)

The simplest workaround at this point is to umount /dev/mmcblk0p1 and then remount it using this command:
mount /dev/mmcblk0p1 -o dmask=000,fmask=000

In other words the mount command finds the all the correct default options from somewhere. It only needs manual overrides for dmask and fmask values.

Maybe this gives enough details for someone with detailed file system experience to pinpoint where the issue might be?

EDIT: Before someone points out the space before the last "e" in "nodiratime", it seems to be created by this forum: In post edit mode the space doesn't exists.
Little bit more to this:

I edited the /etc/event.d/rcS-late script line 100:
original: [ -z "$mydocs_opts" ] && mydocs_opts=defaults
modified: [ -z "$mydocs_opts" ] && mydocs_opts="defaults,dmask=000,fmask=000"

After this the fstab file does show:
/dev/mmcblk0p1 /home/user/MyDocs vfat defaults,dmask=000,fmask=000 0 2

After fresh boot MyDocs is not mounted using these parameters... The etc/mtab shows:
/dev/mmcblk0p1 /home/user/MyDocs vfat rw 0 0
so it is read-only.

Once I manually umount and remount it back:
mount /dev/mmcblk0p1

The /etc/mtab shows:
/dev/mmcblk0p1 /home/user/MyDocs vfat defaults,dmask=000,fmask=000 0 0
and I do have read/write access.

So to summarize the very first time the MyDocs is mounted after bootup does not use the fstab information. (Or the rc-S-late did not yet run by that time?) Only later phases the mount command does use fstab for its parameters.

I also noticed in Conky that there is fsck.vfat process that runs a while after bootup. MyDocs gets mounted after the fsck had finished but doesn't seem to use the fstab?

I guess the question now is that if anyone knows where is the script responsible to run the fsck.vfat after boot? I would like to look into that and see how the MyDocs gets first mounted after device bootup.
 

The Following 4 Users Say Thank You to Mara For This Useful Post: