Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
wim@wim-desktop:/media/data/dots/manouche$ ls > /dev/null
ls: reading directory .: Too many levels of symbolic links
wim@wim-desktop:/media/data/dots/manouche$ find . -type l -exec ls -l {} \;
wim@wim-desktop:/media/data/dots/manouche$ ls -lR . | grep ^l
ls: reading directory .: Too many levels of symbolic links

I have this problem on my filesystem, and googling suggests there is a circular symbolic link somewhere. But I can't find it, the commands I'm trying to recursively look for links aren't returning any results.

share|improve this question
    
Try ls -ld, where -d tells to list directory entries instead of contents, and do not dereference symbolic links –  mpy May 24 '13 at 14:16

1 Answer 1

up vote 3 down vote accepted

This is not the usual "circular link" error (that's why find doesn't help you). It says,

ls: **reading directory .**: Too many levels of symbolic links

So the error "Too many levels of symbolic links" is occurring while reading the current directory. It looks like a serious bug in either the driver or the physical filesystem; I'd try unmounting and fscking.

The error is caught in print_dir() inside the source of ls coreutil:

  else if (errno != 0)
  {
      file_failure (command_line_arg, _("reading directory %s"), name);
      if (errno != EOVERFLOW)
        break;
  }

and is caused by readdir returning ELOOP. It seems to be a bug concerning NFS which should leave traces in your dmesg (dmesg | tail). File system and OS version seem relevant; what are yours?

share|improve this answer
    
It's NFS on a synology NAS, the share is mounted in Ubuntu 13.04. Last line of dmesg was [75632.751021] NFS: directory dots/manouche contains a readdir loop.Please contact your server vendor. The file: ARPEGEDIATONIQUEG7.pdf has duplicate cookie 812789874 –  wim May 24 '13 at 15:09
    
As I feared. The problem is not in the filesystem, it is in the NFS layer of the Synology (see forum.synology.com/enu/viewtopic.php?f=41&t=61474). You'll have to switch to CIFS/Samba if possible, or query Synology for a 'firmware' update. There are a couple of hacks described here: cyberciti.biz/tips/… . –  lserni May 24 '13 at 15:44
    
Thanks for your advice, I'm trying a firmware upgrade to DSM-4.2-3211 (was on 4.1-2636) –  wim May 24 '13 at 16:29

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.