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

Re: Mount ext2/ext3 as specific user at system start?



On Wednesday 15 November 2006 19:52, Nate Bargmann wrote:
> I seem to be hitting dead ends and I'm beginning to think this isn't as
> easy as I first thought.
>
> I am putting together a box for unattended operation.  I want to mount
> an ext3 partition into the main user's home directory, I want this to
> occur automatically when all file systems are mounted at system start
> via /etc/fstab and I want the partition and all its contents owned by
> that user.  The user will not be logging in as the account is used to
> run a cron job.
>
> This seems easy enough if I make the partition vfat with the uid and
> gid mount options, but I lose the journalling and permissions
> capabilities of ext3.  Surely, there is a way to do this or a very good
> technical explanation why it can't.  ;-)
>
> /
> +home
>     +user
>         +partition          <= owned by user like any other directory
>
> Thanks!
>

IIUC, your problem might be as simple as mounting it with user or users 
option . From the manual of mount

              user   Allow  an  ordinary  user  to mount the file system.  The
                     name of the mounting user is written to mtab so  that  he
                     can  unmount  the file system again.  This option implies
                     the options noexec, nosuid, and nodev (unless  overridden
                     by   subsequent   options,   as   in   the   option  line
                     user,exec,dev,suid).

              users  Allow every user to mount and unmount  the  file  system.
                     This option implies the options noexec, nosuid, and nodev
                     (unless overridden  by  subsequent  options,  as  in  the
                     option line users,exec,dev,suid).


So your sample line in /etc/fstab will look like
/dev/sda1       /home/user/partition  auto    user,auto,exec     0       0

The above line is untested so try it only after reading all the relevant 
manual pages.

hth
raju

-- 
Kamaraju S Kusumanchi
http://www.people.cornell.edu/pages/kk288/
http://malayamaarutham.blogspot.com/



Reply to: