Modify fstab entry so all users can Read and Write to an EXT4 Volume
I have an Ubuntu 10.04 box with an EXT4 partition. This partition is set to automatically mount in /etc/fstab
. For the purposes of this post, we'll call it: /media/foo
.
Unfortunately, only root
can create/delete files/directories on the root filesystem of foo
. For other users to perform file/io on this volume, root
needs to create a directory and chmod
the permissions to others.
I would like to mount the volume such that anybody would be able to read/write to the volume without the need of root
to chmod
.
Below is my fstab
entry:
/dev/sda8 /media/foo ext4 rw,user,exec 0 0
The entry originally had defaults
instead of rw,user,exec
. I added the additional entries, namely, rw
so any user can read/write.
Unfortunately, the fstab
entry does not work. It mounts fine, but it still requires root
to intervene.
And, just in case anybody asks, simply running: chmod -R 777 *
on /media/foo
as root
does not work.
linux permissions mount ext4 fstab
add a comment |
I have an Ubuntu 10.04 box with an EXT4 partition. This partition is set to automatically mount in /etc/fstab
. For the purposes of this post, we'll call it: /media/foo
.
Unfortunately, only root
can create/delete files/directories on the root filesystem of foo
. For other users to perform file/io on this volume, root
needs to create a directory and chmod
the permissions to others.
I would like to mount the volume such that anybody would be able to read/write to the volume without the need of root
to chmod
.
Below is my fstab
entry:
/dev/sda8 /media/foo ext4 rw,user,exec 0 0
The entry originally had defaults
instead of rw,user,exec
. I added the additional entries, namely, rw
so any user can read/write.
Unfortunately, the fstab
entry does not work. It mounts fine, but it still requires root
to intervene.
And, just in case anybody asks, simply running: chmod -R 777 *
on /media/foo
as root
does not work.
linux permissions mount ext4 fstab
add a comment |
I have an Ubuntu 10.04 box with an EXT4 partition. This partition is set to automatically mount in /etc/fstab
. For the purposes of this post, we'll call it: /media/foo
.
Unfortunately, only root
can create/delete files/directories on the root filesystem of foo
. For other users to perform file/io on this volume, root
needs to create a directory and chmod
the permissions to others.
I would like to mount the volume such that anybody would be able to read/write to the volume without the need of root
to chmod
.
Below is my fstab
entry:
/dev/sda8 /media/foo ext4 rw,user,exec 0 0
The entry originally had defaults
instead of rw,user,exec
. I added the additional entries, namely, rw
so any user can read/write.
Unfortunately, the fstab
entry does not work. It mounts fine, but it still requires root
to intervene.
And, just in case anybody asks, simply running: chmod -R 777 *
on /media/foo
as root
does not work.
linux permissions mount ext4 fstab
I have an Ubuntu 10.04 box with an EXT4 partition. This partition is set to automatically mount in /etc/fstab
. For the purposes of this post, we'll call it: /media/foo
.
Unfortunately, only root
can create/delete files/directories on the root filesystem of foo
. For other users to perform file/io on this volume, root
needs to create a directory and chmod
the permissions to others.
I would like to mount the volume such that anybody would be able to read/write to the volume without the need of root
to chmod
.
Below is my fstab
entry:
/dev/sda8 /media/foo ext4 rw,user,exec 0 0
The entry originally had defaults
instead of rw,user,exec
. I added the additional entries, namely, rw
so any user can read/write.
Unfortunately, the fstab
entry does not work. It mounts fine, but it still requires root
to intervene.
And, just in case anybody asks, simply running: chmod -R 777 *
on /media/foo
as root
does not work.
linux permissions mount ext4 fstab
linux permissions mount ext4 fstab
edited May 12 '11 at 15:08
studiohack♦
11.3k1880114
11.3k1880114
asked Aug 11 '10 at 16:35
PhantoPhanto
5943816
5943816
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
The mount option user
only allows the filesystem to be mounted by any user. The rw
option makes the filesystem not readonly. You will have to use permissions to make the parent directory writeable.
chmod 777 /media/foo
The chmod
command you show only affects the existing files within /media/foo
.
2
What is the best place in Ubuntu to add this command at startup?
– Ivan Balashov
Aug 18 '14 at 13:35
@IvanBalashov: You can use an@reboot
entry in/etc/crontab
among other possibilities.
– Dennis Williamson
Aug 18 '14 at 15:19
2
@DennisWilliamson Thanks. I've put it into/etc/rc.local
if it makes any difference. What bugs me overall about this though, is that it really should be configured infstab
. If not, mount point can change, and scripts have to change too, maintenance hell.
– Ivan Balashov
Aug 18 '14 at 16:16
Wow, i must start to guess those things :D thank you a lot.
– erm3nda
May 29 '15 at 15:11
1
Agree with the chmod, but add a: chmod +t /media/foo to enable users to create their own subdirectory
– user1251840
Mar 10 '17 at 11:25
add a comment |
I think it would be simpler to change the fstab entry to:
/dev/sda8 /media/foo ext4 rw,user,exec,umask=000 0 0
umask=000
means that anyone can read, write or execute any file or directory in foo.
The usual default is 022, which means that users cannot write.
28
umask is only an option for ntfs/vfat partitions. mount will not like umask on an ext filesystem.
– Daniel
Sep 14 '12 at 1:07
add a comment |
I had the same problem on openSUSE, but I think the solution can apply to this too.
All the users I want to share the mounted filesystem belong to the same primary group: users
I have the following line in my fstab:
/dev/<partition> <mount_point> ext4 rw,acl 0 0
and I ran the following commands:
sudo chgrp -R users <mount_point>
sudo setfacl -d -m g::rwx <mount_point>
so that newly created files or directories get those permissions.
This implies that you have the acl package installed.
If it is an encrypted directory say/home
will this be mounted in the/etc/crypttab
?
– George Udosen
Feb 5 '17 at 18:17
add a comment |
Well for one thing, you want to make sure the directory of /media/foo itself is writeable. If it isn't already, run the following command:
chmod +w /media/foo
Remember, star only applies to the visible contents of the directory, not the directory itself nor any files that are not visible.
add a comment |
Try,
sudo setfacl -R -d -m u::rwx,g::rwx,o::rwx <mount_point>
add a comment |
A few years ago I have set the mount point's group to the plugdev group, added the user to that group. This way, by creating new groups, it is possible to give permissions on a per user basis. For home usage, it's enough to set mount point permissions to others: read/write/execute as written above.
I did it with 'sudo nautilus &' in terminal and right click -> properties -> rights, but any other file manager running as root would be fine.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f174776%2fmodify-fstab-entry-so-all-users-can-read-and-write-to-an-ext4-volume%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
The mount option user
only allows the filesystem to be mounted by any user. The rw
option makes the filesystem not readonly. You will have to use permissions to make the parent directory writeable.
chmod 777 /media/foo
The chmod
command you show only affects the existing files within /media/foo
.
2
What is the best place in Ubuntu to add this command at startup?
– Ivan Balashov
Aug 18 '14 at 13:35
@IvanBalashov: You can use an@reboot
entry in/etc/crontab
among other possibilities.
– Dennis Williamson
Aug 18 '14 at 15:19
2
@DennisWilliamson Thanks. I've put it into/etc/rc.local
if it makes any difference. What bugs me overall about this though, is that it really should be configured infstab
. If not, mount point can change, and scripts have to change too, maintenance hell.
– Ivan Balashov
Aug 18 '14 at 16:16
Wow, i must start to guess those things :D thank you a lot.
– erm3nda
May 29 '15 at 15:11
1
Agree with the chmod, but add a: chmod +t /media/foo to enable users to create their own subdirectory
– user1251840
Mar 10 '17 at 11:25
add a comment |
The mount option user
only allows the filesystem to be mounted by any user. The rw
option makes the filesystem not readonly. You will have to use permissions to make the parent directory writeable.
chmod 777 /media/foo
The chmod
command you show only affects the existing files within /media/foo
.
2
What is the best place in Ubuntu to add this command at startup?
– Ivan Balashov
Aug 18 '14 at 13:35
@IvanBalashov: You can use an@reboot
entry in/etc/crontab
among other possibilities.
– Dennis Williamson
Aug 18 '14 at 15:19
2
@DennisWilliamson Thanks. I've put it into/etc/rc.local
if it makes any difference. What bugs me overall about this though, is that it really should be configured infstab
. If not, mount point can change, and scripts have to change too, maintenance hell.
– Ivan Balashov
Aug 18 '14 at 16:16
Wow, i must start to guess those things :D thank you a lot.
– erm3nda
May 29 '15 at 15:11
1
Agree with the chmod, but add a: chmod +t /media/foo to enable users to create their own subdirectory
– user1251840
Mar 10 '17 at 11:25
add a comment |
The mount option user
only allows the filesystem to be mounted by any user. The rw
option makes the filesystem not readonly. You will have to use permissions to make the parent directory writeable.
chmod 777 /media/foo
The chmod
command you show only affects the existing files within /media/foo
.
The mount option user
only allows the filesystem to be mounted by any user. The rw
option makes the filesystem not readonly. You will have to use permissions to make the parent directory writeable.
chmod 777 /media/foo
The chmod
command you show only affects the existing files within /media/foo
.
answered Aug 11 '10 at 16:49
Dennis WilliamsonDennis Williamson
77.2k14130167
77.2k14130167
2
What is the best place in Ubuntu to add this command at startup?
– Ivan Balashov
Aug 18 '14 at 13:35
@IvanBalashov: You can use an@reboot
entry in/etc/crontab
among other possibilities.
– Dennis Williamson
Aug 18 '14 at 15:19
2
@DennisWilliamson Thanks. I've put it into/etc/rc.local
if it makes any difference. What bugs me overall about this though, is that it really should be configured infstab
. If not, mount point can change, and scripts have to change too, maintenance hell.
– Ivan Balashov
Aug 18 '14 at 16:16
Wow, i must start to guess those things :D thank you a lot.
– erm3nda
May 29 '15 at 15:11
1
Agree with the chmod, but add a: chmod +t /media/foo to enable users to create their own subdirectory
– user1251840
Mar 10 '17 at 11:25
add a comment |
2
What is the best place in Ubuntu to add this command at startup?
– Ivan Balashov
Aug 18 '14 at 13:35
@IvanBalashov: You can use an@reboot
entry in/etc/crontab
among other possibilities.
– Dennis Williamson
Aug 18 '14 at 15:19
2
@DennisWilliamson Thanks. I've put it into/etc/rc.local
if it makes any difference. What bugs me overall about this though, is that it really should be configured infstab
. If not, mount point can change, and scripts have to change too, maintenance hell.
– Ivan Balashov
Aug 18 '14 at 16:16
Wow, i must start to guess those things :D thank you a lot.
– erm3nda
May 29 '15 at 15:11
1
Agree with the chmod, but add a: chmod +t /media/foo to enable users to create their own subdirectory
– user1251840
Mar 10 '17 at 11:25
2
2
What is the best place in Ubuntu to add this command at startup?
– Ivan Balashov
Aug 18 '14 at 13:35
What is the best place in Ubuntu to add this command at startup?
– Ivan Balashov
Aug 18 '14 at 13:35
@IvanBalashov: You can use an
@reboot
entry in /etc/crontab
among other possibilities.– Dennis Williamson
Aug 18 '14 at 15:19
@IvanBalashov: You can use an
@reboot
entry in /etc/crontab
among other possibilities.– Dennis Williamson
Aug 18 '14 at 15:19
2
2
@DennisWilliamson Thanks. I've put it into
/etc/rc.local
if it makes any difference. What bugs me overall about this though, is that it really should be configured in fstab
. If not, mount point can change, and scripts have to change too, maintenance hell.– Ivan Balashov
Aug 18 '14 at 16:16
@DennisWilliamson Thanks. I've put it into
/etc/rc.local
if it makes any difference. What bugs me overall about this though, is that it really should be configured in fstab
. If not, mount point can change, and scripts have to change too, maintenance hell.– Ivan Balashov
Aug 18 '14 at 16:16
Wow, i must start to guess those things :D thank you a lot.
– erm3nda
May 29 '15 at 15:11
Wow, i must start to guess those things :D thank you a lot.
– erm3nda
May 29 '15 at 15:11
1
1
Agree with the chmod, but add a: chmod +t /media/foo to enable users to create their own subdirectory
– user1251840
Mar 10 '17 at 11:25
Agree with the chmod, but add a: chmod +t /media/foo to enable users to create their own subdirectory
– user1251840
Mar 10 '17 at 11:25
add a comment |
I think it would be simpler to change the fstab entry to:
/dev/sda8 /media/foo ext4 rw,user,exec,umask=000 0 0
umask=000
means that anyone can read, write or execute any file or directory in foo.
The usual default is 022, which means that users cannot write.
28
umask is only an option for ntfs/vfat partitions. mount will not like umask on an ext filesystem.
– Daniel
Sep 14 '12 at 1:07
add a comment |
I think it would be simpler to change the fstab entry to:
/dev/sda8 /media/foo ext4 rw,user,exec,umask=000 0 0
umask=000
means that anyone can read, write or execute any file or directory in foo.
The usual default is 022, which means that users cannot write.
28
umask is only an option for ntfs/vfat partitions. mount will not like umask on an ext filesystem.
– Daniel
Sep 14 '12 at 1:07
add a comment |
I think it would be simpler to change the fstab entry to:
/dev/sda8 /media/foo ext4 rw,user,exec,umask=000 0 0
umask=000
means that anyone can read, write or execute any file or directory in foo.
The usual default is 022, which means that users cannot write.
I think it would be simpler to change the fstab entry to:
/dev/sda8 /media/foo ext4 rw,user,exec,umask=000 0 0
umask=000
means that anyone can read, write or execute any file or directory in foo.
The usual default is 022, which means that users cannot write.
edited Apr 15 '11 at 14:30
3498DB
15.8k114762
15.8k114762
answered Apr 14 '11 at 15:57
somebodysomebody
25522
25522
28
umask is only an option for ntfs/vfat partitions. mount will not like umask on an ext filesystem.
– Daniel
Sep 14 '12 at 1:07
add a comment |
28
umask is only an option for ntfs/vfat partitions. mount will not like umask on an ext filesystem.
– Daniel
Sep 14 '12 at 1:07
28
28
umask is only an option for ntfs/vfat partitions. mount will not like umask on an ext filesystem.
– Daniel
Sep 14 '12 at 1:07
umask is only an option for ntfs/vfat partitions. mount will not like umask on an ext filesystem.
– Daniel
Sep 14 '12 at 1:07
add a comment |
I had the same problem on openSUSE, but I think the solution can apply to this too.
All the users I want to share the mounted filesystem belong to the same primary group: users
I have the following line in my fstab:
/dev/<partition> <mount_point> ext4 rw,acl 0 0
and I ran the following commands:
sudo chgrp -R users <mount_point>
sudo setfacl -d -m g::rwx <mount_point>
so that newly created files or directories get those permissions.
This implies that you have the acl package installed.
If it is an encrypted directory say/home
will this be mounted in the/etc/crypttab
?
– George Udosen
Feb 5 '17 at 18:17
add a comment |
I had the same problem on openSUSE, but I think the solution can apply to this too.
All the users I want to share the mounted filesystem belong to the same primary group: users
I have the following line in my fstab:
/dev/<partition> <mount_point> ext4 rw,acl 0 0
and I ran the following commands:
sudo chgrp -R users <mount_point>
sudo setfacl -d -m g::rwx <mount_point>
so that newly created files or directories get those permissions.
This implies that you have the acl package installed.
If it is an encrypted directory say/home
will this be mounted in the/etc/crypttab
?
– George Udosen
Feb 5 '17 at 18:17
add a comment |
I had the same problem on openSUSE, but I think the solution can apply to this too.
All the users I want to share the mounted filesystem belong to the same primary group: users
I have the following line in my fstab:
/dev/<partition> <mount_point> ext4 rw,acl 0 0
and I ran the following commands:
sudo chgrp -R users <mount_point>
sudo setfacl -d -m g::rwx <mount_point>
so that newly created files or directories get those permissions.
This implies that you have the acl package installed.
I had the same problem on openSUSE, but I think the solution can apply to this too.
All the users I want to share the mounted filesystem belong to the same primary group: users
I have the following line in my fstab:
/dev/<partition> <mount_point> ext4 rw,acl 0 0
and I ran the following commands:
sudo chgrp -R users <mount_point>
sudo setfacl -d -m g::rwx <mount_point>
so that newly created files or directories get those permissions.
This implies that you have the acl package installed.
answered Oct 22 '11 at 11:33
dariodario
18123
18123
If it is an encrypted directory say/home
will this be mounted in the/etc/crypttab
?
– George Udosen
Feb 5 '17 at 18:17
add a comment |
If it is an encrypted directory say/home
will this be mounted in the/etc/crypttab
?
– George Udosen
Feb 5 '17 at 18:17
If it is an encrypted directory say
/home
will this be mounted in the /etc/crypttab
?– George Udosen
Feb 5 '17 at 18:17
If it is an encrypted directory say
/home
will this be mounted in the /etc/crypttab
?– George Udosen
Feb 5 '17 at 18:17
add a comment |
Well for one thing, you want to make sure the directory of /media/foo itself is writeable. If it isn't already, run the following command:
chmod +w /media/foo
Remember, star only applies to the visible contents of the directory, not the directory itself nor any files that are not visible.
add a comment |
Well for one thing, you want to make sure the directory of /media/foo itself is writeable. If it isn't already, run the following command:
chmod +w /media/foo
Remember, star only applies to the visible contents of the directory, not the directory itself nor any files that are not visible.
add a comment |
Well for one thing, you want to make sure the directory of /media/foo itself is writeable. If it isn't already, run the following command:
chmod +w /media/foo
Remember, star only applies to the visible contents of the directory, not the directory itself nor any files that are not visible.
Well for one thing, you want to make sure the directory of /media/foo itself is writeable. If it isn't already, run the following command:
chmod +w /media/foo
Remember, star only applies to the visible contents of the directory, not the directory itself nor any files that are not visible.
edited Jul 14 '11 at 1:52
3498DB
15.8k114762
15.8k114762
answered Aug 11 '10 at 16:48
hoteihotei
3,55221424
3,55221424
add a comment |
add a comment |
Try,
sudo setfacl -R -d -m u::rwx,g::rwx,o::rwx <mount_point>
add a comment |
Try,
sudo setfacl -R -d -m u::rwx,g::rwx,o::rwx <mount_point>
add a comment |
Try,
sudo setfacl -R -d -m u::rwx,g::rwx,o::rwx <mount_point>
Try,
sudo setfacl -R -d -m u::rwx,g::rwx,o::rwx <mount_point>
answered Aug 20 '13 at 16:47
user247046user247046
111
111
add a comment |
add a comment |
A few years ago I have set the mount point's group to the plugdev group, added the user to that group. This way, by creating new groups, it is possible to give permissions on a per user basis. For home usage, it's enough to set mount point permissions to others: read/write/execute as written above.
I did it with 'sudo nautilus &' in terminal and right click -> properties -> rights, but any other file manager running as root would be fine.
add a comment |
A few years ago I have set the mount point's group to the plugdev group, added the user to that group. This way, by creating new groups, it is possible to give permissions on a per user basis. For home usage, it's enough to set mount point permissions to others: read/write/execute as written above.
I did it with 'sudo nautilus &' in terminal and right click -> properties -> rights, but any other file manager running as root would be fine.
add a comment |
A few years ago I have set the mount point's group to the plugdev group, added the user to that group. This way, by creating new groups, it is possible to give permissions on a per user basis. For home usage, it's enough to set mount point permissions to others: read/write/execute as written above.
I did it with 'sudo nautilus &' in terminal and right click -> properties -> rights, but any other file manager running as root would be fine.
A few years ago I have set the mount point's group to the plugdev group, added the user to that group. This way, by creating new groups, it is possible to give permissions on a per user basis. For home usage, it's enough to set mount point permissions to others: read/write/execute as written above.
I did it with 'sudo nautilus &' in terminal and right click -> properties -> rights, but any other file manager running as root would be fine.
answered Dec 18 '12 at 15:31
Doom3dDoom3d
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f174776%2fmodify-fstab-entry-so-all-users-can-read-and-write-to-an-ext4-volume%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown