[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mounting an ext2 filesystem at mount point with specific uid, gid



On Fri, Sep 21, 2007 at 03:15:49PM +0300, anomatos@freemail.gr wrote:
> drwxr-xr-x 2 storage storage 4096 2007-09-19 17:42 store
> 
> Which is of course empty. After the mount, which is successfull, the command "ls -al /home/storage" yields:
> 
> drwxrwsr-x 10    505    505 4096 2007-09-21 16:03 store
> 
> It seems that system assigns the directory hierarchy under 'store'
> to an unknown user/groupid, for security purposes I suppose. But I
> want it to assign it to user 'storage' & group 'storage'

Who owns what is stored on the filesystem itself as user ids and group
ids (numbers). The /etc/passwd and /etc/group files are, amongst other things, maps
between user and group names and user and group ids. The reason you're
just seeing numbers is because there are no passwd or group entries to
map them into names.

> How can I do that?

You can't with a mount option. You'd need to chown them to the user
and/or group you want. This would modify the filesystem though.

Alternatively you can use adduser and addgroup to create users and
groups that map to those ids. Complications will arise if you already
have such mappings in some form.

> Although it seems a very basic administrative task, I haven't found a way to do it.

Mount options for what you're thinking of exist for some filesystems
because they have no concept of ownerships themselves. ext2 does and so
such options do not exist.

-- 
    "To the extent that we overreact, we proffer the terrorists the
    greatest tribute."
    	- High Court Judge Michael Kirby



Reply to: