You are not logged in.

#1 2008-05-26 11:07:29

benmorgan
Member
From: Germany
Registered: 2006-07-28
Posts: 67

[solved] Cannot create hard links

I cannot create hard links, and I do not know why.
Any time I create a link, it is a soft one, whether I run ln -s or ln
Anyone know why this is?

(And yes, it is on the same file system, on the same hard drive)

If it helps, here is the output of strace ln ../file file

execve("/bin/ln", ["ln", "../file", "file"], [/* 21 vars */]) = 0
brk(0)                                  = 0x8053000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=123982, ...}) = 0
mmap2(NULL, 123982, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f68000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0e\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1527914, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f67000
mmap2(NULL, 1308208, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e27000
mmap2(0xb7f61000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13a) = 0xb7f61000
mmap2(0xb7f64000, 9776, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f64000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7e26000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7e266c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7f61000, 4096, PROT_READ)   = 0
munmap(0xb7f68000, 123982)              = 0
brk(0)                                  = 0x8053000
brk(0x8074000)                          = 0x8074000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=4193728, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7c26000
mmap2(NULL, 929792, PROT_READ, MAP_PRIVATE, 3, 0x1b2) = 0xb7b43000
close(3)                                = 0
stat64("file", 0xbfe22124)              = -1 ENOENT (No such file or directory)
lstat64("../file", {st_mode=S_IFREG|0644, st_size=14, ...}) = 0
link("../file", "file")                 = 0
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?

Last edited by benmorgan (2008-05-26 11:14:55)

Offline

#2 2008-05-26 11:13:16

benmorgan
Member
From: Germany
Registered: 2006-07-28
Posts: 67

Re: [solved] Cannot create hard links

Something really bizarre is happening, when I run strace ln ../file file then it creates a hard link, but when I just run ln ../file file then it creates a soft link.

...

Perhaps there is an alias somewhere? I think that is the case.
Yes, that is correct.
I feel dumb now big_smile
But there's the answer to anyone who ever wants to know!

Offline

Board footer

Powered by FluxBB