Hot answers tagged

38

Does your export utilize root_squash? From the CentOS docs: root_squash — Prevents root users connected remotely from having root privileges and assigns them the user ID for the user nfsnobody. This effectively "squashes" the power of the remote root user to the lowest local user, preventing unauthorized alteration of files on the remote server. ...


38

Setting up the Linux server Install the NFS server as per the Ubuntu NFS guide: sudo apt install nfs-kernel-server Edit /etc/exports: sudo nano /etc/exports Now add a line similar to this: /home/ubuntu 172.16.238.0/24(insecure,rw,all_squash,anonuid=1000,anongid=1000,no_subtree_check) /home/ubuntu is the directory to export 172.16.238.0/24 is the IP ...


37

This is what idmapping is suppose to do. First of all, enable is on the client and server: # echo N > /sys/module/nfs/parameters/nfs4_disable_idmapping clean idmap cache and restart idmap daemon: # nfsidmap -c # service rpcidmapd restart Now on server and the client will send instead of numeric IDs string principals like bob@YOURDOMAIN.COM. You need ...


29

NFS is fine, barring some specific other criteria are met, namely: The systems involved are both able to use NFS natively. Windows doesn't count here, it kind of works, but it's got a lot of quirks and is often a pain to work with when dealing with NFS in a cross-platform environment (and if it's just Windows, use SMB3, it eliminates most of the other ...


28

This was bugging me for months, and I finally found a fix, if you're using Sublime Text (I'm on ST3). Check to see if it's using atomic saves — they were causing this issue for me. To your Preferences.sublime-settings file, (Sublime Text > Preferences > Settings- User) add this: { "atomic_save": false } This fixed the cached file-size NFS issue for us....


23

The order of reboots is important. Rebooting the server after the clients can result in this situation. The stale NFS handle indicates that the client has a file open, but the server no longer recognizes the file handle. In some cases, NFS will cleanup its data structures after a timeout. In other cases, you will need to clean the NFS data structures ...


22

An note to add to this for google searchers - we had the same issue where no matter what we did, the nfs mount would not map the user ids correctly. The issue was idmapd had cached the incorrect ids from the faulty configuration, and no fixing of the configuration would sort it. The command on centos to fix this was nfsidmap -c (clear cache). Hopefully ...


22

I found useful directions for my problem on this page, but there was no easy to follow recipe. So here's my recipe. TL;DR - need to allow both nfs ports (111, 2049) and mountd port after fixing it. Instructions: Setting up a fixed port for mountd gksudo gedit /etc/default/nfs-kernel-server comment out this line: RPCMOUNTDOPTS=--manage-gids add this ...


18

You can use the mountpoint command to ensure the mount has taken place before you execute your command e.g. (assuming /abs is the mount point) #!/bin/bash while true do if mountpoint -q /abs then /usr/bin/python /abs/path/to/script.py break fi sleep 10 done


18

sync and async have different meanings for the two different situations. sync in the client context makes all writes to the file be committed to the server. async causes all writes to the file to not be transmitted to the server immediately, usually only when the file is closed. So another host opening the same file is not going to see the changes made by ...


17

SMB 3.xx has a better tuned performance over "generic" TCP connectivity and has features like RDMA and multichannel support Microsoft didn't implement with "their" (actually - licensed) NFS client.


17

NFS is absolutely OK and is preferred over iSCSI due to the fact NFS is much easier to manage, share and backup.


13

How about using ovftool to copy the templates directly between hosts? I have used this for VMs before, and it works pretty well. Not sure if that also works for templates, but if not then you can just covert the templates temporarily to VMs for copying them. Instructions, with an example are here. You could also use ovftool to convert your templates to ....


12

No one has mentioned sshfs yet. If you're on a modern linux distro and have ssh access to the remote host, it's as simple as: sshfs user@hostname:/remote/directory /local/directory Performance is quite acceptable (but not nearly as fast as a streamed sync like rsync if you require the whole directory).


12

'Read-only file system' error indicates that the file system is exported as read only. The rw mount option tells client that 'WRITE' is allowed to be sent to the server. On regular unix systems, check /etc/exports file: /NFS2 172.x.y.z(rw) on appliances, check the documentation to export as read-write.


12

You basically have it. User vs Machine vs Share Authentication SMB/CIFS bases access on user credentials of some sort (whether they be KRB tokens, user/password pairs, or what have you) per session where each session is mapped to one user. NFSv3 uses host-based authentication where all users of a given remote machine share the same connection. SMB/CIFS, ...


12

NFS: it has a partial support for sparse file. Basically, it supports creating a sparse file but, when reading, the file is expanded to include zeroes. This means that, while you can create a sparse file via NFS, when reading back that very same file the in-transit network data will include any zeroes found on the original file. A simple test show that ...


12

I found the error, i need insert username instead of user 192.168.0.1:/NASShare /mnt/NAS nfs username=administrator,password=pass 0 0


12

We've been using NFS for years to attach our SAN to our VMware ESXi servers, running hundreds of VMs on it. No trouble at all. The bottleneck is rather the storage system than the network protocol. The network connection should be fast enough of course, meaning 10Gb Ethernet or fibre. We don't even bother with a separate storage network anymore.


11

This question is related on how the network is set for your vm. By default with VirtualBox, you have NAT network. Which result in port translation. Step by step this gives : The NFS client is using a reserved port (<1024 ... that can only be opened by root -> secured) Virtualbox does the port translation (NAT) -> client port is now greater than 1024 ...


11

The manual page flock(2) had been out of date for a long time, but has since been updated to say (emphasis mine): Since Linux 2.6.12, NFS clients support flock() locks by emulating them as byte-range locks on the entire file. This means that fcntl(2) and flock() locks do interact with one another over NFS. Since Linux 2.6.37, the kernel supports ...


11

If you want any user on 10.0.5.10 to appear as root you want to do this: /STORAGE 10.0.5.10(rw,sync,no_subtree_check,all_squash,anonuid=0,anongid=0) all_squash tells NFS that for any user connecting from 10.0.5.10, ignore their actual UID/GID and instead treat them as if UID=anonuid and GID=anongid. Since you set anonuid=0,anongid=0 that gives all users on ...


11

I would tend to think of these as different environments.


10

I've just had the same problem in 2016, using CentOS 6.5 on my workstation, and CentOS 7 on the client (a Vagrant box on the same host). My specific problem was the same as the OP's, I couldn't find any nfsd logging. Use rpcdebug to Enable NFS Logging The answer for me, for anyone else coming to this question in the future, was to use the command (as root/...


10

The culprit is the user option you have used in /etc/fstab, and specifically that you have placed the exec option before the user option. From man mount: user: Allow an ordinary user to mount the filesystem. ... This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid)...


10

This was a bug in NFS server kernel module. It was patched in December 2013. Starting with kernel 3.14, rpcbind is no longer required to run in-kernel NFS server. (assuming that server is configured to use only NFSv4 and higher) http://lxr.free-electrons.com/source/net/sunrpc/svc.c?v=3.14#L966 You can find more information about that change in this ...


10

Unfortunately it looks like we may not get to the bottom of what the application was, but to get some value from this incident, I wanted to create a reference answer. This is VMware and virtual layer management centric. A lot of admins are in segregated, and cannot get guest or storage access quickly, and this is for them :) http://support.seagate.com/...


10

NFS Yes, NFS 4.2 fully supports sparse files (see this canonical document and this presentation). Prior to NFS 4.2, the NFS client/server model supported sparse files in the sense that the API supported all POSIX file operations. This meant that writing sparse files on a server which supported sparse files on the backing file system resulted in a sparse ...


10

We really expect question-askers to have done at least a bit of homework first to be honest, anyway here we go. NFS is a file-sharing protocol, it doesn't define anything about the underlying filesystem at all, simply the protocol of how to access files on it. Ceph is a distributed filesystem AND sharing mechanism, it defines how the data is stored on one ...


9

If your mounted points are permanent- placed in /etc/fstab - you can run mount -a to re-read fstab, which is same as a refresh. You could also use remount in case of a temporary mount


Only top voted, non community-wiki answers of a minimum length are eligible