Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hard links

Status
Not open for further replies.

warmongr

MIS
Mar 17, 1999
214
US
I have two partitions<br>
<br>
/dev/hda1<br>
/dev/hda5<br>
<br>
I want to link a directory on /hda1 to a directory on /hda5 ie.<br>
<br>
/home/ftp/mirrors/linux (/home is on /hda1)<br>
/usr1/mirrors/linux<br>
<br>
I want to link the 1st one to the second one.<br>
<br>
I used ln -d /usr1/mirrors/linux /home/ftp/mirrors/linux however I am getting an error message as follows:<br>
<br>
ln: cannot create hard link '`/usr1/mirrors/linux' to '/home/ftp/mirrors/linux': Invalid cross-device link. Any ideas.<br>
<br>
What is spawning this is I have a new ftp server and want to set this up like the old server. (Same partition settings) Is there another way to link them?<br>
<br>
war...
 
I would like to do as you suggest however that is not the way it is presently configured. I am trying to find out how this was accomplished and recreate it on the new ftp server.<br>
<br>
Thanks though,<br>
war....<br>
<br>
Any others<br>

 
Hmmm... 'ln -s' is the only way of linking directories (or files) across different file systems.<br>
<br>
Presumably, you're doing this because the partition on /dev/hda5 has the required amount of disk space? If so, then 'ln -s' should work for your requirements.<br>
<br>
There is something else you could do, though.<br>
<br>
Is the /usr1/mirrors/linux directory the only thing on that partition? Presumably, it isn't, so the next question is, can you make the required space as a new partition? If so, you can then simply 'mount' the partition under '/home/ftp/mirrors/linux'. I suspect this may be how it's set up on the old system you're transferring from. If 'df' shows '/home/ftp/mirrors/linux' as a seperate entry, then this is the case.<br>
<br>
There's a third way involving loopback filesystems, but it's a bit much to get into a this stage. (Plus, I've not set one up for quite a while ;^)<br>
<br>
HTH.
 
AndyBo,<br>
<br>
As always, you are correct. Had I applied a little unixism to my question I would have realized that hard links are inode dependent. ok, so I haven't had to think in a while. df does not show /home/ftp/mirrors/linux as a seperate entry and I will admit to being stumped on this one however I did as suggested and used a symbolic link and there is no harm, no foul and I can move on to my next emergency. <br>
<br>
Thanks all,<br>
war...
 
Thanks for the compliment War, but just to warn folks, I'm not always correct. See some of my other posts for proof ;^)<br>
<br>
Glad things are working for you,<br>
Andy
 
I know. However I appreciate your help. And that goes for all you guys in this forum.<br>
<br>
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top