How could I mount an ext4 partition and have write permission?
Solution 1:
First of, it'd be useful to check the drive's UUID by using following command:
ls -l /dev/disk/by-uuid
In my experience, I usually mount an EXT4 formatted harddrive using the defaults, and I never experienced any errors in write permissions.
My /etc/fstab
looks like the following:
UUID=004f9bfa-fb5a-438c-8a5a-dc04fa6f2d3e /media/MYCH0 auto defaults 0 0 #external hdd
if all fails, you also might try to set yourself as the owner by doing this:
sudo chown username:username /media/mountpoint
For further reference, you might want to take a look at this:
http://ubuntuforums.org/showthread.php?t=1482818
Solution 2:
This may not because of mounting problem, but of permission. You may not have sufficient permission to write on drive/folders on it or you are not the owner.
As you not provided the mount point we assume partition mounted at /media/foo
To own a directory,
Open a terminal and run sudo mkdir /media/foo/test; sudo chown $USER /media/foo/test
. Now you should be able to write inside the folder test.
If you want to write on the folder then there are two option.
1. own the data by sudo chown $USER /media/foo
.
2. Allow write for other users sudo chmod o w /media/foo
Rarely some people interested in write, read access to all content for all users, like a windows partiton in linux. Commands chmod
and chown
has an option -R
which recursively change the mode of all data under it. But it is not recommended unless you know what you do. If you use the -R on a OS's partition it may become unfunctional.
Solution 3:
Unfortunately Linux kernel enforces POSIX permission on ext2/ext3/ext4 FS.
With common group across hosts and setgid
bit or ACL you may share external volume across different hosts and keep read/write permission. One example of such setup is:
$ sudo chgrp -R sys /mnt/data/dir
$ sudo chgmod -R g+s /mnt/data/dir
$ sudo fsetacl -R -m g:sys:rwx /mnt/data/dir
$ sudo fsetacl -R -d -m g:sys:rwx /mnt/data/dir
$ sudo adduser user sys
Read more at https://unix.stackexchange.com/questions/126213/external-hard-drive-permissions-ext4/
See also Solving permission problems when using external EXT4 hard disk with multiple linux installs