3

There was a virus in my hdd, I thought it wouldn't work in a linux, but even when I do a sudo rm -rf dir I get non empty directory error.

I even tried renaming it, but still get the same result. It's really weird, I usually get away with rm -r

How do I fix this? The filesystem is NTFS

Here is the output if I do an ls -la on Trash-0 (the dir I want to delete)

drwxrwxrwx 1 bodhi bodhi    0 Dec 28 09:04 .
drwxrwxrwx 1 bodhi bodhi 8192 Dec 28 09:30 ..
drwxrwxrwx 1 bodhi bodhi    0 Dec 28 08:53 expunged

if I do another ls -la on expunged I get:

ls: cannot access 'expunged/': No such file or directory

but if I use a file manager, I get a dir called 1647516513

9
  • Are you perhaps still running that virused Windows and let's say Linux via VM ? :)
    – GreggD
    Dec 28, 2016 at 15:36
  • @GreggD I'm using a live usb linux. I'm just dealing with a persistent black hat hacker :)
    – Corbee
    Dec 28, 2016 at 15:37
  • 5
    If it is NTFS, try running chkdsk from a Windows disk or ntfsfix on Ubuntu
    – muru
    Dec 28, 2016 at 16:32
  • 4
    This could be happening because another process is accessing the directory. Could you check if there are any PIDs when you do fuser -m /path/to/directory
    – Daniel W.
    Dec 30, 2016 at 11:54
  • 1
    Are you sure you didn't mount the NTFS partition as read-only? Nov 3, 2017 at 23:45

0

Browse other questions tagged .