[plug] fstab to force a group on a local ext3 and a fuse (ssh) partition

Gregory Orange gregory.orange at gmail.com
Thu Jul 22 23:18:31 WST 2010


On 22 July 2010 19:11, Marcos Raul Carot Collins <marcos.carot at gmail.com> wrote:
> I been trying to find a way to mount both a local ext3 filesystem and a fuse
> (ssh) filesystem in such a way that all files created (or copied) into it are
> automatically set to be of certain group.
>
> chmod and chown with cron over the terabyte there is not very eficient. If the
> files are stored from the begining with the correct group I won't need to do
> this.
>
> I have investigated around the options column in fstab, but I haven't found a
> way to do it (unless there is some functionallyti in the "gid" option that is
> supposed to be used with FAT for ext3, that assuming that I understood what
> that option does!).

The first thing that comes to mind is setgid, i.e.
find /mnt/mountpoint -exec chgrp your_group {} \;
find /mnt/mountpoint -type d -exec chmod g+s {} \;

Not highly efficient, but you only have to run that once. That said, I
am aware of a relevant bug[1] on our systems: setgid bit isn't set on
created directories on our XFS filesystem on SLES9, so from depth of
one dir onwards, setgid fails. Thankfully we don't have a TB of data
on that filesystem, so we can run the find-walk to fix it all
periodically (:

Default ACLs may not be any more help than setgid, but something to
bear in mind.

I didn't even know mount options provided that sort of functionality
so you got me reading...

http://linux.die.net/man/8/mount
Mount options for ext2 (which are inherited by ext3):
"... When grpid is set, it takes the group id of the directory in
which it is created; otherwise (the default) it takes the fsgid of the
current process, unless the directory has the setgid bit set, in which
case it takes the gid from the parent directory, and also gets the
setgid bit set if it is a directory itself. "

As for FUSE, Google isn't helping me much, but
http://fuse.sourceforge.net/ has this:
"Some options can be passed to the FUSE kernel module and the library.
 See the output of fusexmp -h for the list of these options."

HTH,
Greg.

[1] Surely that's incorrect behaviour?



More information about the plug mailing list