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?


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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.