Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

2ne1xxi

macrumors newbie
Original poster
MacBook Pro 2020 M1 running macOS Tahoe 26.5.1

A few weeks ago, I created 2 user accounts (both Admins) to test something out. So, I'm done with what I wanted to do and I delete one of the users (XXI in this case). An error pops up saying that the home folder could not be deleted. While logged into one of the Admin accounts (yandel114 in this case) I created, I moved the home folder of the account I deleted to the trash and clicked empty trash, but it said some files were in use. I didn't think much of it so I just logged out of that account, logged into my main account, and deleted the remaining account. BOTH showed the same error. I also moved that account to the trash bin on my main and I can't delete it either.

I tried running the sudo rm -rf {folder path} command and all it showed was this:
Code:
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash/XXI/Library/Mobile Documents/com~apple~videoapps~cloudcontent~clips: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash/XXI/Library/Mobile Documents/iCloud~com~apple~shortcuts~runtime: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash/XXI/Library/Mobile Documents/com~apple~videoapps~cloudcontent~imovieios~private: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash/XXI/Library/Mobile Documents/com~apple~shoebox: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash/XXI/Library/Mobile Documents/iCloud~com~bandlab~bandlab~iphone: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash/XXI/Library/Mobile Documents: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash/XXI/Library: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash/XXI: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT)/.Trash: Directory not empty
rm: /Users/bladi/.Trash/yandel114 (folder I can't delete TT): Directory not empty

I've tried everything from trying to remove it while in safe/recovery mode to no avail.
 
Maybe move it out of the trash and then try to remove the folders? Might work.
The thing is, I can't. When I try to move it out of the trash, it shows an error saying the folder needs to be downloaded and simply creates a copy, which is greyed out, so it's useless.
 
I think we should start by looking inside one of the directories that isn't empty. I picked the first dir listed in the output.

Please enter this command into a Terminal window:
Code:
sudo ls -leaO@ /Users/bladi/.Trash/*/.Trash/XXI/Library/Mobile*/com~apple~videoapps~cloudcontent~clips
I've used the * wildcard in a couple places. The first one is because I'm unsure of what the actual name is for the dir whose name apparently starts with "yandel114". The second one is just because I'm lazy with quoting.

Please post the complete output text, enclosed in CODE tags.

Once one of the sub-dirs within "Mobile Documents" remains unremoved, none of the dirs leading up to it will be removable.
 
If I recall correctly, can maybe:

Code:
sudo dscl . -delete /Users/bladi
sudo rm -rf /Users/bladi

If not, what @BrianBaughn mentioned: believe you need to reset the password for the account in recovery and then can delete via Users in System Settings (or above might then work).

Also seem to recall reading some instructions about removing the "hidden" users information under /var, just that my recall is a little hazy around that.
 
You may be able to remove it in recovery mode:

1. Boot into recovery
2. Do something like mount -uw /Volumes/Macintosh\ HD\ -\ Data
To make the data volume read/write
3. rm the folder from inside the .Trash
 
Thank you guys so much for trying to help me, but I've tried everything before coming on here. I've tried to remove it from recovery mode, but it still said directory not empty.

Unfortunately, I got in contact with Apple Support yesterday, and the fix they recommended me was to reinstall macOS. So, I'll backup some data and try that sometime later this week.
 
OP wrote:
" I've tried everything before coming on here. I've tried to remove it from recovery mode, but it still said directory not empty."

You haven't tried "everything" yet.
I'll provide you with a solution that I believe will work.

You'll need an external backup drive for this job.
I recommend that you DO NOT USE a time machine backup.

Here's what to do (print this reply out for reference):
a. Download either CarbonCopyCloner or SuperDuper for this job. Both are FREE to download and use for 30 days, this will cost you nothing.
b. Use either CCC or SD to create a cloned backup on an external drive. Then, disconnect it and set it aside for now.
c. You don't need to "boot to recovery". (Remember, recovery will only install a new OS. Your problem IS NOT "in the OS". Rather, it's in your own account structure - something you added/modified COMPLETELY OUTSIDE OF the OS. Replacing the OS alone can't "remove" this problem.)
d. Instead, boot to your regular account, in the finder.
e. Open System Settings
f. In the search box (top left), type "erase all content" (that's enough)
g. You'll see "erase all content and settings" appear below the search box. Click that.
h. Click the "Erase all content and settings" button you see on the right.
i. Follow the instructions (password will be required).
j. The process goes pretty quickly. EVERYTHING you have ever added to the computer will be gone in a flash. It will be returned to "moment zero" (moment zero is the moment you first took it out of the box and powered it up).
k. When this is done, you should now see the initial Mac setup screen again (just like you powered up for the first time). AT THIS POINT, CONNECT YOUR BACKUP.
l. Begin setup. At the appropriate moment, setup assistant will ask if you wish to migrate from a backup drive. YES, you do, so "point the way" to the cloned backup.
m. Give setup assistant some time to "digest" everything. It will then present you with this list:
applications
accounts
settings
data
n. I believe you can check/UNcheck which accounts are to be migrated. You may not see the second (deleted) account, but if you do, DON'T migrate this -- UNcheck it.
o. I would migrate everything else. Turn Setup Assistant loose and let the migration go through. This may take a little while.

When done, hopefully, the problem trash item(s) should be gone. MY REASONING behind this is: the non-removable trash items weren't part of your main account, they were part of the improperly deleted account. Since whatever was "left of" the old account was "left behind" on the backup drive, they shouldn't be there now.

I reckon this has a better chance of working for you.
It's a little more effort, but it may pay off.

Again, the "erase all content" operation goes VERY quickly.
"Longest" parts of the job are creating the cloned backup, and then re-migrating the data from the backup drive...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.