OpenSUSE 12.1: Unable to create hard link between separate fs

Hello, I installed a system with opensuse 12.1 with the following partitions:
/ dev/sda2 /
/ dev/sda3 / tmp
/ dev/sda6 / home
/ dev/sda5 / var

I have the following problem: I can not create hard links to /var and /.
If I try, for example, ln-s “/var/log/messages /tmp” and then I do “file /tmp/messages” I get “symbolic link in a loop” and I can not access the file.

Any idea?
luca

On 2011-12-10 16:16, lramellavotta wrote:

> I have the following problem: I can not create hard links to /var and
> /.

No, you can not create hard links across filesystem. Impossible since/for ever.

> If I try, for example, ln-s “/var/log/messages /tmp” and then I do
> “file /tmp/messages” I get “symbolic link in a loop” and I can not
> access the file.

You can not link a file to an existing directory, either.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2011-12-10 16:16, lramellavotta wrote:
> Hello, I installed a system with opensuse 12.1 with the following

By the way, your question is not related to hardware, you are in the wrong
forum.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

As robin_listas said:

No, you can not create hard links across filesystem. Impossible since/for ever.

Which is why symlinks were created in BSD oh, so long ago. IIRC it’s because with with hard links, the only thing that’s placed in the directory entry is the inode # of the beginning file (everything’s a file in unix) and the inode # is only unique within a given filesystem.

BTW-

ln-s “/var/log/messages /tmp”

(I assume you meant ln -s) doesn’t create a hard link. The -s option creates a symbolic link.

Actually you can, but he did something wrong with the syntax. I don’t know what’s with the quotes in his post.

# ln -s /var/log/messages /tmp
# file /tmp/messages
/tmp/messages: symbolic link to `/var/log/messages'

This assumes that /var/log/messages is a file, and /tmp/messages doesn’t exist.

Why do you want that kind of link anyway, OP?

On 2011-12-10 22:56, ken yap wrote:
> robin_listas;2416561 Wrote:

>> You can not link a file to an existing directory, either.
>
> Actually you can, but he did something wrong with the syntax. I don’t
> know what’s with the quotes in his post.

Ah, I see. It does not link to the directory, but creates a symlink instead
with the name of the file.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I wrote the quote to make the text more readable…

# ln -s /var/log/messages /tmp
# file /tmp/messages
/tmp/messages: symbolic link to `/var/log/messages'

This assumes that /var/log/messages is a file, and /tmp/messages doesn’t exist.

Why do you want that kind of link anyway, OP?

This is a example. The question is for qmail install…I can’t create the correct link from /var/qmail/ to /usr/bin (qmailctl etc…etc…)

this is my fstab

/dev/sda2 / ext4 acl,user_xattr 1 1
/dev/sda6 /home ext4 acl,user_xattr 1 2
/dev/sda3 /tmp ext4 acl,user_xattr,noexec 1 2
/dev/sda5 /var ext4 acl,user_xattr 1 2

I tried : ln -s /var/log/messages /home/
This work fine…

rootfs 6,0G 1,1G 4,6G 19% /
/dev/sda3 1012M 34M 928M 4% /tmp
/dev/sda6 11G 156M 11G 2% /home
/dev/sda5 20G 237M 19G 2% /var

It could be a problem with the partitioning?

In 18 years of linux knowledge have NEVER had a problem like this…(I have always worked with openbsd, this is the second time with opensuse)

Any idea?

On 2011-12-11 16:16, lramellavotta wrote:

>> Why do you want that kind of link anyway, OP?
>
> This is a example. The question is for qmail install…I can’t create
> the correct link from /var/qmail/ to /usr/bin (qmailctl etc…etc…)

It simply impossible to create hardlinks like that with your partitioning.
It is designed that way. You can create softlinks instead.

If qmail can not handle that situation, it is a bug with them.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

N.B. I write uncorrect title… ln -s isn’t hardlink. I known this… (please read my previous examples)

The problem are: why I cannot create SYMBOLIC link from /var to / ?

Ideas?

Luca

And more confusing. The unquoted text is fine. We know Unix/Linux.

This is a example. The question is for qmail install…I can’t create the correct link from /var/qmail/ to /usr/bin (qmailctl etc…etc…)

Show us a transcript of what you are doing with error messages, in a CODE tag.

A symlink from /var to / ??? Why, o why? Please, I think I understand what you mean, but please, write what you mean, don’t make us interpret.

Here’s what I do with mysql, which databases reside in /var/lib/mysql/. I “mv” the mysql folder to some other partitiion mounted on /Extra. Next I


ln -s /Extra/mysql /var/lib/mysql

Hope this helps you.

On 2011-12-11 21:16, lramellavotta wrote:
> The problem are: why I cannot create SYMBOLIC link from /var to /
> ?

Show us a CLI sample that demonstrate that problem. Post using code tags.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I thank you for the recommendations. I successfully installed qmail on openbsd without problems.
I apologize for the time…:shame: