I have a storage device (sda) where I stored some backups in its partition 1 (sda1). Disgracefully, I killed the process (rsync
) that was backing up data into the mounted storage device and, I guess, creating a fault in the drive.
Now I am trying to undo the mess by removing all files from the backup dir. I can successfully remove most of the files and directories I backed up before the crash, although many don’t want to be deleted and show Directory not empty
or Input/output error
. I guess these files are the ones that couldn’t fully be copied into the backup directory because of me killing the rsync
process.
Since I am using a server OS I can’t use a GUI to throw these files into the paper bin and then flush it (as I’ve seen other people do with similar issues).
This is what I’ve tried for now:
umount
the drive andfsck -f
in/dev/sda1
smartctl -a /dev/sda1
which gave me the usual information, no errors in it.- Removing parent directories -> I get
Directory not empty
More information:
In some cases I can’t even ls
:
/hooks$ ls -lha
ls: cannot access 'applypatch-msg.sample': Input/output error
ls: cannot access 'pre-receive.sample': Input/output error
total 8.0K
drwxrwxrwx 1 root root 4.0K Jun 13 11:37 .
drwxrwxrwx 1 root root 4.0K Jun 13 11:37 ..
-????????? ? ? ? ? ? applypatch-msg.sample
-????????? ? ? ? ? ? pre-receive.sample
These files are not important, it would be ideal if I could just remove them. The storage doesn’t have important information either, I am just using it for testing purposes for now, so resetting it wouldn’t be a problem, although I’d like to find a more elegant solution. Thank you!
Guillem Senabre is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.