?
Solved

CentOS 4.2.1 folder marked as an unknown file type

Posted on 2011-03-10
5
Medium Priority
?
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 16

Assisted Solution

by:santoshmotwani
santoshmotwani earned 800 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 1200 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

Amazon Web Services EC2 Cheat Sheet

AWS EC2 is a core part of AWS’s cloud platform, allowing users to spin up virtual machines for a variety of tasks; however, EC2’s offerings can be overwhelming. Learn the basics with our new AWS cheat sheet – this time on EC2!

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

719 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