Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Samba enables Linux Extensions by default, which can be checked via /proc/fs/cifs/LinuxExtensionsEnabled

On Mac OS X (10.8.5 or older) as well as older CIFS shares, mount.cifs will fail with a generic error message:

 CIFS VFS: Send error in QFSUnixInfo = -95
 CIFS VFS: cifs_read_super: get root inode failed

The workaround is to manually disable Linux extensions

$ sudo echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled

Is there an option that I can pass along to disable Linux extensions, such as

$ mount -t cifs -o linuxextensions=n .....

Or can I disable it on boot automatically?

share|improve this question

2 Answers 2

The answer lies in the Samba manual

nounix Disable the CIFS Unix Extensions for this mount. This can be useful in order to turn off multiple settings at once. This includes POSIX acls, POSIX locks, POSIX paths, symlink support and retrieving uids/gids/mode from the server. This can also be useful to work around a bug in a server that supports Unix Extensions.

See section INODE NUMBERS for more information.

The terms "Linuxextensions" and "nounix" does not seem to refer to the same thing, but they actually do.

share|improve this answer

One approach would be to use automounts to automatically mount & unmounts the CIFS shares. This would allow them to be mounted when used and then unmounted after a period of inactivity.

This is a RedHat guide but should be adaptable to MacOSX, titled: 18.3. autofs.

Example

After installing autofs you'll need to add an entry to the file /etc/auto.master:

/somemount          /etc/auto.mymounts --timeout=600 --ghost

Then add an entry to the mymounts file, /etc/auto.mymounts:

t                  -fstype=cifs,rw,noperm,netbiosname=${HOST},credentials=/etc/cifsserver_credentials.txt ://cifsserver/t

Lastly you'll need to add an entry in the credentials file, /etc/cifsserver_credentials.txt:

username=someuser
password=somepass

Now start up autofs. This is going to create a mountpoint /somemount with a mount under it, t. The mount t will get mounted automatically anytime someone accesses it. After 5 minutes of inactivity the mount will be dropped. Accessing it again will remount it.

This is a highlevel guide, there are bound to be details I've left out, but just to give you a rough idea of how to do it.

share|improve this answer
    
Thanks for your help. Turns out to be the nounix option. :) –  hanxue Oct 16 '13 at 12:40
1  
@hanxue - not a problem, I was showing you a more long term solution for dealing with the mounting of CIFS shares. autofs can also mount other things, it isn't just for CIFS. Glad you solved your issue. –  slm Oct 16 '13 at 12:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.