[SOLVED] Copy files from a failed HD via external HD boot OR via terminal commands

Discussion in 'Mac Basics and Help' started by mufufu, Feb 22, 2012.

  1. mufufu, Feb 22, 2012
    Last edited: Feb 24, 2012

    mufufu macrumors member

    Joined:
    May 21, 2009
    #1
    How can I copy files from a folder (eg Volume/Users/Name/Music) inside an HD volume to an external HD (eg Lacie 500gb) via terminal commands from installation disc boot? What are the proper commands to type in the terminal?

    Please note that the HD volume that stores the folder that i want to copy (which is also where I install the OSX) is unbootable due to an invalid node structure issues. Thus I can only boot from installation disc. I have tried many solutions to no result. Now I just want to transfer the files in that "failed" volume to an external HD. Also note (not sure how much it matters) that I can see all the files there in the volume through disk utility restore option although I can't access it.

    So, again, suppose that copying files via terminal in installation disc boot is the only posssible solution, what commands should I type?

    Thanks a lot for the help!

    MacBook unibody (no FW). OS X 10.5.8
     
  2. mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #3
    Thanks for the quick reply. I'm not an expert so that single command looks rather cryptic to me. Would appreciate any further explanation.
     
  3. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #4
    Code:
    man cp
    is the manual for the "cp" command. Enter that into Terminal and see this:
    [​IMG]
     
  4. mufufu, Feb 22, 2012
    Last edited: Feb 22, 2012

    mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #5
     
  5. mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #6
    And I hope that transferring files from an unbootable volume that way is still possible?
     
  6. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #7
     
  7. miles01110 macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #8
    Transferring files from "unbootable" volumes is fine. Transferring files from unmountable volumes is obviously not possible through Terminal. I'm not sure if your hard drive error rendered the drive unmountable or not.
     
  8. mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #9
    From installation disc boot, when I type df in the terminal it shows the HD (disk0s2h). The disk utility also shows that the HD volume is mounted (and there's an option to unmount). I can also have a look of all the files inside the volume through the restore option in DIskutility (I can click the HD and all the folders and the files are there to be seen).

    Does it mean that the volume in question is clearly mounted? Conversely, how can we tell that a certain drive is unmountable?

    Lastly, suppose the volume turns out to be unmountable, what's the best way to retrieve the files therein? Thanks a lot. Much appreciated.
    ----------

     
  9. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #10
    Taking it out, like mentioned in my last post.

    Yes.

    But what about my question regarding having access to another Mac or Window computer and taking out the HDD and putting it into an enclosure for 2.5" S-ATA HDDs?
     
  10. mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #11
    Ow I actually answered that but it got mixed in the quote. That option is currently not doable since I'm now in a remote area with no other Mac or windows pc nearby. I'll consider that option once I have access but I really I hope I can resolve this asap with another solution since I urgently need some work-related files.
     
  11. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #12
    But what happens, once you are successful in retrieving the files?
    Do you reinstall your OS?

    As far as I have understood, you don't have a bootable OS on your external HDD.

    And from what kind of computer are you posting your posts?
     
  12. mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #13
    Well, as long as I can get ahold of the files I'll be very happy. Once I have the files, I'm thinking of reinstalling the osx from the Installation disc or any other ways. But my main concern right now is the retrieval of the work files and the iTunes folder first.

    Btw, I'm posting from my iPhone. I wonder if an iPhone could be of help in any way for the retrieval attempt?
     
  13. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #14
    Which kind of installation media do you have with you? And how much free space do you have on that HDD?

    Ah, it was missing that "mobile phone" gibberish you almost always see with posts from mobile devices.
    Only for communicating for help, as you do now, nothing more.
     
  14. mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #15
    A bit of tough luck actually. Now I only have two Kingston USB flash disk 8 and 2 gb respectively, but im not sure whether those flashdisks would be useful in this situation? I'm still waiting for a friend who's now looking for a spare external HD somewhere (could be WD or LaCie I'm not sure, probably from 250 to 500 gb). That's the reason why i haven't done anything yet.

    The total files I wish to retrieve is only around 150 gb, but what's urgent right now is the work folder and a recent iTunes folder with a total size of probably not more than 7 gb.

    Again, for now I haven't thought of anything other than copying the folders to an external media via terminal from disc installation boot.

    So what would you do if you were in my situation? Thanks a lot for your suggestions.
     
  15. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #16
    I would try myself with Terminal first, if I were in your situation.
    If that would not work, though it should, as it seems, then I would make contact with someone with another Mac and/or installation media for Mac OS X, that is compatible with my Mac.
    In Mac OS X 10.5 Leopard you have the option of an Archive and Install, which moves the old files into one folder (Previous System or so) and then reinstalls Mac OS X.
    In Mac OS X 10.6 Snow Leopard you can simply reinstall Mac OS X without any loss of data.

    Anyway, I always have a cloned backup with me, thus I can at least boot my Mac. I also always have the installer of Mac OS X 10.6 Snow Leopard with me on another partition of that HDD with the bootable backup.
    Now I just moved that HDD from an external enclosure into my MacBook Pro, thus I have an SSD for my OS and such, and the "new" HDD as backup and data HDD.
     
  16. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #17
    Archive and Install isn't going to help. An "invalid node structure" is significant file-system damage, and Disk Utility is unlikely to be able to repair it. A tool like DiskWarrior might, but the only way to know for sure is to try it (after preserving as much data as possible). If DiskWarrior or similar can't fix it, then the disk needs to be erased.

    Google the terms invalid node structure and you'll find any number of posts about the seriousness of this.

    I wouldn't count on Terminal being able to get the files reliably, either. It might work, or it might hang or crash, or it might copy them with corrupted data. No way to tell except by trying it and then opening each file to see if it's corrupted. If DiskWarrior identifies the exact files that are affected by the invalid node structure, that could be a big help in identifying which files to avoid, or to try copying last.


    As to the exact commands to type in Terminal, the first step is to identify which files need to be copied. We can't give an exact command line without knowing which files or folders to copy.
     
  17. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #18
    Thanks for the additional information, I have overlooked the invalid node structure part completely. :eek:
     
  18. mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #19
    Noted. Since you mentioned that you would also try copying files via terminal, actually my main question hasn't been answered ie the exact commands for cp (copy) to type in the terminal for my particular case. Say that I wish to copy the whole iTunes folder in the volume/disk0s2 to a..say, LaCie 500 gb portable disk?
    If it's not too much, would be grateful if I could have the exact string of commands for that.

    In any case, thanks a lot for all your explanations :)

    ----------

    Hello, many thanks for your helpful info.

    As to your question on which folders to copy, and my main question i.e. the exact commands for cp (copy) to type in the terminal, let's say that I wish to copy the whole iTunes folder in the volume/disk0s2 to a..say, LaCie 500 gb portable disk?
    If it's not too much, would be grateful if I could have the exact string of commands for that.

    Thanks again.
     
  19. Mac-Michael macrumors regular

    Joined:
    Jan 13, 2010
    #20
    It would be:
    Code:
    cp -R [source folder] [destination directory]/[foldername]/
    From the cp manual page:
    iTunes Music is in /Users/YourUserName/Music/iTunes/iTunes\ Music/
     
  20. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #21
    Command-lines require precision. You're not providing it.

    First, the mount name isn't necessarily "disk0s2", even if that's the device name that Disk Utility shows you. Second, the name of the folder where disks are usually mounted isn't "volume", it's "/Volumes". Note: it starts with "/" and ends with "s". Third, you haven't given the name of the LaCie portable disk, and we can't possibly guess what it might be.

    Because no one can give specific command-lines without knowing what the exact names are, please enter the following command in Terminal, exactly as posted. Copy and paste it if necessary.
    Code:
    ls -la /Volumes
    
    Then tell us very specifically which of the names listed from /Volumes is the LaCie portable disk.

    Also post the output of this command line:
    Code:
    mount ; echo ~ ; id
    
    If it seems like I'm being picky, it's because the command-line must be precise. You can't leave out slashes. You must spell things correctly. If you make a mistake, the command could do something you didn't expect. In the worst case, you can overwrite something you want to preserve, and that would be bad.
     
  21. mufufu, Feb 22, 2012
    Last edited: Feb 22, 2012

    mufufu thread starter macrumors member

    Joined:
    May 21, 2009
    #22
    Thanks a lot. Firstly, pls note that I'm accessing the terminal from osx installation disc boot. So if the target volume disk is "disk0s2" and my destination external HD is "disk2s1" (a 500 GB Western Digital USB portable external HD), is it correct to type the following commands?

    cp -R [disk0s2] [disk2s1]/Users/[MyUserName/Music/iTunes/iTunes\ Music]/

    And should I put the brackets exactly as above? Thanks in advance.
     
  22. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #23
    No, don't include the brackets. Also, volumes are stored in the /Volumes/ directory for this type of access, so you'll need more specific paths:

    Code:
    cp -R /Volumes/[disk0s2] /Volumes/[disk2s1]/Users/MyUserName/Music/iTunes/iTunes\ Music/
    Remember, your drive isn't named disk0s2, so don't put that in there. Instead, replace the part in brackets with the actual name of the drive as listed in the command posted by chown33.

    jW
     
  23. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #24
    The order of parameters to the cp command is wrong, if the intent is to copy from the iTunes music folder to an external drive.

    As I said before, commands require precision. I'm not picking on any one person here, just saying that unless it's very clear exactly what the names of everything is, and exactly what the goal of the command line is, imprecise or poorly formed command-lines can cause major problems.

    Also, posting hypotheticals like "let's say that I wish to copy the whole iTunes folder" is a bad idea, unless that's exactly what one wishes to do. If the only goal here is saving the OP's music collection, then there may be alternatives. Heck, maybe there's an alternative for saving other files. For example, is it possible to install the OS onto the external LaCie drive, boot from that, then use Finder to copy the files? I thought the goal was saving some important work files, so let's see some specifics about exactly where those files are located.
     
  24. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #25
    Oops, I missed that part. I wasn't paying attention to the previous posts, just trying to fix the code he'd posted.

    jW
     

Share This Page