how can I make hard link ?

how can I make hard link ?

Post by FIVC Grou » Wed, 19 Nov 1997 04:00:00



I have problem.

I can't make hard link on directory.
With root login I type "ln -d /bin /home/user1 " and machine  say me
"operation not permited".

If root - no super user then who is it ?

regards
Andrey Podlesny.

 
 
 

how can I make hard link ?

Post by Marcel Lipm » Thu, 20 Nov 1997 04:00:00



>I have problem.

>I can't make hard link on directory.
>With root login I type "ln -d /bin /home/user1 " and machine  say me
>"operation not permited".

>If root - no super user then who is it ?

>regards
>Andrey Podlesny.

You can use hard links (ln file1 file2) on files, but not on directories.
You can use symbolic links (ln -s file1 file2) on both files and directories.
I have never heard of the -d flag.

Marcel.

+----------------------------------------------+
| Email address: mlipman at iname dot com      |
|                                              |

+----------------------------------------------+

 
 
 

how can I make hard link ?

Post by Sajjad Late » Thu, 20 Nov 1997 04:00:00


        Hard links cannot link directories by design. You can use a
symbolic (soft) link to link directories (across file systems) etc.
        Why? Lets just say this worked: ln -d /usr/home /usr/home/nouser
and you did "ls -lR /usr/home" - this would cause an infinite loop which
the kernel cannot detect or stop.

Sajjad

: I have problem.

: I can't make hard link on directory.
: With root login I type "ln -d /bin /home/user1 " and machine  say me
: "operation not permited".

: If root - no super user then who is it ?

: regards
: Andrey Podlesny.

 
 
 

how can I make hard link ?

Post by Ian Stirlin » Thu, 20 Nov 1997 04:00:00



: >I have problem.
: >
: >I can't make hard link on directory.
: >With root login I type "ln -d /bin /home/user1 " and machine  say me

Different filesystems?
Problem with existing directory?
<snip>

: You can use hard links (ln file1 file2) on files, but not on directories.
: You can use symbolic links (ln -s file1 file2) on both files and directories.
: I have never heard of the -d flag.

From linux man.

       -d, -F, --directory
              Allow the super-user to make hard links to directo-
              ries.

: Marcel.

: +----------------------------------------------+
: | Email address: mlipman at iname dot com      |
: |                                              |

: +----------------------------------------------+

--
Ian Stirling.   Designing a linux PDA, see  http://www.mauve.demon.co.uk/
----- ******* If replying by email, check notices in header ******* -----
Prosperity and ruin issue from the power of the tongue.
Therefore, guard yourself against thoughtless speech.

 
 
 

how can I make hard link ?

Post by Guy Harr » Fri, 21 Nov 1997 04:00:00



Quote:>       -d, -F, --directory
>              Allow the super-user to make hard links to directo-
>              ries.

But you may not want to do that; I don't know whether any GNU/Linux
tools would become confused by hard links to directories, but at least
some tools in some UNIXes might not like it (and some file-system
salvagers may treat them as errors and e.g. remove all but one of the
links).

Symlinks to directories don't require root permission, and are less
likely to*up tools.
--
Reply, or follow up, but don't do both, please.



 
 
 

how can I make hard link ?

Post by Jon LaBad » Sun, 23 Nov 1997 04:00:00



|> >       -d, -F, --directory
|> >              Allow the super-user to make hard links to directo-
|> >              ries.
|>
|> But you may not want to do that; I don't know whether any GNU/Linux
|> tools would become confused by hard links to directories, but at least
|> some tools in some UNIXes might not like it (and some file-system
|> salvagers may treat them as errors and e.g. remove all but one of the
|> links).

A major problem with hard links to directories is the ".." entry.
Note all ".." entries are hard links so it is possible to create
hard links to directories, just not with standard tools.

About a dozen years ago I had an absolute need for a hard link
to a directory.  It was on a system that did not have symbolic
links.  The second name I needed was in the same directory as
the original name (ex. /usr/foo and /usr/bar).  Thus the ".."
problem did not exist.

I created it by making a new directory and then using fsdb, I
altered the parent's data blocks to contain the same inode number
for both names.  Finally I ran fsck on the file system to clean
things up and it worked fine.

jl
--


 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

 
 
 

1. About Hard Link/soft link

HI All,

I have a question regarding hard/soft link. in unix/linux file system, I
just know some basic diffirent between hard/soft link. I check system like
solaris/redhat/bsd. the solaris used lots of hard link, the most is 27 hard
links.
Who can tell me some details what is real advantage using hardlink.

Thanks

Jaff

2. Linux Research Paper

3. how do I determine which file is linked to another (hard link)

4. SB Cd-Rom not working

5. Hard links vs. Soft links

6. Routing IP address over the net

7. Soft Link vs Hard Link

8. WINS/DHCP Type server

9. A hard link or a symbolic link?

10. Hard link to sym link - how to make?

11. hard links v soft links

12. hard links and symbolic links

13. Hard links and soft links