Struggling with fstab

I’m really struggling to understand my fstab file, I would like to mount the nfs so that all users can edit the directories (rw) but I seem to get ‘root:root’.

My fstab file:  /mnt/plex/media/tv  nfs  nofail defaults 0  0
Asked By: Dan Daley


nfs permissions are (mostly) controlled by the server, not the client.

So you have to change permissions on the server, not change the mount on the client.

Although, you need to get the mount right on the client first before you can access anything. As stated in the comments, your fstab line is wrong. A correct fstab line has exactly 6 fields, separated by whitespace. You have 7 fields there, as the 4th field (options) is split and should have a comma instead of whitespace separating the options.

Answered By: user10489

In your current fstab entry, you’re mounting the NFS share from IP address, specifically the directory "/volume1/Barry/Plex/tv". The mount point you’ve chosen is "/mnt/plex/media/tv". Now, your goal is to ensure that all users have read and write permissions, rather than just the root user.

To achieve this, we need to specify the appropriate options in the fstab entry. In your case, you’ll want to add the "rw" option, which stands for "read-write." This will grant read and write permissions to all users, just as you desire.

To modify your fstab entry, here’s the updated line you can use: /mnt/plex/media/tv nfs rw,nofail,defaults 0 0

By adding "rw" after "nfs," you’re ensuring that all users can edit the directories. The "nofail" option will prevent the system from halting the boot process if the NFS share isn’t available during startup. The "defaults" option includes some commonly used options like "rw," "hard," "intr," and "tcp."

Once you’ve made the changes, save the fstab file and exit the editor. To apply the changes, you can either reboot your system or run the following command:

sudo mount -a

This command will remount all filesystems listed in the fstab file, including your modified NFS mount. Now, all users should have read and write access to the directories within the NFS share.

Answered By: skh

You’ve got the nfs share mounted but it’s showing as root, which ain’t what you’re after. You want all your users to be able to mess with it, right? So, we’ll want to add a couple of options to that nfs mount in your fstab file.

Your fstab line should look something like this: /mnt/plex/media/tv nfs defaults,nofail,noatime,nolock,intr,tcp,actimeo=1800,rw,sec=sys,async 0 0

These options will do the trick for you:

  • rw: stands for read-write, allowing all your users to read and write data to the mounted NFS share.
  • sec=sys: This bit sets the security flavor for NFS to sys, meaning it uses local UNIX UIDs and GIDs.

A couple of others while we’re at it:

  • noatime: This speeds things up a smidge by stopping the system from logging access times whenever a file is read.
  • nolock: In a local network, locks are not really needed. So this one turns off locking (which can slow things down).
  • intr: If the server does not respond, this allows NFS calls to be interrupted.
  • tcp: To enforce TCP protocol instead of UDP, for better reliability.
  • actimeo=1800: This one is for caching. It means after 1800 seconds, the client will refresh its cache from the NFS server to make sure it’s looking at the latest version of the data.

After you update that line, you’ll want to run this command to make the changes take effect:

sudo mount -a

This’ll give the system a good kick and mount everything in your fstab file.

Remember, though, keep a backup of your original fstab file before messing with it. It’s like your mum always said: "Better safe than sorry."

Answered By: del

The issue with your fstab file is that the default permissions for the mount are ‘root:root’, which means that only the root user can edit the directories. To allow all users to edit the directories, you need to change the permissions to ‘user:user’. You can do this by adding the ‘user’ mount option to your fstab file.

Here is the updated fstab file:  /mnt/plex/media/tv  nfs  nofail defaults,user 0  0

Once you have updated your fstab file, you need to restart your computer or run the mount -a command to mount the NFS share.

Here are the steps in more detail:

  1. Open the fstab file in a text editor.
  2. Add the ‘user’ mount option to the line for the NFS share.
  3. Save the fstab file.
  4. Restart your computer or run the mount -a command.

Once you have completed these steps, all users should be able to edit the directories on the NFS share.

Answered By: kba
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.