[See at end]
On 24-Mar-2012 Ted Harding wrote:
Greetings all! I have a wierdly mangled directory ("funny-dir" for present purposes). This may have occurred during a machine crash (I'm running this in a VirtualBox machine hosted on Windows and I recall that a few days ago the Windows host crashed).
Basically: from the parent directory, if I do 'ls -l' I see:
drw-r--r-- 2 ted ted 4096 2012-03-11 18:53 funny-dir
and that looks fine. But if I then do 'ls -la funny-dir' I see a lot of stuff all looking like:
?--------- ? ? ? ? ? funny-dir/. ?--------- ? ? ? ? ? funny-dir/.. ?--------- ? ? ? ? ? funny-dir/file1.pdf ?--------- ? ? ? ? ? funny-dir/file2.pdf [and so on]
Note that the "/." and "." both get the "?" attributes when viewed using 'ls -la funny-dir', as compared with the normal results viewed using ls -l' as above.
Finally, if I try 'cd funny-dir' I get:
bash: cd: funny-dir: Permission denied
However, if I 'su' to root, 'ls -la' gives:
drw-r--r-- 2 ted ted 4096 2012-03-11 18:53 funny-dir/. drwxr-xr-x 4 ted ted 4096 2012-03-24 21:07 funny-dur/.. -rw-r--r-- 1 ted ted 4766 2012-03-10 16:18 funny-dir/file1.pdf -rw-r--r-- 1 ted ted 4738 2012-03-10 16:19 funny-dir/file2.pdf [and so on]
which is all as it should be! I can also, as root, 'cd funny-dir', and again things look normal from inside funny-dir.
Can anyone say (a) What's going on? (b) How best to fix it?
This is the first time ever thar I've seen this sort of thing happen.
I'd like to be able to fix it directly, since the files were put in there by saving them out of several emails, each with several attached files with daft ("Windows" style) names which I had to change (every one); there are over 40 files, and it took ages!!
With thanks, and best wishes to all, Ted.
Well, I think I'm on the way to fixing it!
Since it all looked normal after 'su' to root, as user 'ted' I created a directory "funny-dir_copy", cd'd into it, su'd to root, and then did 'cp ../funny-dir/* .' and then did 'chown ted:ted *', after which I backed down from 'root' status and reverted to 'ted'. The files in the new directory are now fully accessible, and have all the right attributes, when I am 'ted'.
So that looks OK! But I'd still be interested to know what the problem was! And might I be risking anything if (as root) I simply deleted "funny-dir" and everything in it?
Thanks again, Ted.
------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@wlandres.net Date: 24-Mar-2012 Time: 21:59:42 This message was sent by XFMail -------------------------------------------------