Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an encrypted, external hard drive that I use for backups. The backups are hardlinks to simulate incremental backups (using rsync). I am using Debian stable.

Apparently some of the files are damaged, and I am unable to delete them as root.

I've run fsck to fix the disk, but I am still unable to delete the files.

Apparently, the ownership of the files is garbled. They have permissions ---x-w--wx and owned by non-existent userids.

chown/chgrp, chattr and even lsattr give permission denied errors and say the operation is not permitted.

How can I take ownership of these files and delete them?

share|improve this question

You may need to fix permissions on the directory containing the files as well. If that doesn't work, then your filesystem isn't fixed and you're going to have to reformat it.

share|improve this answer
The parent directory perms are alright. The hard drive in question contains 1.5TB of backup data, so reformatting it is not an option. – Rob Jan 3 '13 at 17:51
Drive failure is not something you get an option about if it happens to you... get another drive, salvage the working files, reformat the failing drive and run badblocks on it. (That will take a long time) – pjc50 Jan 7 '13 at 15:12
I've no evidence that the blocks themselves are bad and that the drive failure was nothing more than something caused by a power outage. There are two damaged files on it: there must be some way to fix them. – Rob Jan 7 '13 at 15:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .