Solved

CentOS 4.2.1 folder marked as an unknown file type

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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). …
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 how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

749 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