Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Problem: After directory is auto-mounted, Web Server has no write permissions to it.

Question: How to auto-mount GlusterFS endpoint via /etc/fstab so that mount point belongs to www-data after it's mounted?

For now, the mount point belongs to www-data, but after mounting it turns to root.

# /etc/fstab
foo.com:/st /st glusterfs defaults 0 0

Seams like I cannot define user / group as mount options for GlusterFS, at least I don't see it when man glusterfs.

Thanks!

share|improve this question
    
Resolved - dir permission are inherited from destination directory. –  Roman Newaza Jun 26 '12 at 3:12
add comment

2 Answers

up vote 1 down vote accepted

I'm pretty sure the solution is to chown it after it is mounted. Once you've mounted it, and it's back to root:root, chown it to what you need it to be. That should persist across remounts.

share|improve this answer
    
I'm creating automated DR system. Probably, if this couldn't be done over /etc/fstab, Bash could be of help... Or Udev rule. –  Roman Newaza Jun 26 '12 at 2:44
    
I have fixed the issue. Directory permissions are inherited from destination directory. So I just changed that and it is mounted as I wanted now. –  Roman Newaza Jun 26 '12 at 3:10
add comment

You should use the options below so that when the glusterfs mount the volume the permissions are according to your needs

storage.owner-gid storage.owner-uid

ex:

gluster volume VOL-NAME set storage.owner-gid 100

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.