Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a Windows 2008 Storage server configured for NFS service. I am using a FreeBSD client to mount share from the storage server. Every thing works fine like copying, deleting files etc. However, when I run the find command on my FreeBSD client for some directory inside the mounted file system, the command is unable to list the files recursively. It lists the immediate child file and directories. Files inside sub-directory are not listed.

Can anybody please help, what could be the issue?

share|improve this question

2 Answers 2

IIUC the Windows NFS server at least used to be more of a "checkbox feature" rather than something usable for real work. Don't know if anything has changed for w2k8, though.

You might have better luck mounting via CIFS, assuming FreeBSD has a CIFS client?

share|improve this answer

I have seen much the same thing in Linux, and I poked around in the source code of findutils. It looks like there may be a bug in Windows Server 2008 where the d_type field of the (struct dirent*) returned by readdir() on the NFS client is 8 (DT_REG, incorrect) instead of 4 (DT_DIR, expected). Unsurprisingly, find does not recurse into the subtree for such directories.

If you want to test this yourself, you can download the sources of findutils-4.4.2. Change gnulib/lib/fts.c line 1136

if (sp->fts_compar == NULL || ISSET(FTS_DEFER_STAT)) {

to

if (0 && sp->fts_compar == NULL || ISSET(FTS_DEFER_STAT)) {

and rebuild find. After this change, find returned all of the expected directories, at least for the cases I tried. I do not know if this is a complete fix guaranteed to work in all cases.

I do not yet know if Microsoft are aware of it and have a hotfix, and whether or not it has been fixed in Windows Server 2008 R2.

share|improve this answer

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.