mounting ext2 drive as different user than root

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kurt Granroth
Date:  
New-Topics: mounting ext2 drive as different user than root / samba
Subject: mounting ext2 drive as different user than root
On Sunday, September 7, 2003, at 10:42 PM, Jeff Barker wrote:
> 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.

[snip]
> 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.


Yes, that's pretty much samba's entire reason for being. I've shared
many a Linux drive to Windows machines using it.

There are a number of gotcha's that you have to look out for.

First, don't bother trying to mount or unmount any of the ext drives as
any particular permissions. It doesn't matter. What matters is the
permissions of all the files and directories on the drive. As long as
all of the files and directories are world read and writeable, then
everything will be fine.... well, it will be if you also remember to
set 'public = yes' and 'read only = no' in your smb.conf file.

Second, if you start out the drive with all directories 777 and all
files 666, then things should be fine at first.. until the first person
on a Windows machine writes to the drive. Then, the inherited
permissions of the logged in samba user starts to take precedence. I
know that in various times, I solved this problem in a few different
ways. Once, when I was also exporting the drive via NFS, I resorted to
having a cron job do a chmod -R 777 every so often. Another time, when
the drive was *only* used as a Windows Share, I mapped all incoming
uids and guids to the same thing.