# corrupt files in /etc

## Bonifatius3

Hi, everybody,

I am an absolute newbie, sorry for my questions:

I detected some corrupted files on my preinstalled system:

 *Quote:*   

> 
> 
> jh / # ls /etc/ -ls
> 
> ls: Zugriff auf /etc/xml nicht möglich: Keine Berechtigung
> ...

 

How can I fix these files?

Thanks for any help.

Joachim

----------

## erik258

Sadly I don't know german.  But I ran your text through the google translator and from the results [1], I think it appears to be saying something along the lines of

```

ls: Can't Access /etc/xml: Permission Denied

ls: Can't Access /etc/cron.daily: Permission Denied

ls: Can't Access /etc/openldap: Permission Denied

```

Along with output like this:

```
? ?????????? ? ? ? ? ? cron.daily

? ?????????? ? ? ? ? ? openldap

? ?????????? ? ? ? ? ? xml 
```

the problem seems to be that you can't read information about these files due to their file permissions.  However, if, as your excerpt seems to show, you really were logged in as root, that would be strange; root should be able to read regardless.  Are you sure

```
jh / # ls /etc/ -ls 
```

Is exactly what you typed to get this output?  And as root?

If so I would be worrying right now.  You might have been rooted.

[1] results at http://translate.google.com/translate_t#de|en|ls%3A%20Zugriff%20auf%20%2Fetc%2Fxml%20nicht%20m%C3%B6glich%3A%20Keine%20Berechtigung%0Als%3A%20Zugriff%20auf%20%2Fetc%2Fcron.daily%20nicht%20m%C3%B6glich%3A%20Keine%20Berechtigung%0Als%3A%20Zugriff%20auf%20%2Fetc%2Fopenldap%20nicht%20m%C3%B6glich%3A%20Keine%20Berechtigung%0Ainsgesamt%20509

----------

## Bonifatius3

Thanks Erik,

I did it as "su -" from a konsole shell. This problem seems to freeze my system from time to time for several minutes.

chmod 666 xml, for example, blocks the present shell and can only be stopped by pressing ctrl+c

I'm copying all readble files from /etc to /etc2 and intend to rename the directories afterwards.

Do you think this could work? The corrupt files would be gone, but could be regenerated, couldn't they?

----------

## erik258

Hmmm.... I don't think those files are corrupt.  Perhaps the filesystem is corrupt, in which case it seems likely that the drive itself is causing the problem.   I am now wondering what condition your hard drive is in.  Have you ever used SMART on that drive?  I would be watching it closely, as if you can't change those files I begin to think that your drive is dying.  

I strongly suggest you set up smart to email you if anything goes wrong (make sure you can get email sent from that host!) with the drive.  I  also recommend you start doing regular backups, especially of irreplaceable data.  If you can back up the whole drive, do it.  

By the way, what filesystem are you using?  Have you been keeping an eye on dmesg and on your logs?

----------

## Bonifatius3

Thanks,

my dmesg says:

 *Quote:*   

> 
> 
> jh / # dmesg
> 
> enabled, read cache: enabled, doesn't support DPO or FUA
> ...

 

It's actually a RAID drive, so I thought the drive itself should take care of the problem, shouldn't it?

----------

## erik258

hi again, 

 *Quote:*   

> 
> 
> ```
> end_request: I/O error, dev sda, sector 281931715
> 
> ...

 

As you can see from this output, the drive is spitting out I/O errors.  Either the drive, the controller, or the RAID array is failing. 

In any case, as you can see from the ReiserFS output following, RAID is not protecting the filesystem.  OR the drive would have been depreciated in the array.  

What are you using as a RAID controller?  You must not be using linux software raid or your drive would be called md0 rather than sda.  Hardware raid then?  Or pseudo-hardware raid?  Please provide more info on your raid setup!

----------

## Bonifatius3

Thanks for your continued helpful comments.

It's a hardware raid disk. 

lspci -v says (sorry for the whole file, I was unsure which paragraphs were relevant):

 *Quote:*   

> 
> 
> jh / # lspci -v
> 
> 00:00.0 Memory controller: nVidia Corporation CK804 Memory Controller (rev a3)
> ...

 

How am I able to retrieve more information about the controller?

----------

## erik258

Hello, looks like it could be either of these:

```

01:07.0 RAID bus controller: 3ware Inc 7xxx/8xxx-series PATA/SATA-RAID (rev 01) 

01:0d.0 RAID bus controller: Silicon Image, Inc. SiI 3114 [SATALink/SATARaid] Serial ATA Controller (rev 02) 
```

I'm afraid I can't help you much in either case, since you're using hardware raid.  I would look online for more information about seeing why the raid has failed and what to do about it.  If you were using software raid I could assist, but since it's hardware raid you're using, the details are outside the scope of my knowledge.  

How many disks do you have in the array?  And what kind of RAID is it?  [/bug]

----------

## Bonifatius3

Thank you, Erik,

I have the impression that the only option remaining seems to go to a computer shop and have it checked hardwarewise. Nevertheless I would like to express my thanks for all your comments and help. In some days time I will come back and report the results of the hardware check.

Best wishes,

Joachim

----------

## erik258

 *Quote:*   

> I have the impression that the only option remaining seems to go to a computer shop and have it checked hardwarewise.

 

With all due respect, I totally disagree.  We've only seen one error.  We don't yet know what the drives are attached to (you have 2 controllers) and we haven't done any investigation at all.  This is anything but the "only remaining option."  We could see what disks were listed - if dmesg hadn't been full we could have gotten more information about what disks were attached to what systems from the beginning of dmesg; we could get that data from a reboot if nothing else.  Although there's no guarantee that the system would reboot properly.  We could look at the output of `fdisk -l` to see what drives are attached.  We could almost certainly figure out which device was doing hardware raid from somewhere in /proc or /sys, although I don't know where.  Did you try to use the smartctl program from the smartmontools package?  We've only begun the process of troubleshooting this issue!  

Besides, I'm the only one who has responded to your post!  There are tons of very competent sys admins on the forums, and even more on the mailing lists (which you could contact if you wanted).  These people might have all sorts of good ideas about how to proceed with your troubleshooting.  Your post has only been up for a few hours, after all.  

Furthermore,  unless you really like a computer shop in your area I wouldn't recommend bringing the box to a tech shop.  For one thing, it'll cost you.  Secondly, there's no guarantee they know what they're talking about.  Finally, I wouldn't assume the computer shop will have any idea what your configuration is.  If you can't tell us here on the forums, you might not be able to tell them either (of course, having the computer in front of them will certainly help, but I'm more worried about issues arising after you tell them you're running !windows.  Around here their eyes would grow wide, and they probably wouldn't know what to do). 

Of course this is from experiences here in the united states, where computer shops totally suck.  It could very well be that computer shops in germany (germany, right?) are much better; I have no idea.   

My point is simply that you should be able to find out how many and which drives are attached to which controllers easily enough, and what level of raid you're using.  After all, you built the system, didn't you?  I just mean to say, new 160GB hard drives are around $50 us, and around here just checking in a computer is going to cost that much.  my mantra has always been, if you know anything at all about computer hardware, chances are you already know more than the tech guys who will be laying hands on your system.  

In whatever case, I wish you the best of luck.  If you do bring it into a shop, I'd love to hear what happens.  But I hope you'll reconsider, and keep on doing your best to diagnose the problem yourself before bringing it to a "professional".

----------

## energyman76b

I have seen drive failures screwing up hardware raids. Best solution: replace the offending disk and let the controller rebuild the raid. If you still have problems afterwards:

fsck.

But first replace disk, then fsck or you will probably hose the system.

----------

