LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2006, 11:09 PM   #1
tofee
Member
 
Registered: Mar 2006
Posts: 41

Rep: Reputation: 15
Query regarding hardlink and symbolic link.


hello ,

is there any way to make a hardlink/symlink to a target file which has no existence ?

is it possible to make a symbolic link of a existing hardlink or vice versa ?

we know that symbolic link can be made in different partition but is it possible to make hardlink into different partition ?

pls explain the concept .... thanks in advance.
 
Old 03-21-2006, 11:25 PM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Quote:
Originally Posted by tofee
is there any way to make a hardlink/symlink to a target file which has no existence ?
I don't think So...


Quote:
Originally Posted by tofee
is it possible to make a symbolic link of a existing hardlink or vice versa ?
Yes. but I cannot see a use for this


Quote:
Originally Posted by tofee
we know that symbolic link can be made in different partition but is it possible to make hardlink into different partition ?
No
 
Old 03-21-2006, 11:29 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by tofee
hello ,

is there any way to make a hardlink/symlink to a target file which has no existence ?
This makes no sense---what is the meaning of a link to a non-existent file? Did you mean EMPTY file? If so, then Yes...

Quote:
Originally Posted by tofee
is it possible to make a symbolic link of a existing hardlink or vice versa ?
Do you mean CONVERT from symbolic to hard? I don't think so.
Do you mean link to a link? Yes

Quote:
Originally Posted by tofee
we know that symbolic link can be made in different partition but is it possible to make hardlink into different partition ?
Yes

The concept?? A symbolic link is like a pointer--it redirects you to a real file. A hard link is like a mirror--the content is duplicated.
 
Old 03-21-2006, 11:32 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by perfect_circle
No
Said in response to hardlink in different partition...

I misread OP as saying "directory" and answered "yes". Why would it not work in a different partition?
 
Old 03-21-2006, 11:48 PM   #5
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Quote:
Originally Posted by pixellany
Said in response to hardlink in different partition...

I misread OP as saying "directory" and answered "yes". Why would it not work in a different partition?
A simlink is just a new file that somehow has inside it stored the path to a real file.

A hard link creates a copy of the i-node of the file. Hard link is not a link in the way you imagine it.

When you create a hard link what you do is have a second i-node pointing to the same data.

[i-node]-> [file data] <- [i-node]

To have a hard link in a different partition is like having a file half of which is stored in a different partition. This is not feasible.
 
Old 03-21-2006, 11:51 PM   #6
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
http://www.granneman.com/techinfo/li...dhardlinks.htm

Quote:
Soft links

* Pointers to programs, files, or directories located elsewhere (just like Windows shortcuts)
Quote:
Hard links cannot span disk drives, so you CANNOT have a hard link on /dev/hdb that refers to a program or file on /dev/hda
If you want a piece of advice, don't use hard links
 
Old 03-22-2006, 12:52 AM   #7
maxie
Member
 
Registered: Jan 2006
Location: South East Coast Australia
Distribution: Kubuntu/Ubuntu
Posts: 41
Blog Entries: 5

Rep: Reputation: 15
I´ve never had a reason to use hard links.
Is there an example?
What about... data in a shared folder.
user a has a hard link in his home to shared
user b also has a hard link in his home to shared
Is this like it?
 
Old 03-22-2006, 01:03 AM   #8
mbreith
Member
 
Registered: Feb 2006
Location: oregon
Distribution: PIII fedora2 | P4 fedora2 | Thinkpad fedora2
Posts: 54

Rep: Reputation: 15
As I understand it, yes. What I don't know is if the two hard links can have different permissions. Then user A and user B can both be owners of the same file. That is the only reason I can see to have hard links.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is a Symbolic Link? little_penguin Linux - Software 2 05-14-2005 09:27 AM
Symbolic link? jasone Linux - Newbie 4 05-06-2005 07:55 AM
symbolic link ilnli Slackware 6 01-04-2005 05:05 PM
help with a symbolic link mykrob Linux - Software 6 11-22-2004 10:01 AM
Symbolic link bwaynej2002 Linux - General 8 08-25-2003 10:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration