[svlug] ext2 mount options on 1394 drive

Rick Schultz bloodyvikings at sbcglobal.net
Sun May 18 17:56:34 PDT 2003


On Sat, May 17, 2003 at 04:25:34PM -0700, David Hummel wrote:

> Understood, but does this explain why /mnt/exthd2 is:
>   drwxr-xr-x    5 root     root       8192 May 16 18:24 exthd2
> during the mount, instead of:
>   drwxrwxr-x    5 hummel   hummel     8192 May 16 18:24 exthd2
> as it is with vfat and iso9660?

I think so.  Think of VFAT as a special case.  When mounting the ext2
partition, the permissions are taken from the filesystem itself (in this
case, 755, root:root).  For vfat, since there are no owner/permission
settings on the filesystem, the system assigns a uid and gid to use on
the mount.  The default uid is the uid of the current process, so if the
partition can be mounted by regular users, all the files will be owned
by whoever does the mount.

> > or just change permissions/ownership of the root directory of the
> > filesystem itself.
> 
> You're referring to:
> 
> # chown hummel:hummel /mnt/exthd2
> # chmod 775 /mnt/exthd2
> 
> Right?

Right.

> I guess this is fine until another user wants to do exactly the
> same thing.  I suppose what I'm after is the mechanism that controls the
> temporary modification of the ownership/persmissions of the target (or
> root) directory at mount/umount time.

The magic is probably in the vfat filesystem driver itself.  I'm not
aware of anything comparable in ext*.

Aside from the fact that is automagically works the way you want for the
vfat case, what you have is essentially a standard permissions problem.
So how do you want it to work for other users?  Would everyone have
their own external drive?  If so, you could make sure they own the
partition's root on each drive.  If all the backups are to the same
drive, you could make the partition root world-writable and sticky, so
that each user can create their own directory and backup to there.

If you can provide more specifics about how you want this to work, I'm
sure the list can provide some suggestions.


HTH,
rick
-




More information about the svlug mailing list