Ubuntu: What causes a directory to have permissions of d?????????, an owner of ?, a group of ?, and a time of ?, but a name?



Question:

I use the Windows Subsystem for Linux and Bash on Ubuntu on Windows to support programming languages that otherwise don't have good support on Windows. I've heeded the advice to not create/modify Linux files with Windows tools. I keep all of the files that I want to edit in my editors/IDEs on Windows in /mnt/c/Users/{username}/... per that advice. So far, things have generally been good.

However, I wanted to remove a directory I was using for scratch. I've was unable to delete it from the Ubuntu Bash shell or the Windows Explorer interface. I first tried to rm -rf or sudo rm -rf from Bash and got no error output, but the directory persisted. I tried to rm -rf or sudo rm -rf the parent directory: Directory not empty. I tried to delete through Windows and got a dialog that says that I need to provide administrator permission. I do, so I get another dialog that says I need permission to perform this action. I tried to change permissions through the Windows Explorer as well as using chown and chmod and repeating the deletion steps without immediate success.

After going through the deletion process once on Windows and Linux, trying to change permissions/groups through both Windows and Linux, and trying to delete again, the directory persisted. However, when trying to respond to comments, the file was eventually deleted.

What causes this apparent invalid state and how can I prevent it in the future?


Solution:1

what you describe is the result of a corrupted file. The most likely cause is a crash during file writing. In a typical linux installation, you need to dismount the file system and run fsck. For example:

umount /dev/sda5  fsck.ext4 /dev/sda5  

If it's an xfs file system,

xfs_repair /dev/sda5  

Since you are running ubuntu/bash on windows, you might need to run chkdsk in windows to clear up the error. if the error disappeared without intervention, maybe windows detected the issue and repaired it during a boot.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »