Mac os x sudo rm operation not permitted
I had somehow managed to create a file which simply defied deletion. I was pretty sure I'd created the file, as it was named "testfile" and was in my Documents folder. I'm not sure what I was testing, but the file was simply locked into place. Everything I tried failed to remove this file -- I made sure it wasn't "locked" in the Finder, I tried putting it in another folder first, and I even tried 'sudo chflags nouchg,noschg testfile' in the Terminal. Still, I couldn't even put the file in the trash, and if I tried to delete it as root, I received "Operation not permitted".
I finally killed it by switching to single-user mode and then changing the flags: Read the rest of the article if you'd like an explanation as to why this had to be done in single-user mode thanks to Marc D.
Marc D. In response to another recent thread regarding undeletable files, here's the story for at least some of these cases: The key problem is, indeed, the schg flag. If this is set, it will prevent a file from being deleted. I had this problem, and here is what I learned from solving it. Once in single-user mode, use 'chflags' to turn the schg bit off as shown above.
Why does it act like this? Well, clearing the schg bit requires that the kernel's 'secure level' be set to 0 or less.
Problem with rm -rf : permission denied
In a standard OS X boot, the secure level is set to 1, which restricts certain functions, such as clearing the schg flag. When booted into single-user, the secure level is set to 0, which does allow you to clear to the schg flag. Some general references on kernel security levels and chflags can be found at: Changing your kernel security level. Hope this helps. Deleting absolutely undeletable files 5 comments Create New Account. The following comments are owned by whoever posted them. This site is not responsible for what they say. OS 9 is culprit Authored by: Tried that one Authored by: Different problem Deleting absolutely undeletable files Authored by: White [ Reply to This ].
Search Advanced. From our Sponsor Latest Mountain Lion Hints Click here for complete coverage of Lion on Macworld. Michael Levin Michael Levin. Apple Watch Speciality level out of ten: I just noticed that I have a few directories in my files that have a username of "unknown" from GetInfo username of from ls -l and can't be touched by me.
I opened Terminal, and tried to "sudo chown" and "sudo chmod" them; both came back with "Operation not permitted". Can someone tell me how it's possible that su is not allowed to touch them, and more importantly, how I go about civilizing them so that I can see what's there and get rid of it? Thanks, Mike. Helpful answers Drop Down menu. Bill Scott Bill Scott. Desktops Speciality level out of ten: View answer in context. Loading page content. I checked that post and I see a couple of differences between our situation I'm not running Tiger and my file is not in the trash.
Which parts of that discussion should I be trying? Should I really go to single user mode and do fsck? I routinely check my file system with DiskWarrior and I think it's ok.
- wake mac from sleep with apple remote.
- best clipboard utility for mac.
- macos - Why does chown report "Operation not permitted" on OS X? - Super User?
- How to Fix “Operation not permitted” Error in Terminal for Mac OS.
- mac miller earl sweatshirt polo jeans!
- create read only word document mac.
- Cannot Delete File! Please help!!
Reply Helpful Thread reply - more options Link to this Post. Thanks for the specific instructions! I did that and here's what happened. The first fsck said everything was fine.
Fix Terminal “Operation not permitted” Error in MacOS Mojave
The chflags was ok as well. I tried to chown both directories then, to see what was there, and the first time it failed with a "operation not allowed" error. I then did rm -R on one of the directories, and it disappeared.
- lame mp3 encoder download mac os.
- slow cooker mac and cheese with chicken.
- parallels desktop 7 for mac trial.
- Your Answer.
- flash maker mac os x;
I then tried the chown again on the other one, and it worked! Maybe there's some latency here somehow. Anyway, I decided I wanted the whole thing gone and I did an rm -Rf on it, and it deleted almost everything, except for one file, which was a link to a nonexistent file it had an ls -l of "lrwxrwxrwx" is that a hard link?
When I try to delete that one, it says "no such file or directory".
Cannot Delete File! Please help! | MacRumors Forums
I thought rm was supposed to delete the link, not the file the link is pointing to! Anyway, I couldn't think of any way to get rid of it - it just won't let me do it. Anyone have any ideas how to get rid of this link? It's sitting at the bottom of a long tree of directories and I'd now like the whole thing gone Oh and then I fsck'd again, which said no error, and I rebooted. Finder won't let me delete it either error 43, file cannot be found. What do you think? I think I was sleepwalking when I answered this last night. I have zero recollection of this although I remember being awakened by a certain 2 year old.
Gary Kerbaugh Gary Kerbaugh. I will tell you one obscure thing that could cause symbolic links be followed. However, there are many possibilities and I certainly don't have time to recount them all. Thus, if you don't post commands, I won't try further. Anyway, it's part of the POSIX standard that if you include a trailing slash in the path, the symbolic link will be followed.
Anyway, it's part of the POSIX standard that if you include a trailing backslash in the path, the symbolic link will be followed. I understand - I should have included the output, but it was done in single-user mode and there was no easy way to copy and paste what was on the screen. Here's what I see from the terminal running in a normal boot: