how to change filetype


Could somebody help me out how to change the filetype of a file? You know, when you type ls -l in a terminal, you get a long description of each file in that directory. The first letter indicates what that file is (- for regular file, d for directory, l for link, etc)

My problem is that I have a data directory in /home that shows up like this:

?--------- 1 root root 0 1969-12-31 20:00 suni

I did managed to change this to

?rwxrwxr-- 1 suni users 0 1969-12-31 20:00 suni

but what do I do with the “?” ???
and as you can see the size of this supposed-to-be directory is zero, and I do not understand why. Also the date is quite absurd.

how did I end up here? One day I could not boot, I tried a boot disk to use some repair tools. The automatic thingy stomped all over the faulty /home partition, and fixed it by wiping it clean, only the lost+found directory was there when I managed to boot. So I unmounted /home and tried to see what can I do with dumpe2fs, fsck, e2fsck, debugfs, but that’s all I could achieve. I saved the terminal window content for further analysis, so if you need to look into it, I can provide that (I just didn’t think that it would be appropriate to dump it right here).

Other system info: when I could not boot I had openSUSE 11.1 x86_64, AMD processor, 4GB DDR400, RAID5, with ext3 file system. I had a 11.2 i386 install DVD for my kids play computer, so I tried to use that for recovery - but I don’t think that the version nr or the architecture difference would have caused the wipe-out of /home. Instead, I am convinced that I was a lazy idiot and I just left everything to the machine brainlessly! … and now I ask you guys to help me out…

Would anybody give me a hint how to fix this? I’d like to get my kids-videos back, I don’t care about the rest that was lost.


I suspect the bad news is that the files have been lost due to disk errors and the automatic repair couldn’t fix everything, leaving this bogus entry. You could try to boot with the live CD, go into the rescue system and try to fsck it again. But if that produces nothing, it’s gone.

thank you, ken_yap, for the reply. I’ll keep trying a couple more times, I can’t just give up yet. I’ll get back to you when I can actually say something worthy.

Would anybody tell me how to change that filetype “?” to a “d” ? I’d like to try that too, as usually directories do not have a size, only by their “content” … which is not really the right way to think about it, but you do understand me, right?

Thank you all for the help!

and Happy Winter Solstice to everyone!

That’s probably not a real directory, it’s probably a corrupted entry and changing that bit will not get your contents back.