This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 798877

Summary: [FEAT] option to create a read-only volume
Product: [Community] GlusterFS Reporter: Amar Tumballi <amarts>
Component: glusterdAssignee: Amar Tumballi <amarts>
Status: CLOSED CURRENTRELEASE QA Contact: Rahul Hinduja <rhinduja>
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: gluster-bugs, grajaiya, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 13:40:53 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: glusterfs-3.3.0qa45-1.el6.x86_64 Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 817967    

Description Amar Tumballi 2012-03-01 02:20:34 EST
Description of problem:
Currently, one can make a mount point which is 'ro' (through -oro for mount, or --read-only for glusterfs process), but there is no way one can make a volume readonly, ie, whatever a volume exports itself is readonly.
Comment 1 Anand Avati 2012-03-14 06:37:23 EDT
CHANGE: http://review.gluster.com/2915 (mgmt/glusterd: provide an option to make a volume read-only) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 2 Gowrishankar Rajaiyan 2012-05-31 02:29:12 EDT
Node 1:
[root@dhcp201-221 ~]# gluster volume set test2 read-only on
Set volume successful
[root@dhcp201-221 ~]# 

Node 2:
[root@dhcp201-214 ~]# mount -t glusterfs dhcp201-221.englab.pnq.redhat.com:test2 /export/mount/shanks2
[root@dhcp201-214 ~]# cd /export/mount/shanks2
[root@dhcp201-214 shanks2]# touch a
touch: cannot touch `a': Read-only file system
[root@dhcp201-214 shanks2]# 
[root@dhcp201-214 ~]# umount /export/mount/shanks2

Node 1:
[root@dhcp201-221 ~]# gluster volume set test2 read-only off
Set volume successful
[root@dhcp201-221 ~]# gluster volume stop test2
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
Stopping volume test2 has been successful
[root@dhcp201-221 ~]# gluster volume start test2
Starting volume test2 has been successful
[root@dhcp201-221 ~]# 

Node 2:
[root@dhcp201-214 ~]# mount -t glusterfs dhcp201-221.englab.pnq.redhat.com:test2 /export/mount/shanks2
[root@dhcp201-214 ~]# 
[root@dhcp201-214 ~]# cd /export/mount/shanks2
[root@dhcp201-214 shanks2]# touch a
[root@dhcp201-214 shanks2]# ls -l
total 4
-rw-r--r--. 1 root root 0 May 31 04:55 a
[root@dhcp201-214 shanks2]# 

Verified in version: glusterfs-3.3.0qa45-1.el6.x86_64