ditto Command Gone Wrong - Help!

Discussion in 'OS X Mavericks (10.9)' started by macsForLife, Feb 1, 2014.

  1. macsForLife macrumors member

    macsForLife

    Joined:
    Jul 8, 2008
    #1
    So, while using ditto to try to copy my home folder over to the new disk I had just installed, I noticed that it was strange there was no activity at all on the second disk, the free space was unchanged, as was the number of files. However, I noticed that the free space was falling, and quickly, on my current boot drive. In addition, the number of files was growing quickly. I killed the process, but now I'm down to 21 gigs of free space. I assume that I screwed up and somehow the system decided to copy the folder on the same drive...but I cannot find any of these files at all. There has been an increase of many thousands of files according to disk utility, but I cannot find any of them.

    Since it was my home folder, you would think that there would be duplicates of the media and documents within it, but there are not, at least not that I can find. Can someone please direct me as to what I have done, and how I can get rid of these ghost files? I am going to just drag and drop the home folder to change it now, but there was still over 25 gigs of files copied before I killed the process. I'd really like to find them and get rid of them. Serves me right for not triple-checking the code.

    Thank you so much in advance.
     
  2. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #2
    Download and use OmniDiskSweeper. It will provide a sorted list of what's consuming your space.

    While you may have been attempting to duplicate your home folder, you could have started cloning the entire contents of the drive.

    The Omnidisksweeper will show you a sorted list that may be helpful.
     
  3. macsForLife thread starter macrumors member

    macsForLife

    Joined:
    Jul 8, 2008
    #3
    Alright, thanks a lot, I appreciate it.

    Just to avoid this in the future, is this something that can happen regarding this command? The original directory is not referenced the way I typed my code, so I assumed that even after checking it again, if there was a mistake in the way I typed the destination it would simply return a "not found" error. I was pretty surprised when it did this.
     
  4. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #4
    It sounds like you had the destination path part of the ditto command wrong and it was pointed at the existing home folder somewhere.

    Can you post up the exact ditto command you used and it will be fairly easy to help you pinpoint your mistake? Just start Terminal and hit the up arrow to scroll through recent Terminal command then copy paste it here.
     
  5. macsForLife, Feb 2, 2014
    Last edited: Feb 2, 2014

    macsForLife thread starter macrumors member

    macsForLife

    Joined:
    Jul 8, 2008
    #5
    Sure no problem. I didn't do it yet simply because it was in another user account and I have to write it down. I did mess it up by missing a space. That's what I get for naming the second hard drive with a two word name. I'll have it up momentarily.

    Edit:

    Here it is, messed up a couple things: sudo ditto -v /Users/Evan/ /Volumes/Everything\Else/Users/Evan

    From what I know so far, there should have been a space between the backslash and Else, given the 2nd drive's name is currently Everything Else. Also, perhaps -v should have been "-V".

    2nd Edit: I was thinking about this last night, that the system created the directory "Everything Else" on the system drive due to my syntax error, and that there might be a directory called that on the system drive. Looks like Omni Sweeper has found it. Now I just need to get rid of it. I'm about as amateur as it gets when it comes to Unix however, so I'm still interested in seeing why exactly what I typed caused this to happen instead of just returning an error.
     
  6. kaibob macrumors regular

    Joined:
    Jun 21, 2010
    Location:
    Prescott, Arizona
    #6
    My knowledge of ditto is limited, but the man page does indicate that the destination folder will be created if it does not exist. Your boot drive has a hidden /Volumes folder, so I would normally expect the destination folder to be created and the files copied there. The /volumes folder does serve a special purpose but perhaps that doesn't matter.

    Anyways, I would open finder and then select from the top menu Go > Go To Folder. Then enter /volumes and see if Finder shows a folder with the name EverythingElse.

    I'm not sure why you used sudo with the ditto command. If you had not, you would have received a permission-denied message and you could have corrected the error in the destination folder. The use of the -v option does not make a difference.

    Although frustrating, this has not hurt anything and it's easily corrected.
     
  7. macsForLife thread starter macrumors member

    macsForLife

    Joined:
    Jul 8, 2008
    #7
    I used Omni Disk Sweeper and found the copied volume and got rid of it. I was instructed to use sudo when I was reading the process for moving the home folder, I assumed it was necessary due to the various levels and permissions of files being dealt with, so it didn't raise any red flags to me but I'm very limited in my Terminal knowledge.

    I'm tempted to try this again, this time being more careful with the command. In case anyone else is reading this and has any Mavericks-specific tips for moving the Home folder, I'd appreciate it. I've heard the permissions act strange under 10.9 when doing this, more so than in previous versions. However, given that it's mostly all movies and music, I'm hoping that it works out fairly well.
     
  8. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #8
    Sorry I'm late getting back. Looks like you figured out you needed that "escape character" and the space between "Everything\ Else". This is pretty common when users try to copy something from "Macintosh\ HD" also.

    Let's back up a bit though. On the Everything Else disk is OS X on there and is there an account called Evan and you want to move your data into that account? If that is what you are trying to do, I believe doing it this way is going to cause you problems with permissions just moving in the whole account.

    You would be better off moving data from disk one to something like /Volumes/Everything\ Else/Users/Shared/temp then login to Evan on the new disk and manually drag over folder contents from the Shared folder for the data you want like documents and music etc.

    Can you explain exactly what is on the second disk and what you are trying to do?
     
  9. macsForLife thread starter macrumors member

    macsForLife

    Joined:
    Jul 8, 2008
    #9
    So, currently I have two 500 gb drives on the system, one that it came with and one that I put in. The one I put in is formatted and empty. The original one is at about 70 gb of free space. My user folder is about 300 gb. Just about all of that (~275 gb) is media. I'd like to at the very least put the music and video folders on the second hard drive, perhaps even the whole user folder. I can then use the free space for whatever on the original hard drive and then have an additional 200+ gb of space on the second hard drive for more media. This was what I was trying to accomplish with ditto, just copying the home folder. I've tried the drag and drop method twice now but both times it throws me a permission error at some point during the transfer, not the same point though. Is there a way to get around this problem? That's really my biggest issue right now.
     
  10. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #10
    Okay... I see.

    You can move the entire home folder to another drive, but it is a hassle and people seem to have a lot of trouble with it. IMO you are better off picking the bid data hogs like Pictures and Music and just moving them to the second drive.

    For example the command below will copy your iTunes music and iTunes library (assuming you are storing music in iTunes and not another drive) to a folder called Music at the root of the Everything Else drive.

    Then just hold the option key when you boot iTunes and point it to the new location for the iTunes library.

    Code:
    ditto -v ~/Music/ /Volumes/Everything\ Else/
    Same deal here with your photos. Then option click launch iPhoto and point to the new folder.

    Code:
    ditto -v ~/Pictures/ /Volumes/Everything\ Else/
    You can do the same thing with your videos and even documents if you want.

    This leaves the home folder and its libraries (none of which is very large) on the main drive and the big data on the second drive.

    Once you get it all setup and backed up and you are sure it is working you can just delete the data from the main home folder. Check Time Machine exclusions to make sure the second drive is not on there so that it gets backed up.
     
  11. macsForLife thread starter macrumors member

    macsForLife

    Joined:
    Jul 8, 2008
    #11
    Alright, makes perfect sense. Thanks so much. I really appreciate it. Better get started on this as it will likely take a while.
     

Share This Page