Solved

CentOS 4.2.1 folder marked as an unknown file type

Posted on 2011-03-10
5
447 Views
Last Modified: 2013-12-16
My dev/sda2 partition on a Rocks CentOS cluster filled up and corrupted the var/log folder. The log folder s now marked as an "unknown" file type. Is there a tool that can change the attributes back to that of a folder. I have no current backups of this folder.
0
Comment
Question by:NeedsHelpToo
  • 2
  • 2
5 Comments
 
LVL 16

Assisted Solution

by:santoshmotwani
santoshmotwani earned 200 total points
ID: 35103698
There is a command in linux : chattr ( FYI it only works on ext2/ext3 partition)

Here is an example : http://www.linuxhowtos.org/Tips%20and%20Tricks/chattr.htm
http://linux.about.com/od/commands/l/blcmdl1_chattr.htm

0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35106504
How about fsck?

Wich filesystem is the folder in? Can you unmount it to run fsck?

wmp
0
 

Author Comment

by:NeedsHelpToo
ID: 35108303
The file system on /var is ext3. The umount /var or umount /dev/sda2 both yield "device is busy" response. The command chattr -D /var/log response is "chattr: Input/output error while trying to stat /var/log". I also tested both of these commands in single user mode. It appears that any command that trys to touch /var/log gets the response "Input/output error. I

0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 300 total points
ID: 35108358
I fear you will have to boot from CD into rescue mode to be able to repair the filesystem /var!

I still think fsck is the best (if not the only) choice!

http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-rescuemode-boot.html
0
 

Author Comment

by:NeedsHelpToo
ID: 35112117
I booted into rescue mode from the CD and tried mounting my file system and skipped mounting my file system, but was still unable to get fsck to work. I found another discussion at

http://www.linuxforums.org/forum/miscellaneous/35926-cannot-boot-up-linux-unable-read-superblock.html

From this discussion I used mke2fs -n /dev/sda2 to discover the superblock backups. Then I used e2fsck -b 32768 /dev/sda2 which said it was going to correct file errors. When it was done the corrupt file was gone and I created the directory /var/log. Everythings not perfect but many of my services were able to create new log files and start properly.

Thanks for all your help

NeedsHelpToo
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question