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 ?

5
  • have you tried removing the symlink from the smbfs client?
    – cas
    Nov 12, 2015 at 9:37
  • Yes, I have tried.
    – Tom-Tom
    Nov 12, 2015 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"). Nov 13, 2015 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, 2015 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. Nov 13, 2015 at 8:58

2 Answers 2

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").

1
  • 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, 2015 at 9:16
-1

Try to delete this file by its inode:

ls -lasi | grep filename

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

You must log in to answer this question.

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