• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 923
  • Last Modified:

The Missing Link

I have two directories named /sunquest/bin and /usr/local/bin that are, apparently, linked. When I compare their content, it is identical. The problem is that I can't figure out how they're linked. I haven't found a soft link, and information I've found elsewhere claims that hard links to directories cannot be created. Regardless, this is what the ls command is showing me...

# ls -lid /usr/local/bin
   32 drwxr-xr-x   10 root     system         8192 Aug 15 12:13 /usr/local/bin
# ls -lid /sunquest/bin
   32 drwxr-xr-x   10 root     system         8192 Aug 15 12:13 /sunquest/bin

...but when I run find like this...

  find / -inum 32

... the /sunquest/bin directory shows up but /usr/local/bin does not.
0
babyb00mer
Asked:
babyb00mer
4 Solutions
 
woolmilkporcCommented:
Maybe /usr/local and /sunquest are softlinked?
Given that /usr and / are  separate FSs hardlinks are not possible anyway.

wmp
0
 
yuzhCommented:
It is a hardlink, since they are sharing the same inode and data.
0
 
gheistCommented:
It shows 10 hard links to named directory, like subdirectories
ls -ld /sunquest
ls -ld /sunquest/bin
ls -ldi /sunquest/bin/*
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
sjm_eeCommented:
One other possibility is that you can get these if the same directory has been mounted over two other directories:

# ls -lid mnt*
131177 drwxrwxrwx   3 root     sys             512 07 Jul 2008  mnt1
131177 drwxrwxrwx   3 root     sys             512 07 Jul 2008  mnt2
# mount
  node       mounted        mounted over    vfs       date        options
-------- ---------------  ---------------  ------ ------------ ---------------
<snip>
         /aix/cache       /aix/mnt1        namefs 14 Sep 11:34 rw
         /aix/cache       /aix/mnt2        namefs 14 Sep 11:34 rw
0
 
babyb00merAuthor Commented:
I'll check that out.
0
 
babyb00merAuthor Commented:
I've never mounted the same device in two different places. Usually, I get an error message stating that the device is already mounted. Is this a feature of AIX?
0
 
woolmilkporcCommented:
You can't mount the same device twice on AIX, different mountpoints or not.
AIX will always tell you that the "... requested resource is busy".

And again, on AIX "/" and "/usr" are on different devices, so hardlinks between them are not possible, only symbolic links.
AIX will tell you that source and target "... are located on different file systems" if you try to hardlink them.

Moreover, hardlinks between directories are not allowed on AIX.
The error message will say that the source "... is a directory.  Cannot hard link" if you try.

The identical inode numbers must be the result of some very strange hazard, otherwise I, personally, couldn't explain them.

Anyway, please double check for symbolic links!

wmp



0
 
woolmilkporcCommented:
>> You can't mount the same device twice <<

but OK, as sjm_ee stated, you can mount a directory over a directory or a file over a file by means
of AIX's "namefs" functionality.

You stated that you never tried something similar, but please check with "mount" for the existence of "namefs" mounts anyway, as sjm_ee suggested above.


0
 
babyb00merAuthor Commented:
I don't have access to the AIX system right now, but I'll check all of these things tomorrow,
0
 
babyb00merAuthor Commented:
There are no "namefs" mounts.
0
 
babyb00merAuthor Commented:
Unfortunately, I never really solved this riddle. It remains a mystery. Everything suggested by the experts was reasonable, just not applicable.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now