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

Marcos Raul Carot Collins marcos.carot at gmail.com
Fri Jul 23 07:33:45 WST 2010


On Jue, 22 Jul 2010 23:18:07 Gregory Orange escribió:
> 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?
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au

Thanks Greg,
I will give it a try this weekend, and report back.

Cheers,
Marcos
-- 
Marcos Raúl Carot Collins
www.carotcollins.com



More information about the plug mailing list