Directory shows as "unknown type" - any way to recover it?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Directory shows as "unknown type" - any way to recover it?
Hello!
For unknown reason some files/directories on hard drive are not accessible anymore. If I do ls -l /full/path/ the corrupted directory shows like:
Code:
drwxr-xr-x 12 user user 16384 2006-04-17 22:56 name_of_good_directory
?--------- ? ? ? ? ? /full/path/name_of_bad_directory
Is there a way to restore/recover these corrupted directories/files?
I've already checked the hard drive on possible sector loss or such - nothing wrong with it...
System info:
OS: Ubuntu 6.06
Kernel: 2.6.15-27-386
Filesystem: ext3
Hard drive connected via PCI Promise ATA100 controller
If this is on your boot partition then you should force an fsck during the next reboot as follows:
Code:
root> shutdown -fr now
If it is on a partition other than the boot partition then unmount the partition and run fsck on the device mapping in the /dev directory as in /dev/hda3.
This may just be a permissions problem on the directory, not corruption. A directory that is readable, but not executable, gives you strange results when you try to list it's contents.
Here's an example I just tried on my own system. The "corruption" shows up when I give the directory a weird 444 mode. The "corruption" dissappears when I change it back to a more reasonable 555 permission.
Code:
$ mkdir dir1
$ ls -l dir1
total 0
$ > dir1/file1
$ ls -l dir1
total 0
-rw-r--r-- 1 david david 0 2006-09-27 22:46 file1
$ chmod 444 dir1
$ ls -l dir1
total 0
?--------- ? ? ? ? ? dir1/file1
$ chmod 555 dir1
$ ls -l dir1
total 0
-rw-r--r-- 1 david david 0 2006-09-27 22:46 file1
$
Unfortunately its not permission issue...I just ran fsck and it indeed found some problems with these folders/files...Though I did answer "no" when it asked me to repair them, because I'm afraid by doing that I might lose the files completely...
Should I continue repair it with fsck or there is a better way to recover the files?
If fsck finds files with problems it will put those files in the lost+found directory at the top of the partition's file system. Chances are that these files will not have their original name. Also, they may only be fragments of the original files.
I would try haertig's idea.
Code:
root> chmod 777 bad-directory
If that doesn't fix it then you can try to see how the directory is stored on the disk using the stat utility.
Distribution: Kanotix HD Install, Debian Testing, XP Pro,Vista RC1
Posts: 145
Rep:
Have a look at testdisk. I had a partition that came up unknown, large storage partition, and test disk fixed it for me. I never did figure out why Debian or XP Pro could not "see" it, it was there, just unrecognizable.
Have a look at testdisk. I had a partition that came up unknown, large storage partition, and test disk fixed it for me. I never did figure out why Debian or XP Pro could not "see" it, it was there, just unrecognizable.
I'm a big fan of test disk myself. I don't think it applies here, though. This is a problem of an unreadable directory inside a good file system. Test disk fixes partition tables. http://www.cgsecurity.org/wiki/TestDisk_Download
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.