mkdir "file exists"

Discussion in 'Mac Basics and Help' started by AareO, Aug 8, 2013.

  1. AareO macrumors newbie

    Joined:
    Aug 8, 2013
    #1
    Hi

    My MacBook Pro from 2010 crashed two days ago. Wan't boot OS. "Keys out of order (4, 35253) ** rebuilding catalog B-tree ** the volume Macintosh HD could not be repaired"

    I'm now trying to copy my data to an external hard drive before formatting and reinstalling OS. In single user mode I'm tying to mount the external hard drive to a folder but I can't create a new folder with mkdir. Saying "File exists". This is no matter where on the disk I try to create one.

    What is the reason mkdir want create a new folder?
     
  2. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #2

    What EXACTLY are you typing? Without knowing what you are doing all I can guess is that the error message is literally true.

    Can you type the mkdir and then an ls -a and post the result here.
     
  3. AareO thread starter macrumors newbie

    Joined:
    Aug 8, 2013
    #3
    Right now I just wanna create a folder.

    When typing "mkdir"
    usage: mkdir [-pv] [-m mode] directory ...

    When typing "mkdir /drive2"
    mkdir: /drive2: File exists

    When typing "ls -a"
    . .. Macintosh HD Mac2 1
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    Type (or copy and paste) each of the following commands. Then copy and paste the output into a reply:
    Code:
    pwd
    ls -la /
    ls -la ~
    ls -ld /drive2
    

    By the way, if "keys are out of order", then you have a damaged disk. Things like creating directories, or anything else, may not work. Worse, any damage that already exists could get worse as things are written to the damaged disk. Writing includes things like making directories.

    If you're in single-user mode, and you haven't issued a command to remount the disk as read/write, then the disk is mounted as read-only by default. If you don't understand what that means, then you should probably be following detailed instructions on what to do.
     
  5. AareO thread starter macrumors newbie

    Joined:
    Aug 8, 2013
    #5
    I have remounted the disk "/sbin/mount -uw /"

    The thing is I need to create a folder to mount the external hard drive so I can copy/backup all my data.

    I did a hardware test with the Mac hardware test mode and it didn't find any failure.

    Do you have any other suggestions to have I can backup my data?
     
  6. MacUser2525, Aug 9, 2013
    Last edited: Aug 9, 2013

    MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #6
    Try using the /tmp directory for it with mkdir /tmp/external_mount_point_name. Actually you should really use the mount command first to make sure that OSX has not already mounted the drive automatically if it has then you can simply copy the files to the already mounted drive if not then create mount point and mount external then copy. If it will not allow you to create directory then try using the /tmp directory that already exists as it.

    Edit: Also if you have your install disk then put that in the machine once it boots then you should be able to use disk utility to do all that you want graphically. With the Restore option using internal drive as source and external as destination.
     
  7. AareO thread starter macrumors newbie

    Joined:
    Aug 8, 2013
    #7
    I can't get in to restore mode. Get stuck at the gray screen with the apple logo.

    When running the mount command the external drive doesn't appear.

    Useing the mkdir command in tmp gives the same "file exists"
     
  8. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #8
    Try booting from an undamaged disk. If you don't have one, then you need to make one. If you don't know how to do that, or can't find how to do that, then ask for guidance. Here's a starting point:
    http://support.apple.com/kb/PH10763

    Found by googling: reinstall os x


    AFAICT, the disk (or volume) you're trying to make a directory on is the one that's damaged or corrupted. This is a bad idea, even if you can make it work, because damage/corruption can expand, and you can lose data. Since you can't even make it work, you need an alternative, which means booting from an undamaged disk.

    If the damaged disk is too far damaged, then it can cause any boot to fail. This happens because the damaged disk looks enough like a valid disk that the OS will try to mount it, but there's enough damage that subsequent file-system operations fail when malformed data is encountered.

    You may have to disconnect the damaged disk drive from its SATA connection, and plug it back in after a valid disk has been booted from. I have experienced this more than once, and it's a real pain to deal with. I know of no way other than physically disconnecting the damaged disk to get the machine to boot.
     
  9. AareO thread starter macrumors newbie

    Joined:
    Aug 8, 2013
    #9
    Thanks! Didn't thought about doing it that way. I will try.
    One of my challenges is I'm living on small island in Thailand and have only my broken MacBook, my iPhone, a really slow Internet connection and no computer store.
     
  10. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #10
    If you have such significant limitations, then please describe exactly what's available to you.

    What type of external disk (hard disk or flash)? What capacity? Is it being used, like for backups, or is it empty/eraseable?

    What tools for disassembly do you have? What's your experience in taking apart electronics and reassembling them?

    If you ordered components or tools from a mail-order supplier, would you have a local delivery service? How long would that take?

    Do you have an active warranty or AppleCare on the Mac in question? Could you ship it to Apple for repair? How about shipping it to a data-recovery business?

    If your Mac isn't working at all, exactly how are you making MacRumors posts?

    In short, describe your situation as completely as possible. Help us to help you. Dribbling out important limitations like "I'm living on a small island in Thailand" isn't helping anyone help you.
    http://www.mikeash.com/getting_answers.html
     
  11. AareO thread starter macrumors newbie

    Joined:
    Aug 8, 2013
    #11
    I'm very limited in what I can get shipped to and from here.

    I have a small screwdriver so I can open the computer and take out the hard drive. I have been working with computers for the last 14 years as a hoppy so great experience. But only mac for the last 2 years.

    The external disk is a hard disk with 500 Gb USB 3.0 and never been used. Empty

    I don't have any installation cd's at all. I can get in single mode and boot mode but not recovery or safe.

    I think the solution is to make a bootable installation of osx on the external hard drive. I can borrow a windows PC from a freind now and then that's all I got.
    Using my iPhone to write here on the forum
     
  12. jamietshaw macrumors member

    Joined:
    Sep 25, 2009
    Location:
    UK
    #12
    This may or may not help, but this is how I would normally mount something manually.

    1. First, check it hasn't already been automatically mounted by typing
      Code:
      mount
    2. Use
      Code:
      diskutil
      list to see the name you need to refer to when mounting, e.g. /dev/disk1
    3. Make a directory that will be turned into the mount in the next step, e.g.
      Code:
      mkdir /Volumes/test
      (any name and any location)
    4. Run something like
      Code:
      sudo mount -t fat32 /dev/disk1 /Volumes/test
      . You have to specify a value for
      Code:
      -t
      otherwise a message such as "mount: exec /System/Library/Filesystems/fat32.fs/Contents/Resources/mount_fat32 for /Volumes/test: No such file or directory" appears. See /System/Library/Filesystems/ for a list of file systems that OS X supports.
    5. If this doesn’t work you may have to work out some more options –*my quick example failed with "mount_msdos: Unsupported sector size (64543)"
     

Share This Page