mounting ext2 drive as different user than root

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jeff Barker
Date:  
Subject: mounting ext2 drive as different user than root

der.hans wrote:

>Am 07. Sep, 2003 schwätzte Jeff Barker so:
>
>
>
>>Is it possible to mount an ext2 drive in fstab as a different user than
>>root? uid=myuser 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?
>
>


I don't want anyone to be able to unmount it, there would be no reason
for that. I just want it shared to everyone on my local network and be
readable AND writeable.

>       (iii) Normally, only the superuser can mount  file  systems.  However,
>       when  fstab  contains the user option on a line, then anybody can mount
>       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.  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).

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


Yeah, I read all that. I tried both options and that doesn't give the
proper permissions to the drive, it only allows the user to unmount and
remount it. I know there's gotta be someone else who uses samba to share
a drive as a storage drive for multiple windows machines.

>
>
>>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 don't want to have to ssh in and change the ownership of a drive. I
just want it that way always from bootup. I did try that however and it
doesn't do anything. it stays root:root with drwxr-xr-x as the
permissions. Not allowing anyone to write anything there.

I will be just as happy with it being root:root as long as the windows
clients can read and write files to the drive without issues.

>
>
>>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 configurable
>in samba.
>
>

I can't find very good documentation on the smb.conf file. reading the
man page has soooo many options without very much explanation or
examples to cover each.

anyone have some good example files I can look at?