Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I got into a weird situation. I got a 1Tb portable HD filled with some contents. It was used in Windows and as always packed with virus. I tried deleting some folders as root. But the following error returned

rm -R RECYCLER/
rm: cannot remove `RECYCLER/S-1-5-21-1659004503-1644491937-725345543-1003/Dc39.pptx': Operation not permitted
rm: cannot remove `RECYCLER/S-1-5-21-1659004503-1644491937-725345543-1003/Dc58.docx': Operation not permitted
rm: cannot remove `RECYCLER/S-1-5-21-1659004503-1644491937-725345543-1003/Dc17.JPG': Operation not permitted

ls -l returned

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf898cc8b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      121602   976760536    7  HPFS/NTFS

ls -l RECYCLER/
total 12
drwxrwxrwx 1 user user 12288 Dec 11 21:13 S-1-5-21-1659004503-1644491937-725345543-1003
share|improve this question
1  
What is the drive mounted as? –  Hello71 Dec 29 '11 at 16:06
    
Its automounted in /media as with NTFS as the FS –  user61954 Dec 29 '11 at 16:21
    
Extended attributes or ACLs on the files? –  Daniel Beck Dec 29 '11 at 16:30
    
Is it possible that your drive is mounted as read-only? Executing mount provides this information. –  Dennis Dec 29 '11 at 16:30
add comment

4 Answers

up vote 1 down vote accepted

The directory RECYCLER/S-1-5-21-1659004503-1644491937-725345543-1003 is presumably read-only. Run chmod -R u+w RECYCLER to set write permission on directories, then rm -rf RECYCLER.

If this is through a FUSE filesystem, it's possible that only the user who mounted the filesystem has write permission on it. In that case, run su user rm -rf RECYCLER.

share|improve this answer
    
When I run chmod -R u+w RECYCLER it gives the operation not permitted. I tried even running chown command –  user61954 Dec 29 '11 at 16:23
    
@user61954 NTFS is usually provided through FUSE (via ntfs-3g) these days, so try su user … (second paragraph of my answer). –  Gilles Dec 29 '11 at 16:37
1  
Installed ntfs-3g and now it works fine :) –  user61954 Dec 30 '11 at 2:48
add comment

This is due to an immutable attribute set for the files. If your filesystem driver allows it, run the command below before removing it.

chattr -i RECYCLER/S-1-5-21-1659004503-1644491937-725345543-1003/*
rm -f RECYCLER/S-1-5-21-1659004503-1644491937-725345543-1003/*
share|improve this answer
add comment

On debian you can use the fsck.ntfs command.

I think the Package is called NTFSProgs.

share|improve this answer
add comment

Looks like some filesystem issues. Try chkdsk /F [Harddrive]: on a windows PC.

Example:

chkdsk /F E:

share|improve this answer
    
Sorry, I dont have windows –  user61954 Dec 29 '11 at 16:22
    
If it's not going to be used on Windows again, I suggest you backup the useful files and reformat it with ext4 or other Linux-native filesystems. –  netvope Dec 30 '11 at 0:46
    
The probelem is that its owner uses Windows :D –  user61954 Dec 30 '11 at 2:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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