mounting ext2 drive as different user than root

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: der.hans
Date:  
Subject: mounting ext2 drive as different user than root
Am 07. Sep, 2003 schw=E4tzte Jeff Barker so:

> Is it possible to mount an ext2 drive in fstab as a different user than
> root? uid=3Dmyuser doesn't work as it does with vfat.


Do you want a non-root user to own the drive or do you just want to give
non-root users the ability to mount/unmount the drive similar to how CDROMs
are usually setup?

       (iii) Normally, only the superuser can mount  file  systems.  Howeve=
r,
       when  fstab  contains the user option on a line, then anybody can mo=
unt
       the corresponding system.


That's from the mount man page.

Further down I see the following two entries:

              user   Allow an ordinary user to mount  the  file  system.  T=
he
                     name  of  the mounting user is written to mtab so that=
 he
                     can unmount the file system again.  This  option impli=
es
                     the  options noexec, nosuid, and nodev (unless overrid=
den
                     by  subsequent   options,   as   in   the   option lin=
e
                     user,exec,dev,suid).


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



Still further down is "Mount options for ext2". Looks like you can't set ui=
d
when mounting ext2 partitions. Look at grpid to see if that'll do what you
need.

> I'm trying to set up samba and share 3 large drives to windows machines
> on my local network and I keep getting the permission denied error. I
> believe it is because the owner and group are both root on the drive
> with 700 permissions.


You can change the ownership on the device, e.g.

chown fred:users /dev/hdb2

Generally not a good idea, but it might be what you need.

> I've been trying to figure this out all day. I've read the fstab and
> mount man pages as well as samba smb.conf docs without success. If its
> not possible to mount it with anyone other than root then that is fine
> if I can make it so samba will share the thing out with write
> permissions to all users. I've gotten the vfat drives to share in samba
> and be writeable using a guest account only, but not a user (other than
> setting the guest account in samba equal to that user)


You want to share the drive read-only via samba? That should be configurabl=
e
in samba.

ciao,

der.hans
--=20
#  https://www.LuftHans.com/    http://www.AZOTO.org/
#  Take a razor to your throat
#  and a noose to your neck,
#  then follow that up with a cup of poison.
#  Not a good way to start the day. - der.hans