1

During a software installation, the configure script created a symbolic link with what seems to be ln -s foo foo on a smbfs filesystem mounted with the options

credentials=/etc/fstab.passwd,uid=1001,gid=1001,file_mode=0644,dir_mode=0755,rw

The filesystem is simfs on the host machine. I tried to remove this symbolic link with rm, unlink but nothing works. The stat command cannot access any information. How could I remove this link ?

  • have you tried removing the symlink from the smbfs client? – cas Nov 12 '15 at 9:37
  • Yes, I have tried. – Tom-Tom Nov 12 '15 at 9:40
  • It sounds as if the filesystem is confused because the symbolic link is pointing to itself. You might try to see if you can rename the link, e.g., mv foo foo2. If it lets you do that, then you might still have to create a dummy file named foo (by "touch foo") to appease the filesystem before removing the symbolic link ("rm foo2"). – Thomas Dickey Nov 13 '15 at 1:17
  • @ThomasDickey. Very clever ! It worked without any warning from the host machine (but failed from the remote). You should turn your comment into an answer. – Tom-Tom Nov 13 '15 at 8:31
  • done - another detail which could be helpful in cases like this is that sometimes it helps to have the current working directory matching the link, so that no directory is given in the file operations. – Thomas Dickey Nov 13 '15 at 8:58
1

It sounds as if the filesystem is confused because the symbolic link is pointing to itself. You might try to see if you can rename the link, e.g., mv foo foo2. If it lets you do that, then you might still have to create a dummy file named foo (by "touch foo") to appease the filesystem before removing the symbolic link ("rm foo2").

  • Very clever ! It worked without any warning from the host machine (but failed from the remote). You should turn your comment into an answer. – Tom-Tom Nov 13 '15 at 9:16
-1

Try to delete this file by its inode:

ls -lasi | grep filename

find. -inum inode-number -exec rm -rf {} \;
  • Thanks for your answer. This does not work either. – Tom-Tom Nov 12 '15 at 9:50
  • 1
    How will that help? It's just going to run rm -rf <filename>. – immibis Nov 12 '15 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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