Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sng08

macrumors member
Original poster
Aug 30, 2010
30
0
Hi all,

I've just recently received my new iMac 27" i7 and have the SSD + HDD option, where the SSD contains OS + Applications and the HDD contains data. I read that moving the whole Home folder was not a good idea, therefore, I wanted to just move my Documents, Pictures and Download folder to the second internal HDD. I read an article/tutorial how to do this and this is what I followed (using Terminals):

Code:
cp -Rp ~/Documents /Volumes/Macintosh Data HD
chmod -R -N ~/Documents
rm -rf ~/Documents
ln -s /Volumes/Macintosh Data HD/Documents ~/Documents

However, when I try and type the symbolic link I get the error:
Code:
"ln: Documents: No such file or directory"

Because of this, the Documents folder on the Dock appears with a big question mark as it cannot locate the new Documents folder.

Any ideas how I can get the link working or if not try and restore the original documents folder and just move the entire Home folder over to the Hard Disk data drive?

Many thanks in advance!

(note: I don't have any documents in the folders as of yet so I haven't lost any important info!)
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
Hi all,

I've just recently received my new iMac 27" i7 and have the SSD + HDD option, where the SSD contains OS + Applications and the HDD contains data. I read that moving the whole Home folder was not a good idea, therefore, I wanted to just move my Documents, Pictures and Download folder to the second internal HDD. I read an article/tutorial how to do this and this is what I followed (using Terminals):

Code:
cp -Rp ~/Documents /Volumes/Macintosh Data HD
chmod -R -N ~/Documents
rm -rf ~/Documents
ln -s /Volumes/Macintosh Data HD/Documents ~/Documents

However, when I try and type the symbolic link I get the error:
Code:
"ln: Documents: No such file or directory"

Because of this, the Documents folder on the Dock appears with a big question mark as it cannot locate the new Documents folder.

Any ideas how I can get the link working or if not try and restore the original documents folder and just move the entire Home folder over to the Hard Disk data drive?

Many thanks in advance!

(note: I don't have any documents in the folders as of yet so I haven't lost any important info!)

Those spaces in "Macintosh Data HD" seem like a very bad idea. In Terminal, enter

Code:
cd /Volumes; ls -la
(lowercase L after the ; and after the hyphen)

Post the output.
 

sng08

macrumors member
Original poster
Aug 30, 2010
30
0
Those spaces in "Macintosh Data HD" seem like a very bad idea. In Terminal, enter

Code:
cd /Volumes; ls -la
(lowercase L after the ; and after the hyphen)

Post the output.

Hi, thanks for the quick reply. Below is the output:

Code:
cd /Volumes; ls -la

total 8
drwxrwxrwt@  6 root     admin   204 17 Sep 01:23 .
drwxrwxr-t  30 root     admin  1088 15 Sep 16:54 ..
drwxr-xr-x   1 SimonNg  staff  4096 16 Sep 12:21 BOOTCAMP
drwxrwxr-x   9 SimonNg  staff   374 17 Sep 00:26 Macintosh Data HD
lrwxr-xr-x   1 root     admin     1 17 Sep 01:23 Macintosh HD -> /
drwxr-xr-x   1 SimonNg  staff  4096 16 Sep 14:45 Windows Data HD
 

sng08

macrumors member
Original poster
Aug 30, 2010
30
0
In Terminal,

Code:
cd /Volumes/Macintosh*Data*HD; ls -la

Result:

Code:
cd /Volumes/Macintosh*Data*HD; ls -la
total 16
drwxrwxr-x  9 SimonNg  staff   374 17 Sep 00:26 .
drwxrwxrwt@ 6 root     admin   204 17 Sep 01:23 ..
-rw-r--r--@ 1 SimonNg  staff  6148 17 Sep 00:46 .DS_Store
drwx------  3 root     staff   102 16 Sep 12:35 .Spotlight-V100
d-wx-wx-wt  3 root     staff   102 17 Sep 01:24 .Trashes
drwx------  5 root     staff   170 17 Sep 01:17 .fseventsd
drwxr-xr-x@ 3 SimonNg  staff   102 17 Sep 00:31 Documents
drwxr-xr-x@ 3 SimonNg  staff   102 16 Sep 22:38 Downloads
drwxr-xr-x@ 3 SimonNg  staff   102 16 Sep 22:41 Pictures
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
OK, there's a directory named Documents where you copied it to.

In Terminal, enter

Code:
cd ~; ls -la
 

sng08

macrumors member
Original poster
Aug 30, 2010
30
0
OK, there's a directory named Documents where you copied it to.

In Terminal, enter

Code:
cd ~; ls -la

Result:

Code:
cd ~; ls -la
total 24
drwxr-xr-x+ 14 SimonNg  staff   476 17 Sep 01:24 .
drwxr-xr-x   5 root     admin   170 15 Sep 15:29 ..
-rw-------   1 SimonNg  staff     3 15 Sep 15:29 .CFUserTextEncoding
-rw-r--r--@  1 SimonNg  staff  6148 17 Sep 00:32 .DS_Store
drwx------   2 SimonNg  staff    68 17 Sep 01:24 .Trash
-rw-------   1 SimonNg  staff  2140 17 Sep 01:55 .bash_history
drwx------+  3 SimonNg  staff   102 15 Sep 15:29 Desktop
drwx------+  5 SimonNg  staff   170 16 Sep 22:17 Downloads
drwx------+ 30 SimonNg  staff  1020 15 Sep 17:15 Library
drwx------+  3 SimonNg  staff   102 15 Sep 15:29 Movies
drwx------+  4 SimonNg  staff   136 16 Sep 20:59 Music
drwx------@  6 SimonNg  staff   204 16 Sep 22:41 Pictures
drwxr-xr-x+  5 SimonNg  staff   170 15 Sep 15:29 Public
drwxr-xr-x+  5 SimonNg  staff   170 15 Sep 15:29 Sites
 

Angelo95210

macrumors 6502a
Jan 7, 2009
972
15
Paris, France
I just moved my entire home folder and I find it to be the perfect solution. There is no worries with this, it's even a recommended practice for linux users. Only precaution is to let one user on the main partition in case of failure.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
Result:

Code:
cd ~; ls -la
total 24
drwxr-xr-x+ 14 SimonNg  staff   476 17 Sep 01:24 .
drwxr-xr-x   5 root     admin   170 15 Sep 15:29 ..
-rw-------   1 SimonNg  staff     3 15 Sep 15:29 .CFUserTextEncoding
-rw-r--r--@  1 SimonNg  staff  6148 17 Sep 00:32 .DS_Store
drwx------   2 SimonNg  staff    68 17 Sep 01:24 .Trash
-rw-------   1 SimonNg  staff  2140 17 Sep 01:55 .bash_history
drwx------+  3 SimonNg  staff   102 15 Sep 15:29 Desktop
drwx------+  5 SimonNg  staff   170 16 Sep 22:17 Downloads
drwx------+ 30 SimonNg  staff  1020 15 Sep 17:15 Library
drwx------+  3 SimonNg  staff   102 15 Sep 15:29 Movies
drwx------+  4 SimonNg  staff   136 16 Sep 20:59 Music
drwx------@  6 SimonNg  staff   204 16 Sep 22:41 Pictures
drwxr-xr-x+  5 SimonNg  staff   170 15 Sep 15:29 Public
drwxr-xr-x+  5 SimonNg  staff   170 15 Sep 15:29 Sites

OK, the original Documents folder is indeed removed and the name is available. In Terminal, let's try again:

Code:
ln -s /Volumes/Macintosh*Data*HD/Documents  ~/Documents
 

sng08

macrumors member
Original poster
Aug 30, 2010
30
0
OK, the original Documents folder is indeed removed and the name is available. In Terminal, let's try again:

Code:
ln -s /Volumes/Macintosh*Data*HD/Documents  ~/Documents

Hi LPZ. I think it worked! The big black question mark on the documents folder has disappeared and it links to the second HD. Excellent. Thank you so much for your help!

So to move the folder, the symbolic link requires the * to denote a space?
Also, is it worth moving that folder back to the home and just move the entire HOME folder over or just individually move folders that I require over to the second internal hard drive?
 

sng08

macrumors member
Original poster
Aug 30, 2010
30
0
Sorry to be a pain, but to clarify the terminal code for moving the folder should be:

Code:
cp -Rp ~/Documents /Volumes/Macintosh*Data*HD
chmod -R -N ~/Documents
rm -rf ~/Documents
ln -s /Volumes/Macintosh*Data*HD/Documents ~/Documents
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
Sorry to be a pain, but to clarify the terminal code for moving the folder should be:

Code:
cp -Rp ~/Documents /Volumes/Macintosh*Data*HD
chmod -R -N ~/Documents
rm -rf ~/Documents
ln -s /Volumes/Macintosh*Data*HD/Documents ~/Documents

Glad it worked. The * will match any string of characters, so in particular it matches a single space character. My strong advice is to avoid names that contain space characters. Use something like MacintoshDataHD or Macintosh_Data_HD and problems like this are avoided.

Instead of using the * in the Terminal commands, you should be able to use the space characters, provided you precede each with a \

So the following should work:

Code:
cp -Rp ~/Documents /Volumes/Macintosh\ Data\ HD
chmod -R -N ~/Documents
rm -rf ~/Documents
ln -s /Volumes/Macintosh\ Data\ HD/Documents ~/Documents

Also, is it worth moving that folder back to the home and just move the entire HOME folder over or just individually move folders that I require over to the second internal hard drive?

Not sure which option is better, if either.
 

mmulin

macrumors 6502
Jun 22, 2006
404
0
So to move the folder, the symbolic link requires the * to denote a space?

Actually, '*' is used as a wild card character in most shells to replace any number of characters. The correct way would be to tell bash shell that there is a literal space between the words by escaping the space. Otherwise bash reads it as another argument to the preceding command.

string1\ string2
..denotes that string1 and string2 are actually one string containing the space character. Analogue, you can escape any special character if need (i.e. \* = literal * and not the wildcard mentioned above)
 

sng08

macrumors member
Original poster
Aug 30, 2010
30
0
Thank you so much for your help guys. I'm slowly starting to understand the whole symbolic link idea in terminal...(I think!)

I've managed to move the necessary folders over to the second internal HD and I believe are all operational.

Although one last query if I may: Within my Home directory I still see the Documents/Downloads/Pictures folders except with a small arrow on the bottom left corner which leads to the actual folder on the second HDD (thus creating a symbolic link). Although I thought with the "rm -rf ~/Documents" command I deleted the folder? I shouldn't really be concerned as it's a link to the actual folder rather than a folder which holds data? Thanks.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
Thank you so much for your help guys. I'm slowly starting to understand the whole symbolic link idea in terminal...(I think!)

I've managed to move the necessary folders over to the second internal HD and I believe are all operational.

Although one last query if I may: Within my Home directory I still see the Documents/Downloads/Pictures folders except with a small arrow on the bottom left corner which leads to the actual folder on the second HDD (thus creating a symbolic link). Although I thought with the "rm -rf ~/Documents" command I deleted the folder? I shouldn't really be concerned as it's a link to the actual folder rather than a folder which holds data? Thanks.

Code:
rm -rf ~/Documents
removed the original Documents directory from your Home directory.
Code:
ln -s /Volumes/Macintosh*Data*HD/Documents ~/Documents
created a symbolic link named Documents in your Home directory; this symbolic link item is displayed by OS X as a folder with a small arrow in the corner. There is no Documents directory/folder in your Home folder. You can verify this by entering

Code:
cd ~; ls -l

in Terminal. A line that begins with a "d" is a directory; a line that begins with a "-" is a file; a line that begins with an "l" is a link, as in this snippet:

Code:
drwxr-xr-x   2 root   staff    68B Dec 10  2008 libxslt-plugins
-rwxr-xr-x   1 root   staff   240K Dec 10  2008 libxslt.1.1.22.dylib
lrwxr-xr-x   1 root   wheel    20B Feb  8  2009 libxslt.1.dylib -> libxslt.1.1.22.dylib

There's nothing for you to be concerned about.
 

greenland

macrumors newbie
Apr 23, 2011
5
0
Undo symbolic link??

So this method worked for me. I just partitioned my HD and linked folders over.

HOWEVER, i liked my desktop to the partitioned HD and causes problems, saying "operation can't be completed"

SO, what do i have to do to undo the symbolic link i created??


Thanks in advance
 

greenland

macrumors newbie
Apr 23, 2011
5
0
Code:
unlink <sym link>

where <sym link> is the name of the link, not the file being linked to.

I don't understand. I'm getting this response:
-bash: syntax error near unexpected token `newline'

This is what i typed in to create the link

cp -Rp ~/desktop /Volumes/Files
chmod -R -N ~/desktop
rm -rf ~/desktop
ln -s /Volumes/Files/desktop ~/desktop
 
Last edited:

plinden

macrumors 601
Apr 8, 2004
4,029
142
I don't understand. I'm getting this response:



-bash: syntax error near unexpected token `newline'

This is what i typed in to create the link

cp -Rp ~/desktop /Volumes/Files
chmod -R -N ~/desktop
rm -rf ~/desktop
ln -s /Volumes/Files/desktop ~/desktop

You must have made a typo - what did you type in the unlink?

The Desktop folder starts with 'D' not 'd' - presumably that's a typo too?

Edit: by the way, when you get rid of the link, logging out and back in again should rebuild your Desktop folder and you can bring the files back. As mentioned earlier in this thread, you'd be better to move your whole home directory.
 
Last edited:

greenland

macrumors newbie
Apr 23, 2011
5
0
You must have made a typo - what did you type in the unlink?

The Desktop folder starts with 'D' not 'd' - presumably that's a typo too?

Edit: by the way, when you get rid of the link, logging out and back in again should rebuild your Desktop folder and you can bring the files back. As mentioned earlier in this thread, you'd be better to move your whole home directory.

Yes, that was a typo - should be a capital D
I just deleted both symbolic links (after moving everything to a temp folder). Logged back in and copied the old desk top items back.

I guess i could create symbolic links of individual folders on my desktop to the other driver, a pain yes, but that's the only other option i see (other than as you suggested - moving Home dir)

thanks for your help
 

sambuev

macrumors member
May 28, 2011
65
0
TO,ON,CA
Hello guys, I have MacBookPro 17,2001 with 128 SSD (from Apple) and another second hard drive on Optibay - 750GB.

Please can you show me, how can I move my
1. Documents
2. Downloads
3. Music
4. Movies
5. Pictures
6. Sites

to another hard drive.

Screen_shot_2011-06-30_at_5.46.58_PM.png


Can you give me a Terminal commands?
Thank you!
 

shinsundo

macrumors newbie
Jun 29, 2010
11
0
error after symlink?

Hello,

Being a newbie at Terminal, I have no idea what I'm doing. Thought everything went well but when clicking on symlink, I get

"The operation can’t be completed because the original item for “Documents” can’t be found." error.

Any help is appreciated!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.