5
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.

1
  • Try ls -ld, where -d tells to list directory entries instead of contents, and do not dereference symbolic links
    – mpy
    Commented May 24, 2013 at 14:16

1 Answer 1

3

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?

3
  • 1
    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
    Commented May 24, 2013 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
    Commented May 24, 2013 at 15:44
  • Thanks for your advice, I'm trying a firmware upgrade to DSM-4.2-3211 (was on 4.1-2636)
    – wim
    Commented May 24, 2013 at 16:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .