14

Context: I added a drive to my machine, and for whatever reason, I am unable to access a directory(?) on it.

ls -l

ls: cannot access Downloads: No such file or directory
total 56
d?????????  ? ?    ?        ?            ? Downloads
drwxr-xr-x 26 user    12288 Aug 12 23:29 foo

ls -a

.  ..  Downloads  foo

cd

bash: cd: Downloads: No such file or directory

touch

touch: cannot touch ‘Downloads’: File exists

mkdir Downloads

mkdir: cannot create directory ‘Downloads’: File exists

cat Downloads

cat: Downloads: No such file or directory

file Downloads

Downloads: cannot open `Downloads' (No such file or directory)

mv Downloads down

mv: cannot stat ‘Downloads’: No such file or directory

Furthermore, the following commands do not remove the file(?), as root or otherwise:

rm Downloads
rm -rf Downloads
rmdir Downloads

One more piece of information, bash auto-completes Downloads, so bash also seems to think it is there.

3
  • Perhaps your filesystem has been corrupted. Are you able to do any action in a different OS? Jan 12 '17 at 9:15
  • I would say that the metadata is corrupted or unreadable by the current OS. If you "repair" it there, it may work or it may become permanently inaccessible anywhere. Proceed with caution (and backups)
    – Kit
    May 7 '17 at 5:21
  • Perhaps this is the same as askubuntu.com/questions/548930/…
    – Foo Bar
    Aug 2 '17 at 20:18
1

ls: cannot access Downloads: No such file or directory total 56 d????????? ? ? ? ? ? Downloads drwxr-xr-x 26 user 12288 Aug 12 23:29 foo

This is a typical case of having only read perms on a dir and no exec perms. And the other command outputs give the show that you don't have write perms either. To understand why this happens you'll have to know about inodes, dentries and the path lookup process of the kernel

0

D, you haven't described the situation around the issue, but here goes,

First does the directory appear in your file manager? According to your listing

d?????????  ? ?    ?        ?            ? Downloads

The directory "exists" but, without any discernable/set/assigned permissions, nor does it belong to a user or a group. In fact, on the face of it, read access is completely blocked. Again, describe the situation around this issue, meaning how did you arrive at this point?.

As an experiment , boot a live distro, and access that way, get the listing for Downloads and either assign "standard" directory permissions 755 or delete the directory. From time to time i have experienced what seem to be "bad writes" of files with the same issue and have had to jump to a live distro to delete them from my daily driver. If you CAN access the Download directory from the live distro, then recover it's contained data "off world" before you delete the directory. It's better to recreate the directory correctly once you are back in normal operation.

2
  • updated post with contex Aug 15 '15 at 19:29
  • Check your mount options for the drive.
    – moonbutt74
    Aug 15 '15 at 20:25
0

I had a file show up in a similar state. I was able to fix it by running fsck.

1
  • 5
    It would be nice to be more specific - e.g. by booting a live distro, or on reboot. Maybe you found what the core problem was - e.g. improperly unmounted network share, or permissions on his new disk that do not make sense to his current system, etc.
    – r0berts
    Jan 26 '17 at 18:31
0

you should run this commond:

umount Downloads

look like this : https://www.linuxquestions.org/questions/linux-newbie-8/ls-shows-directory-attributes-as-question-marks-942157/

2
  • 1
    How will sole unmounting help? It's like repairing a car by putting it out of sight. If the link leads to the real solution, please cite it here; the target site may change or disappear. Is the solution substantially different than what other answers suggest? Sep 12 '18 at 9:57
  • I have no idea how unmounting helps. But it did help for me. I had mounted an smb share to that directory. The smb share didn't exist anymore though. After unmounting, I was able access the directory as per usual.
    – sbecker
    Aug 17 at 10:56
0

I had the same issue with a directory from which I unmounted a SMB share. The only thing that helped was to reboot the machine.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 16 at 10:33

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.