4

I had a requirement to mount a NFS. After several trial and errors, I could mount a NFS file system from NAS on my Linux system. We were also evaluating if cifs can be used when NFS does not work. man pages were too confusing and could not find any lucid explanation on web. My question is - if NFS is a problem can mount -t cifs be used in place ? Is cifs always available as replacement for nfs.

Rockoder
  • 746
  • 2
  • 11
  • 22
  • 1
    You'll need to ask the folks that administer your NAS. Some NAS units are capable of providing both NFS and CIFS, some only provide one or the other, or something else entirely. Even if yours can provide both, it may be configured not to. – twalberg Sep 05 '14 at 21:22
  • Thanks @twalberg. I know it's a stupid question but sometimes folks who setup NAS are no longer there. Sometimes, even physical location of NAS is also remote. In that case, how could we figure out from CLI or console ? – Rockoder Sep 07 '14 at 00:18
  • From a windows box - try opening `\\servername`. If it exists, you'll get a connection - if it doesn't, you'll get an error. – Sobrique Nov 13 '14 at 20:06
  • @Rockoder If all you have is an IP address to go on, then someone out there must have used that box for something to recommend you configure it to be used for something else. See if you can obtain access to a current client, so you can study a working config. It may provide you with answers you lack (and even orient you to questions you've not asked yet). – Edwin Buck Nov 13 '14 at 20:10
  • This is a same question I had. In my case I used cifs, for some reason nfs keeps failing even though nfs server has granted everyone to be able to mount. One thing i realised is symlinks does not work with cifs mounts – PMat May 30 '17 at 18:31

2 Answers2

5

It's hard to answer, because it depends on the server.

NFS and CIFS aren't different filesystems - they're different protocols for accessing a server side export.

Generally speaking:

  • NFS is what Unix uses, because it aligns neatly with the Unix permissions model.
  • CIFS is (generally) what Windows uses. (It uses a different permissions model too).

Key differences between the two are that CIFS operates in a user context - a user accesses a CIFS share. Where NFS operates in a host context - the host mounts an NFS filesystem, and local users permissions are mapped (in a variety of ways, depending on NFS version and authentication modes).

But because - pretty fundamentally - they use different permissioning and authorization mechanisms, you can't reliably just mount an NFS export as CIFS. It relies on the server supporting it, and handling the permission mapping. You would need to ask the person who owns that server for details.

Sobrique
  • 52,974
  • 7
  • 60
  • 101
2

CIFS is not always available (but often is). When it works, NFS works better for unixy clients than CIFS tends to be.

To see if there's CIFS on the server, use the smbclient(1) program, possibly 'smbclient -L servername'.

To use CIFS from unix, you typically need to know a user name and password for the CIFS server, and reference them in the mount command or fstab entry. You can put the password in a file that is protected and use the file for the mount.

If you don't know the CIFS server admin to get a user/pass, you have many problems.

dbrower
  • 254
  • 2
  • 9