Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
do not use solaris but it should be the same as linux or unix
soft or symbolic is more of a short cut to the original file....if you delete the original the shortcut fails and if you only delete the short cut nothing happens to the original.
hard link is more of a mirror copy....do something to file1 and it appears in file 2
deleting one still keeps the other ok
Hard links share the same inode. Soft links do not.
Hard links can't cross file systems. Soft links do.
What does it mean when u say, hard links cant cross file system. Do you mean we can make hardlinks when the source file is in UNIX and destination file is in NTFS file system? (in a dual boot)?
What does it mean when u say, hard links cant cross file system. Do you mean we can make hardlinks when the source file is in UNIX and destination file is in NTFS file system? (in a dual boot)?
John
Hard links share the same inode (kind of like location on disk) which is confined to a certain file system. So your example of a source file on a unix partition and a destination file on a NTFS partition would need to be soft links.
Say a file starts at inode (sector) 4001 and ends at 5000. The file is "/export/home/john/mail.doc"
Then:
1. A hard link to "mail.doc" which is named "hardLinkToMail" contains the value: "4001".
2. A soft link to "mail.doc" which is named "softLinkToMail" contains the value: "/export/home/john/mail.doc".
In 1) the hard link can only point to the same disk. It can not point to another drive. All drives has an inode of value "4001", how can the hard link distinguish between all discs? Which drive's "4001" is it?
In 2) the soft link contains a string. The string can point to another filesystem on another drive, because the full path is specified
Is there something wrong with this forum? This thread has something like 9000 hits. The other threads has a couple of hundreds. 9000 hits sounds not plausible?
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Nothing wrong with the forum. Here are a couple of reasons that can explain this popularity:
- This thread is three years old
- Its title is a very common question
Hard link point to the file content
while Soft link points to the file name.
while size of hard link is the size of the content while soft link is having the file name size
While creating a link from source to Destination file. ----> The changes done in the source file will be effected in destination file.
But when The source file is deleted the destination file remains the same.
Soft Link:
While creating a link using soft link from source to destination file → the changes done in the source file will be effected in Destination file too.
But when the source file is deleted the destination file also gets invisible. i.e when u tried to check the destination file its says no such file or directory
Note: Its always best practice to give a hard link than soft link
Hard Link syntax: ln file1 file2
Soft link Syntax: ln -s file1 file2
Thanks & Regards,
Gopal Varma P
Last edited by gopa; 09-28-2012 at 04:45 AM.
Reason: Added new line
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
Originally Posted by gopa
Would like to request for the features like which are missing in Hard Links.
hard-links cannot cross file systems
you know immediately where a symbolic link points to while with hard links, you need to explore the whole file system to find files sharing the same inode.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.