+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
*nix Thread, Mount a windows share in FreeBSD/Unix permanently? in Technical; Using mount_smbfs how would i go about permanently mounting a windows share abcd for instance onto the unix box? Wes...
  1. #1
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Walsall
    Posts
    2,010
    Blog Entries
    1
    Thank Post
    194
    Thanked 48 Times in 42 Posts
    Rep Power
    25

    Mount a windows share in FreeBSD/Unix permanently?

    Using mount_smbfs how would i go about permanently mounting a windows share abcd for instance onto the unix box?


    Wes

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,272
    Blog Entries
    2
    Thank Post
    595
    Thanked 877 Times in 615 Posts
    Rep Power
    277

    Re: Mount a windows share in FreeBSD/Unix permanently?

    Using /etc/fstab. Something like this.

  3. #3
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Walsall
    Posts
    2,010
    Blog Entries
    1
    Thank Post
    194
    Thanked 48 Times in 42 Posts
    Rep Power
    25

    Re: Mount a windows share in FreeBSD/Unix permanently?

    I've manage to get it all working with the mounted share to a windows box however when I try and run moodle it brings up time after time a session has timed out message which happens when the permissions on the directory are incorrect I have however made sure that this is not the case with the moodle user having full access to the shared area but it still brings this up do you have any ideas why this may be the case?

    Wes

  4. #4


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    3,598
    Thank Post
    617
    Thanked 596 Times in 462 Posts
    Rep Power
    145

    Re: Mount a windows share in FreeBSD/Unix permanently?

    Wes - directory mask errors?

    FWIW, my (linux) fstab contains lines such as:
    //sotonfs/world /mnt/shares/soton smbfs credentials=/root/smb.soton,dmask=777,fmask=666 0 0

    where /root/smb.soton is (passwords blanked out!)
    username = tom
    password = #######

  5. #5

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,272
    Blog Entries
    2
    Thank Post
    595
    Thanked 877 Times in 615 Posts
    Rep Power
    277

    Re: Mount a windows share in FreeBSD/Unix permanently?

    Don't know to be exact... are you sure that the user that apache runs under can access the mountpoint? IIRC, the mount point will need the permissions applied to it before mounting anything.

  6. #6
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Walsall
    Posts
    2,010
    Blog Entries
    1
    Thank Post
    194
    Thanked 48 Times in 42 Posts
    Rep Power
    25

    Re: Mount a windows share in FreeBSD/Unix permanently?

    webman yep you're right the www user can't write to the share how would I add the unix user to the file permissions of the windows share say the unix box name is unix and the user is www?


    Wes

  7. #7

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,272
    Blog Entries
    2
    Thank Post
    595
    Thanked 877 Times in 615 Posts
    Rep Power
    277

    Re: Mount a windows share in FreeBSD/Unix permanently?

    To be honest I don't know what the best practice is for this with regards to system permissions and apache needing write access. I'd imagine a chown /mnt/moodledata www would do the trick (while unmounted).

    *Gets binoculars out to look for Geoff*

  8. #8


    Join Date
    Jan 2006
    Posts
    5,990
    Thank Post
    290
    Thanked 645 Times in 480 Posts
    Rep Power
    162

    Re: Mount a windows share in FreeBSD/Unix permanently?

    you shouldnt need to change perms after, they can be set during the mount

    http://samba.org/samba/docs/man/manp...mbmount.8.html

    see toms post.

    fmask=<arg>

    sets the file mask. This determines the permissions that remote files have in the local filesystem. This is not a umask, but the actual permissions for the files. The default is based on the current umask.
    dmask=<arg>

    Sets the directory mask. This determines the permissions that remote directories have in the local filesystem. This is not a umask, but the actual permissions for the directories. The default is based on the current umask.

  9. #9


    Join Date
    Jan 2006
    Posts
    5,990
    Thank Post
    290
    Thanked 645 Times in 480 Posts
    Rep Power
    162

    Re: Mount a windows share in FreeBSD/Unix permanently?

    uid=<arg>

    sets the uid that will own all files on the mounted filesystem. It may be specified as either a username or a numeric uid.
    uid=www

  10. #10

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,272
    Blog Entries
    2
    Thank Post
    595
    Thanked 877 Times in 615 Posts
    Rep Power
    277

    Re: Mount a windows share in FreeBSD/Unix permanently?

    Thanks CyberNerd, learn something new every day

  11. #11
    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    10,963
    Blog Entries
    1
    Thank Post
    104
    Thanked 422 Times in 365 Posts
    Rep Power
    109

    Re: Mount a windows share in FreeBSD/Unix permanently?

    *Gets binoculars out to look for Geoff*
    No, you need to give effective uid and guid permissions as an option to the mount command.

    Thus if I had Apache running as uid 'www-data' and guid 'nobody' and wanted it to be able to access '/var/moodledata' which was actually a mounted smbfs share sitting on '\\fserver01\moodledata' accessable with the login name of 'someuser' and a password of 'somepassword',I'd need an fstab line that looked like this:

    Code:
    //fserver01/moodledata    /var/moodledata   smbfs    defaults,user=someuser,password=somepassword,uid=www-data,gid=nobody  0       0
    Care must be taken if the remote share is writeable by anyone else. It may be necessary to set a file mask and/or directory mask (with the fmask= and dmask= options respectively). that enable the 'sticky bit'.

  12. #12
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Walsall
    Posts
    2,010
    Blog Entries
    1
    Thank Post
    194
    Thanked 48 Times in 42 Posts
    Rep Power
    25

    Re: Mount a windows share in FreeBSD/Unix permanently?

    Well that is now working thanks to you guys! Phew!


    Wes

  13. #13

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,272
    Blog Entries
    2
    Thank Post
    595
    Thanked 877 Times in 615 Posts
    Rep Power
    277

    Re: Mount a windows share in FreeBSD/Unix permanently?

    Thanks Geoff, that's handy for me too...

  14. #14
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Walsall
    Posts
    2,010
    Blog Entries
    1
    Thank Post
    194
    Thanked 48 Times in 42 Posts
    Rep Power
    25

    Re: Mount a windows share in FreeBSD/Unix permanently?

    "Care must be taken if the remote share is writeable by anyone else. It may be necessary to set a file mask and/or directory mask (with the fmask= and dmask= options respectively). that enable the 'sticky bit'."

    What could happen with this then Geoff? Sticky bit?


    Wes

  15. #15
    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    10,963
    Blog Entries
    1
    Thank Post
    104
    Thanked 422 Times in 365 Posts
    Rep Power
    109

    Re: Mount a windows share in FreeBSD/Unix permanently?

    Sadly the interaction between Samba and a Windows server isn't always entirely predictable. Depending on the NTFS permissions on the server, you could end up with files the web server can't write too or no-one else can read. You can force the issue with the fmask and dmask options.

    Alternatively, if you have a recent version of Linux, enable POSIX ACL support for your filesystem. That way, the Linux file permissions model is much closer to how Windows works.

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 10
    Last Post: 15th October 2007, 02:22 PM
  2. NIS Client FreeBSD
    By Joedetic in forum *nix
    Replies: 1
    Last Post: 14th August 2007, 11:18 PM
  3. unix and sql commands
    By danIT in forum General Chat
    Replies: 9
    Last Post: 14th February 2007, 02:19 PM
  4. Users unable to permanently delete files.
    By secman in forum Windows
    Replies: 13
    Last Post: 5th October 2006, 12:48 PM
  5. Anyone here use FreeBSD
    By E1uSiV3 in forum *nix
    Replies: 2
    Last Post: 17th September 2005, 07:15 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •