How Do I Create a Sym Link

Discussion in 'Mac OS X Lion (10.7)' started by rocknblogger, Jan 5, 2012.

  1. rocknblogger macrumors 68020

    rocknblogger

    Joined:
    Apr 2, 2011
    Location:
    New Jersey
    #1
    I installed a hard drive in lieu of the super drive and I want to move my Pictures, Documents, Downloads, Music and Movies folders to that drive.

    And I want to be able to click the corresponding folder in the Finder sidebar to navigate to each of this folders.

    I've searched Google but haven't been able to find anything that's easy to understand.

    Do you know of a tutorial on how to do this that's written in plain English and easy to follow?

    Thanks in advance!!
     
  2. linuxcooldude macrumors 68020

    Joined:
    Mar 1, 2010
    #2
    If you use iTunes for your music, I know you can tell iTunes where your music is located in the advanced tab in preferences.
     
  3. tyche macrumors 6502

    Joined:
    Jul 30, 2010
    #3
    Well you can just drag the directories on your external drive and put them in your Finder favorites .

    To do a sym link the way I think you are talking about. Example your external drive is called '2tb'

    open terminal and cd to the directory you want the link made

    ln -s /Volumes/2tb/music music

    This will create a link called 'music' in this directory that is pointing to the external disk.
     
  4. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #4
    Someone correct me if I'm wrong, but I thought Finder aliases were just symlinks. In which case, you could just right click, create an alias, rename it, and move it into place.
     
  5. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #5
    Finder aliases are soft symlinks. Some programs do not or cannot follow them. Symlinks created with the ln command are hard symlinks and are fully able to present themselves as folders or files to everything that requests them.
     
  6. thundersteele macrumors 68030

    Joined:
    Oct 19, 2011
    Location:
    Switzerland
    #6
    Usually also in the command line one creates soft links, via "ln -s", as mentioned above.

    From wikipedia:
     
  7. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #7
    Right, I meant soft symlinks. Does the OP need a hard link? If all he wants to do is be able to navigate through the Finder...

    I guess if he wants certain programs to be able to follow those links then hard is what he wants, and then he'd want to drop the '-s' flag from the suggested command above.
     
  8. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #8
    Aliases are not quite symlinks. The ln -s command's soft symlinks are the correct solution to the OP's question, where an alias could cause problems with some programs.
     
  9. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #9
    Ahh, ok i thought an alias was exactly a symlink as created by ln -s. I learned something new today! :D
     
  10. rocknblogger, Jan 5, 2012
    Last edited: Jan 5, 2012

    rocknblogger thread starter macrumors 68020

    rocknblogger

    Joined:
    Apr 2, 2011
    Location:
    New Jersey
    #10
    EDIT: Okay I'm not sure what this did. My goal is to be able to click on the folder icons in the sidebar of Finder and take me to the chosen folder's contents. So if I click the Music folder it takes me to the music folder on the 500GB drive.

    Currently Music is stored in the default Music folder but I have a 240GB SSD and I want to move it to the 500GB drive but still have Lion understand that this is the default Music folder.

    Same for all the other file folders in the home directory. I hope I made that clearer.
    Sorry I can't multi-quote but thanks to everyone.

    With this method do I have to create the directories I want and then run that command or by running that command Lion will create the directories I want?

    I also remember reading somewhere that it's possible to set up two drives, an SSD and a spin drive, in such a way that Lion will show only a single primary drive and will automatically move files to the bigger drive as needed.

    I'm not talking about RAID, I know what RAID is and what it does. Does this sound familiar to anyone?

    I wish I had bookmarked that page :(
     
  11. theSeb, Jan 6, 2012
    Last edited: Jan 6, 2012

    theSeb macrumors 604

    theSeb

    Joined:
    Aug 10, 2010
    Location:
    Poole, England
    #11
    Correct, except that the "everything" bit. Unfortunately iTunes is not able to fully follow them.

    I've played with the idea of splitting up my iTunes library using symbolic links. I wanted the media info (stuff like album artwork), Books and Mobile Applications to remain on the SSD and then move the individual folders like Music, Movies, iTunesU and TV Shows to the second HDD.

    This works for playback, but it goes wonky if you download extra stuff. Basically iTunes won't follow the symlink if you download a movie and the file will not be moved into the correct directory. It will remain in the downloads folder.

    Also if you tick "Keep media organised" and then add an item to the library manually, it also won't follow the symlink and stick that item into the correct directory. For some strange reason iTunes uses an odd method in the code to do this that is not compatible with symbolic links. There are plenty of discussions on the net about this, which I only found after trying to do this.

    In the end I moved the entire library from the iTunes level to the second HDD and created a symbolic link called iTunes in the home/Music folder.

    ----------

    Apart from what was already mentioned, an alias is a lot larger ( a couple of megabytes vs a couple of kilobytes) and also an alias keeps track of what it is pointing to. So if you're pointing to a file and then you move it or rename it, the alias will continue to work. The symbolic link will no longer work and will need to be recreated to point at the new location.

    OP: copy the music folder to your other HDD. Create a symbolic link to it in your home drive called Music. Your sidebar buttons will continue to work because they are actually aliases.

    For example: if I move my Documents folder to somewhere else or rename it, the sidebar buttons will still work. But you still need to create a symbolic link to Documents in your home folder to make sure all other applications work as expected. I hope that makes sense.
     
  12. rocknblogger thread starter macrumors 68020

    rocknblogger

    Joined:
    Apr 2, 2011
    Location:
    New Jersey
    #12
    Can you give me a step by step because what I'm doing is not working. I did what tyche suggested and it doesn't work for me. I must be doing something wrong.
     
  13. theSeb macrumors 604

    theSeb

    Joined:
    Aug 10, 2010
    Location:
    Poole, England
    #13
    I'll check it out on my mini this weekend and post instructions.
     
  14. ppilone macrumors 6502

    Joined:
    Jan 20, 2008
    #14
    Do you want to move your entire home directory onto the HDD? I did the same thing when I installed an SSD in place of my superdrive - wrote up instructions here:

    http://www.element84.com/replacing-a-macbook-superdrive-with-an-ssd.html

    You'll want to scroll down to the "Moving data around" section.

    Disclosure: Link to my company's blog - don't want to seem like a spammer.
     
  15. rocknblogger thread starter macrumors 68020

    rocknblogger

    Joined:
    Apr 2, 2011
    Location:
    New Jersey
    #15
    That seems pretty straightforward. Move Home folder to hard drive, change user's path to point to that hard drive.

    This means that the Library directory will also be moved. Wouldn't having the Library on the hard drive impact speed when it comes to certain apps?
     
  16. ppilone macrumors 6502

    Joined:
    Jan 20, 2008
    #16
    Sure, any data saved to Application Support (as an example) would be read off the HDD. I installed a relatively small SSD so all of my data stays on the HDD.

    What I suggested does move your entire home folder so it may not be what you need.
     
  17. rocknblogger thread starter macrumors 68020

    rocknblogger

    Joined:
    Apr 2, 2011
    Location:
    New Jersey
    #17
    It's almost what I want. I want to get the most of my SSD so I would rather just move the personal file folders.
     
  18. smurray macrumors regular

    Joined:
    May 12, 2008
    #18
    I'm in the same situation as you. I want to store my media files/folders on an external drive, but am concerned about the Library folder residing there as well. I'm more concerned about what would happen if I were to ever reinstall Lion, since after I moved the home folder again there would be my old Library folder with all the settings from my previous install.
     
  19. systole macrumors member

    systole

    Joined:
    Mar 24, 2011
    Location:
    Minnesnowta
    #19
    Thanks for clarifying. As I continue to dive into the terminal and linux/unix, it's amazing how easy it is to confuse the different link types :eek:
     
  20. diamond3 macrumors 6502a

    Joined:
    Oct 6, 2005
    #20
    Has anyone tried this? I'm currently in the process of figuring this out but am not sure.

    I've got the SSD and a HDD in my mbp. I tried to create a sym link with the downloads folder first. Here are my steps

    Copy Downloads folder from SSD to HDD
    Does file structure matter? ex. On SSD: SSD/users/username/Downloads/ to just /HDD/Downloads?​

    After that, I opened terminal and pasted
    Code:
    sudo rm -rf ~/Downloads/
    entered password, which deleted folder on SSD

    Pasted the following into terminal
    Code:
    ln -s /Volumes/HDD/Downloads/ ~/Downloads
    I lose the downloads folder in the sidebar and my folder on my HDD doesn't have the normal download folder icon. This does create a symlink though in my username folder on the SSD so I thought it would work.

    So then I tested it by downloading a file from safari, but it defaults now to the desktop. I know I can change the path location in safari, but I thought that was the whole point of creating a sym link?

    Any help would be appreciated.
     
  21. rivervillager macrumors newbie

    Joined:
    Sep 14, 2012
    #21
    SSD+HDD and creation of symlinks

    Hi diamond3 - did you find a solution? I am having same problem: symlink works when I click on downloads folder, but when I download something it is directed to my desktop. I only want to transfer downloads, images, documents and other potentially large but infrequently accessed files to the HDD, which was placed in the opti-bay. I did a complete new install, and am running Mountain Lion on a pre-unibody 2008 MBP.
     
  22. CASLondon, Oct 16, 2012
    Last edited: Oct 16, 2012

    CASLondon macrumors 6502a

    Joined:
    Apr 18, 2011
    #22
    I'm finding myself in the same boat, standing a little confused. I want to do the same, keep Home on the SSD but move downloads, pictures, movies, music folders to the HDD and symlinks from SSD.

    Here are the references I've found

    http://mattgemmell.com/2011/06/21/using-os-x-with-an-ssd-plus-hdd-setup/

    I've used the symlink services download successfully, but I seem to have some permissions issues, or something. Its not as simple as it seemed. I can't delete the original special folders without a warning that OS needs them.

    Now I log in as a root user and start again. I can indeed delete via terminal the original downloads folder, put a new folder called downloads on the HDD, symlink it, move that symlink to the right spot on the original folder structure under users. All looks right, but then OS X seems to recreate a new "special" downloads folder ALONGSIDE my new symlink one.

    Anyone want to lay out the "For Dummies" version of moving Downloads, Pics, Etc to HDD and using symlinks?
     
  23. pukrnukr macrumors member

    Joined:
    Dec 16, 2010
    Location:
    Roc
    #23
    I know this is old but did you ever figure this out? I still can't delete the original downloads folder even though I'm logged in as the admin and root user.
     

Share This Page