avi530

Q: .MobileBackups.trash DELETION

Does anyone know the exact terminal command to delete .MobileBackups.trash from a macbook on mavericks. I have disabled local backups via terminal but the .MobileBackups.trash folder just won't go away. Using Daisy Disk, I can see that the folder is 20 GB. I have even filled my computer up with files so that there is only 2GB left on my SSD and the .MobileBackups.trash folder will still not delete automatically like it should. Would really appreciate some help!

MacBook Pro (Retina, Mid 2012), OS X Mavericks (10.9.1)

Posted on Jan 5, 2014 12:37 AM

Close

Q: .MobileBackups.trash DELETION

  • All replies
  • Helpful answers

Page 1 Next
  • by nbar,Solvedanswer

    nbar nbar Jan 5, 2014 12:40 AM in response to avi530
    Level 5 (6,980 points)
    Jan 5, 2014 12:40 AM in response to avi530

    sudo rm -rf /path/to/file

     

    Be careful with this command.

  • by avi530,

    avi530 avi530 Jan 5, 2014 12:48 AM in response to nbar
    Level 1 (0 points)
    Jan 5, 2014 12:48 AM in response to nbar

    what exactly goes in the /path/to/file portion. I am sorry I am not that experienced with terminal

  • by avi530,

    avi530 avi530 Jan 5, 2014 12:51 AM in response to avi530
    Level 1 (0 points)
    Jan 5, 2014 12:51 AM in response to avi530

    avis-mbp:~ avikahlon$ sudo rm -rf /.MobileBackups.trash

    Password:

    rm: /.MobileBackups.trash/Computer/2014-01-02-020314/Volume/Applications/CrashPlan. app: Operation not permitted

    rm: /.MobileBackups.trash/Computer/2014-01-02-020314/Volume/Applications: Directory not empty

    rm: /.MobileBackups.trash/Computer/2014-01-02-020314/Volume: Directory not empty

    rm: /.MobileBackups.trash/Computer/2014-01-02-020314: Directory not empty

    rm: /.MobileBackups.trash/Computer: Directory not empty

    rm: /.MobileBackups.trash: Directory not empty

     

     

    This is what I get when I execute this command

  • by avi530,

    avi530 avi530 Jan 5, 2014 12:53 AM in response to nbar
    Level 1 (0 points)
    Jan 5, 2014 12:53 AM in response to nbar

    Sorry for the confusion. This did the trick. Thank you so so much.

  • by Linc Davis,

    Linc Davis Linc Davis Jan 5, 2014 11:30 AM in response to avi530
    Level 10 (208,044 points)
    Applications
    Jan 5, 2014 11:30 AM in response to avi530

    For the record, you have been given irresponsible, dangerous, and incompetent advice in this thread by a habitual troublemaker. Never use the shell as a substitute for the Trash.

  • by avi530,

    avi530 avi530 Jan 5, 2014 11:38 AM in response to Linc Davis
    Level 1 (0 points)
    Jan 5, 2014 11:38 AM in response to Linc Davis

    Well his advice was the only thing that worked for me. I have tried everything else and Mavericks just would not empty the mobile backups trash on its own. The 20GB that I saved really helped since i have a SSD. For the record I did not use the shell as a substitute for the trash. There was no other way to delete the files. I was not able to add the folder to the trash because it was a locked folder. I am extremely thankful for his "irresponsible, dangerous, and incompetent advice" as it was the only thing that fixed a problem I've had for a very long time.

  • by nbar,Helpful

    nbar nbar Jan 5, 2014 11:46 AM in response to avi530
    Level 5 (6,980 points)
    Jan 5, 2014 11:46 AM in response to avi530

    You're welcome. Just ignore it.

  • by Linc Davis,

    Linc Davis Linc Davis Jan 5, 2014 12:53 PM in response to avi530
    Level 10 (208,044 points)
    Applications
    Jan 5, 2014 12:53 PM in response to avi530

    There was no other way to delete the files.

     

    Yes there was, and if you keep taking stupid advice from people who don't know anything about computers, you're going to lose your data. Good luck.

  • by avi530,

    avi530 avi530 Jan 5, 2014 2:57 PM in response to Linc Davis
    Level 1 (0 points)
    Jan 5, 2014 2:57 PM in response to Linc Davis

    So why don't u tell me how else I could have gotten rid of a locked folder that was supposed to delete automatically. I know plenty about computers and I know the risk of these commands. Also if you knew anything you would know that because I had a mobile backups.trash folder that I use time machine and wouldn't lose anything even if something went horribly wrong. (Which it didn't)

  • by bweinste,Helpful

    bweinste bweinste Sep 23, 2014 10:33 AM in response to avi530
    Level 1 (5 points)
    Sep 23, 2014 10:33 AM in response to avi530

    I had the same issue with the CrashPlan.app folder located within the /.MobileBackups.trash after turning off local backups. I was not permitted to delete it. "rm -rf" on this directory did not work for me.

     

    I had two problems because of this. My system log was full of errors regarding failure to delete the /.MobileBackups.trash directory. So if the operating system wanted to delete it and couldn't I figured something was wrong.

     

    For a very long time there was no evidence of this problem except in the logs. Starting today it caused the icon in the menu bar to report failed time machine backups. The logs showed that the backup was successful but an immediate attempt to delete that trash file failed.

     

    These two problems motivated me to take action.

     

    I ran "ls -lO" and saw that the CrashPlan.app folder had the "schg" flag set. This sets the directory to "system immutable". Running "chflags noschg CrashPlan.app" removed this flag. I could then remove the folder with "rm -rf". I decided it was safe to remove this single folder since it related to an application specific file. Since the root level file "/.MobileBackups.trash" was a system directory I decided to leave it alone. I hoped that subsequent attempts by the OS would succeed.

     

    I uninstalled CrashPlan and verified it was deleted from the Applications folder. I then triggered a time machine backup. The CrashPlan.app folder was reintroduced to the .MobileBackups folder. I got mad. I then decide to delete the trash folder. For me it's safe since I maintain two full clones of the boot volume on external drives.

     

    After this the logs and time machine menu bar icon stopped showing the error.

     

    Be very careful with the "rm -rf" command. It's so dangerous since you could delete a ton of stuff that could break your system. Make sure you understand the command.

     

    As an aside, Linc Davis' comments were astonishing. They made me very uncomfortable and a bit afraid to post my experiences. I hope he doesn't respond to this post.

  • by identd,

    identd identd Oct 23, 2014 3:35 PM in response to bweinste
    Level 2 (359 points)
    Oct 23, 2014 3:35 PM in response to bweinste

    Put the following code in AppleScript Editor:

     

    set cplocation to choose file with prompt "Choose the CrashPlan application you cannot delete"

    try

      do shell script "chflags nouchg \"" & POSIX path of cplocation & "\"" with administrator privileges

      do shell script "chflags noschg \"" & POSIX path of cplocation & "\"" with administrator privileges

    on error errmsg

      display alert "ERROR!" message errmsg

      tell me to quit

    end try

              display alert "Complete!" message "CrashPlan is now unlocked."

  • by korsbakken,Helpful

    korsbakken korsbakken Oct 24, 2014 3:36 PM in response to bweinste
    Level 1 (5 points)
    Oct 24, 2014 3:36 PM in response to bweinste

    CrashPlan setting the "system immutable" (schg) flag caused the same problem for me too. I found a way to correct the problem which did not require manual deletion or messing around with the original /Applications/CrashPlan.app folder. I simply cleared the schg flag on all the instances of CrashPlan.app under /.Mobilebackups.trash where the schg flag had been set (see recipe below). On the next Time Machine backup, the /.Mobilebackups.trash folder got deleted automatically as it should, with no errors in the console log. No need to rm -rf anything.

     

    To clear the schg flag on all files and folders under /.Mobilebackups.trash, enter the command below in the terminal (exactly as shown). This will work on anything that has the schg flag, not just CrashPlan:

     

    sudo find /.MobileBackups.trash/ -flags +schg -exec chflags noschg {} \;

     

    The "-flags +schg" part finds all files and folders under /.MobileBackups.trash with the schg flag set, while "-exec chflags noschg {} \;" executes the command "chflags noschg" on each of them, which clears the schg flag. This should be safe, since nothing in the .MobileBackups.trash folder should need to have the schg flag, and nothing other than CrashPlan.app did in my case.

     

    The drawback with this approach is that the problem may reappear at some point, but it does not seem to happen very often, so you can repeat the recipe whenever the problem resurfaces. I suspect it happens when CrashPlan autoupdates itself and makes changes to the /Application/CrashPlan.app folder, though I have not had an opportunity to confirm that yet. Unsetting the schg flag on /Applications/CrashPlan.app might be a permanent fix, but could in theory be unsafe, and CrashPlan would probably just reactivate the flag on the next autoupdate anyway.

  • by bweinste,

    bweinste bweinste Oct 24, 2014 3:42 PM in response to korsbakken
    Level 1 (5 points)
    Oct 24, 2014 3:42 PM in response to korsbakken

    When I said "Crashplan.app" directory I meant the one that I found under the /.MobileBackups.trash folder. Sorry to mislead you (and maybe everyone else).

  • by Bandit-CH,

    Bandit-CH Bandit-CH Dec 19, 2015 3:23 AM in response to korsbakken
    Level 1 (0 points)
    Dec 19, 2015 3:23 AM in response to korsbakken

    Halleluja, korsbakken. I never suspected Crashplan to be responsible, especially after deleting it 2 month ago.... Your command worked perfectly well and avoided rm -rf. Great work. Thx for your suggestion.

Page 1 Next