Re: directory links - HOWTO

From: Dumas Patrice ([email protected])
Date: Fri Apr 27 2001 - 16:23:25 CEST


On Fri, Apr 27, 2001 at 07:57:24AM +0100, Robert Heezeman wrote:
> I have a RAM disk that is assigned to directory /tmp
> and I want to set directory links so that any
> operations like reading and writing files to say
> /home/ftp actually get written and read from the RAM
> at say /tmp/home/ftp
>
> Also how do identify directory links ??
>
> What is the difference beteen hard and symbolic
> directory links.

Here is what I understood ; I may be totally wrong, however :

There is no real difference between directories and files for that matter.

hard link increase the number of references to the directory in the inode, the
structure containing file information. It is really the same than the other
directory, and it remains the same even if you move one of the 2
directories. The 2 directories are the same, no one is more important than the
other. If you remove the destination, the other continue to be th same.

A symbolic link is not symetrical, nor a reference to a file. It is a
reference to a place in the filesystem, where, normally, a file lies. It isn't
at all the same than the destination, which is the real file.
If you remove the destination, the link is broken.

>
> This is what I tried
>
> mknod -m 660 /dev/ram b 1 0
> mke2fs -m0 /dev/ram 2048
> mount -n -t ext2 /dev/ram /tmp
>
> chmod ugo+rwx /tmp
>
> mkdir /tmp/home
> mkdir /tmp/home/ftp

This isn't good, the link will semm like a directory itself, no need to create one
before.

> ln -s /tmp/home/ftp /home/ftp

I think this isn't the right order, you should have done

        ln -s /home/ftp /tmp/home/ftp

Pat

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:18 CET