I am trying to build a system running from a flash drive, while keeping the flash drive in regular use too. So I have created an ISOimage using SuseStudio and placed it on a flash drive using live-fat-stick (which is a script wrapping syslinux).
It’s working fine, but now I want to mount the flash drive itself, to use for persistent storage. It mounts just fine, but all files are set to root as owner, and writeable only by root. I did check that root can write successfully; but I don’t like the idea of running my applications as root, even on an “appliance” system.
I try to use mount options but they are roundly ignored, for example:
unount /vol/flash
mount -t vfat -o uid=1000,umask=0000,dmask=0000,fmask=0000 /dev/disk/by-label/MIKFL32 /vol/flash
cat /etc/mtab
(loads of stuff here)
/dev/sdb1 /vol/flash vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
And ls -l /vol/flash lists the files as owner by root with rwxr-x-r-x
permissions.
Moreover, even the command (run as root, of course) “chmod -R 777 /vol/flash” does not change anything. “chmod -R myuser /vol/flash” gives loads of “operation not permitted” errors.
How can I make it mount the file system with either umask=0 (so r/w/x permissions for everyone), or else owned by the user with the UID of 1000?
I did try modifying /etc/fstab at runtime, adding a line like this:
/dev/disk/by-label/MIKFL32 /vol/flash vfat mode=0777 0 0
I tried various options instead of mode=0777, as in umask=0000 and gid=1000. In all cases, after doing “mount /vol/flash”, I still saw all files owned by root and set to 755 permissions.
Lots of gogling did not clarify the issue. I tried to add the “user” option but it would not work anyway. Also, no trace of anything in /var/log.
I suspect there is a workaround in creating a file and an ext2fs system within the file, which could then be mounted and used for persistence. But I would much prefer just accessing the FAT32 file system, so the files can be shared with Windows machines.