Welcome back! If you found this question useful,
don't forget to vote both the question and the answers up.
close this message

Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

193

●2●7

current community

Super User

help
chat
log out

Meta Super User

your communities

edit
cancel

Stack Overflow

2,037

Ask Ubuntu

13

Cryptography

101

Bitcoin

reset to default list

more stack exchange communities

company blog

Tour

Start here for a quick overview of the site

Help Center

Detailed answers to any questions you might have

Meta

Discuss the workings and policies of this site

About Us

Learn more about Stack Overflow the company

Business

Learn more about hiring developers or posting ads with us

By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service.

Home

Questions

Tags

Users

Unanswered

Operation not permitted error when deleting as root

Ask Question

4

2

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

linux debian external-hard-drive

share|edit|flag

edited May 8 '17 at 12:41

Mithrandir

3051314

asked Dec 29 '11 at 16:00

user61954user61954

3893718

1

What is the drive mounted as?

– Hello71
Dec 29 '11 at 16:06

1

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 a comment |

start a bounty

5 Answers
5

active

oldest

votes

3

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|edit|flag

answered Dec 29 '11 at 16:20

GillesGilles

54k15115163

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

2

Installed ntfs-3g and now it works fine :)

– user61954
Dec 30 '11 at 2:48

add a comment |

6

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|edit|flag

answered Apr 23 '13 at 23:19

miltonmilton

16113

add a comment |

0

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

Example:

chkdsk /F E:

share|edit|flag

edited Dec 30 '11 at 20:49

Simon Sheehan

7,775124369

answered Dec 29 '11 at 16:16

DanielDaniel

1

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 a comment |

0

On debian you can use the fsck.ntfs command.

I think the Package is called NTFSProgs.

share|edit|flag

edited Dec 30 '11 at 20:49

Simon Sheehan

7,775124369

answered Dec 29 '11 at 17:46

DanielDaniel

11

add a comment |

-1

I had this problem on my Note 3 (Android device) with some files in a folder on the external SD card. rm produced "operation not permitted" and lsattr produced "inappropriate ioctl for device".

The fix for me was to take the SD card out of the phone and put it into a PC to delete the files. Worked like a charm. I know that's not exactly a "linux" solution but it's the only thing that worked. Hopefully this will help someone else.

share|edit|flag

answered Jul 21 '14 at 19:02

DubiousDubious

1

1

This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation.

– warren
Jul 21 '14 at 19:41

@warren: What question does this not answer? The original question does not really ask a question. Implicitly, it asks, "How do I remove contents from a Windows disk?" Dubious is (somewhat anecdotally) answering, "Put the disk back on a Windows system and do it there." It's no less of an answer than Daniel's first answer. OK, yes, user61954 says that [s]he doesn't have Windows; hence Dubious's disclaimer that he hopes this will help someone else.

– Scott
Jul 21 '14 at 19:52

1

@Scott - the question is about external hard drives and linux: Dubious' answer is about an SD card from an Android device that needed to be deleted using Windows. The answer has nothing to do with the question, and is barely tangentially similar.

– warren
Jul 21 '14 at 22:32

add a comment |

Your Answer

Thanks for contributing an answer to Super User!

Please be sure to answer the question. Provide details and share your research!

But avoid …

Asking for help, clarification, or responding to other answers.

Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

draft saved

draft discarded

community wiki

Post Your Answer

Discard

Not the answer you're looking for? Browse other questions tagged linux debian external-hard-drive or ask your own question.

asked

7 years, 5 months ago

viewed

27,427 times

active

2 years, 1 month ago

Featured on Meta

Unicorn Meta Zoo #3: How do we grade questions?

Hot Meta Posts

16

Clean out our [container]

11

How to deal with out of date questions?

Related

1
Debian boot problem

1
How clone a hard drive using Linux live CD

1
Understand warnings after “fdisk -l” commands

0
Linux server boot issue

0
How to recover lost partitions using a bootable pen drive?

2
Replaced a RAID 10 drive on my Debian server - what do I do next?

2
mkfs - The device apparently does not exist; did you specify it correctly?

0
Understanding fdisk -l output and calculating storage

0
I connected my usb hdd driver. CentOS7 don't mount it

0
Recurring external HDD unreadable on Windows

Hot Network Questions

Housemarks (superimposed & combined letters, heraldry)

How can one's career as a reviewer be ended?

What is Gilligan's full Name?

Why do Bhargava-Skinner-Zhang consider the ordering by height?

Flight compensation with agent

Was planting UN flag on Moon ever discussed?

empApi with Lightning Web Components?

After an 87 day stay in the USA, can I return for a long weekend? (ESTA)

Combinatorics problem 25 students problem

bash vs. zsh: What are the practical differences?

Is Dumbledore a human lie detector?

If I had a daughter who (is/were/was) cute, I would be very happy

Wizard clothing for warm weather

How to get depth and other lengths of a font?

Is there a better way to do partial sums of array items in JavaScript?

How do you play "tenth" chords on the guitar?

Make Gimbap cutter

Could a person damage a jet airliner - from the outside - with their bare hands?

Augment Export function to support custom number formatting

Can I use 220v outlets on a 15 amp breaker and wire it up as 110v?

That's not my X, its Y is too Z

Do you have to have figures when playing D&D?

Are the guests in Westworld forbidden to tell the hosts that they are robots?

How make a table fit inside the margins?

Question feed

Subscribe to RSS

Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Super User

Tour

Help

Chat

Contact

Feedback

Mobile

Disable Responsiveness

Company

Stack Overflow

Stack Overflow Business

Developer Jobs

About

Press

Legal

Privacy Policy

Stack Exchange
Network

Technology

Life / Arts

Culture / Recreation

Science

Other

Stack Overflow

Server Fault

Super User

Web Applications

Ask Ubuntu

Webmasters

Game Development

TeX - LaTeX

Software Engineering

Unix & Linux

Ask Different (Apple)

WordPress Development

Geographic Information Systems

Electrical Engineering

Android Enthusiasts

Information Security

Database Administrators

Drupal Answers

SharePoint

User Experience

Mathematica

Salesforce

ExpressionEngine® Answers

Stack Overflow em Português

Blender

Network Engineering

Cryptography

Code Review

Magento

Software Recommendations

Signal Processing

Emacs

Raspberry Pi

Stack Overflow на русском

Programming Puzzles & Code Golf

Stack Overflow en español

Ethereum

Data Science

Arduino

Bitcoin

more (31)

Photography

Science Fiction & Fantasy

Graphic Design

Movies & TV

Music: Practice & Theory

Worldbuilding

Seasoned Advice (cooking)

Home Improvement

Personal Finance & Money

Academia

Law

more (15)

English Language & Usage

Skeptics

Mi Yodeya (Judaism)

Travel

Christianity

English Language Learners

Japanese Language

Arqade (gaming)

Bicycles

Role-playing Games

Anime & Manga

Puzzling

Motor Vehicle Maintenance & Repair

more (33)

MathOverflow

Mathematics

Cross Validated (stats)

Theoretical Computer Science

Physics

Chemistry

Biology

Computer Science

Philosophy

more (10)

Meta Stack Exchange

Stack Apps

API

Data

Blog

Facebook

Twitter

LinkedIn

site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0
with attribution required.
rev 2019.6.10.33920