Solved

CentOS 4.2.1 folder marked as an unknown file type

Posted on 2011-03-10
5
441 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
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.:

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now