How do you delete a corrupted file or directory?
First off, I'd like to say that Promise RAID controllers are WORTHLESS!!! Absolutely, ridiculously worthless.
To make a long story short, my raid controller has corrupted a bunch of data on my file server. Luckily, my nightly backup got most of it before it wnt down the tubes, but now, while I'm trying to restore, I can't overwrite any of the corrupted files, I can't even delete the files... [root@uranium /job]# rm -rf HDKProjects rm: cannot remove `HDKProjects': Permission denied # ll ls: HDKProjects: Permission denied total 10 # rmdir HDKProjects rmdir: `HDKProjects': Permission denied ... so, if root cannot delete the files, how can I get rid of them? |
What filesystem are you using? I've seen tutorials out there for restoring corrupted files in a journaling filesystem like reiserfs.
|
Also if you are using ext2 or 3 there is the immutable flag, which could have been set when things were corrupted.
(edit) Actually, not sure why that would give access denied for an ls... so probably not. |
Quote:
I'll look into resier recovery tutorials. If anyone knows of one, please chime in. |
Good god, you use a RAID 5 array? What the hell do you do with your system, control NORAD? <g>
How many HDDs do you have? If one drive failed, your RAID controller should have transparently fixed it. If it didn't, get a new RAID controller. Promise should send you a new one. (Gateway would, I don't know other companies' policies) If two failed, you are somewhat screwed and Promise is not to blame. 2 drives failing is beyond the capability of RAID 5 to restore. Or pretty much any RAID, now that I think about it. You can do two things: 1: Reformat all HDDs and restore from your backups. Easiest. 2: If you REALLY want to save the rest of what you did since backup: Reformat then restore the failed HDDs one at a time. This *should* save everything except what was on the failed blocks. Since these blocks have essentially been zeroed out on your failed drives, you should be able to r/w/delete them. They should no longer be so nastily corrupted, though they will be unusable. Restore them from backup. 2.5: ...I thought of a much better solution. Woot. Dump all the readable files to a copy of your old backup, rewriting wherever necessary. Then the noncorrupted files will be saved and you get the old versions of the corrupted files. FFR. Whether 2 is possible depends on your HDDs, your RAID controller, and several acts of god. 2.5 is better. 1 is easiest. |
Quote:
Quote:
Quote:
One more reason to never buy a Promise controller again. Thanks for the suggestions. I'm in the middle of backing up everything I can.. Being that it was formatted with ReiserFS, the ability exists to rebuild the file system tree which may recover my lost data. I'll give that a go after I backup everything that doesn't get backed up with my nightly minimal backup. |
Quote:
|
Quote:
|
Have you looked at the files to see if the damage may have altered there attribute settings? Attribute settings can be such that even if permissions are set correctly no one, not even root can delete them.
To take a look at the attributes for files in a given folder use... lsattr If you determine that you need to alter the attributes, you can use the 'chattr' command to accomplish that task. Good Luck |
All times are GMT -5. The time now is 06:17 AM. |