This should be a quick and easy one for you guys.
My computer has 3 disk drives:
- 256GB ssd (root and swap partitions)
- 60GB ssd (ext4)
- 2TB hdd (ext4)
I want to automatically mount the two extra drives at boot and I want all users to be able to read/write/execute on them. To this end, I added the following lines to
/dev/sdb1 /mnt/vertex ext4 defaults,users,noatime 0 0
/dev/sdc1 /mnt/cuda ext4 defaults,users,noatime 0 0
From what I’ve read about
fstab, I thought this should work but it doesn’t. After rebooting or running
sudo mount -a, the drives successfully mount but I cannot write to them as any user other than root.
Thinking this must because I created the dirs in
/mnt as root, I created dirs in my home dir, and added these as the mount points in
fstab. But the result is the same, at boot or by using
sudo mount -a, the drives are mounted but cannot be written to without superuser privilege.
I also tried leaving the drives out of the fstab completely. Then I tried mounting them through the file manager (thunar). Even here, the result is the same, root takes ownership of the mount point and I cannot write to the drive.
I’ve read at least a dozen tutorials and fstab wikis. I have no idea why this won’t work.
At the moment the only way I can write to these drives is to run
chown on the mount points. But I would like to avoid having to run this command every time I start my computer!
I might be wrong, but I believe the correct option to permit all users to mount the file system is ‘user’.
The result is the same if I change the option to
user. When I log in, the directories/mount points are owned by root. I tried manually unmounting and re-mounting: when I unmount, the dir ownership returns to root, when I mount, ownership changes to root and I cannot write to the drive.
If I leave the lines out of the fstab completely. When I log in, the drives are listed in the file manager (thunar). Clicking on them to mount results in the same problem - they are owned by root and I cannot write to them.
The only way I can write to them is if I use
chown to change owners to myself. But I want to avoid having to do this every time I start the computer.
You have to set the rights of the partitions as user.
sudo chown -Rc $USER: /mnt/vertex/UUID/
sudo chown -Rc $USER: /mnt/cuda/UUID/
You can find out the UUID of the partition with
You only have to change that once!
There are a few ways.
sudo chmod -R ugo+rwx /mountpoint # this allows anyone to read, write, execute
sudo chown -R $USER:users /mountpoint # assuming users is a group that contains all users and that appropriate permissions have been set for that group
- Access control lists.
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.