<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Regarding &amp;quot;/bin/cp : will not create hard link&amp;quot;   message in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853081#M66889</link>
    <description>Hello, &lt;BR /&gt;&lt;BR /&gt;At the customer site, when he copy some data from NFS server to another NFS server&lt;BR /&gt;the following message appeared:&lt;BR /&gt;&lt;BR /&gt;[ENVIRONMENT] &lt;BR /&gt;RHEL AS 3 update6 &lt;BR /&gt;NFS server : NetApp server x 2&lt;BR /&gt;&lt;BR /&gt;----+--------------+---------+----------------&lt;BR /&gt; NetApp(/oradata) RHEL  NetApp(/oraback)&lt;BR /&gt;  &lt;BR /&gt;[MESSAGE] &lt;BR /&gt;/bin/cp : will not create hard link 'dir1' to directory 'dir2'&lt;BR /&gt;dir1:/oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS/audit&lt;BR /&gt;dir2:/oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS&lt;BR /&gt;&lt;BR /&gt;[ADDITIONAL INFORMATION] &lt;BR /&gt;- The nfs mount option are following:&lt;BR /&gt;    rw,fg,hard,nointr,rsize=32768,wsize=32768,tcp,nfsvers=3,nolock&lt;BR /&gt;- This copy has usually done by using shell script.&lt;BR /&gt;   The following are part of shell script:&lt;BR /&gt;      CP=/bin/cp&lt;BR /&gt;　    COPY_FROM=/oradata/xxxxx/sys/.snapshot&lt;BR /&gt;　    COPY_TO=/oraback/xxxxx/sys&lt;BR /&gt;       .........&lt;BR /&gt;       rm -rf ${COPY_TO}/*&lt;BR /&gt;　    ${CP} -rp ${COPY_FROM}/* ${COPY_TO}&lt;BR /&gt;&lt;BR /&gt;[FREQUENCY] &lt;BR /&gt;This phenomenon has occurred one time before now.&lt;BR /&gt;&lt;BR /&gt;[QUESTION] &lt;BR /&gt;- Why does the message appear ?  &lt;BR /&gt;  Could you tell me the possibility of this message ? &lt;BR /&gt;- If we can not find root cause, we must make any advice to catch the root cause.&lt;BR /&gt;  What shall we do to specify the root cause ? &lt;BR /&gt;&lt;BR /&gt;Thank you for advice.&lt;BR /&gt;Best Regards.&lt;BR /&gt;/Minoru.Asano&lt;BR /&gt;</description>
    <pubDate>Wed, 30 Aug 2006 04:06:04 GMT</pubDate>
    <dc:creator>Minoru Asano</dc:creator>
    <dc:date>2006-08-30T04:06:04Z</dc:date>
    <item>
      <title>Regarding "/bin/cp : will not create hard link"   message</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853081#M66889</link>
      <description>Hello, &lt;BR /&gt;&lt;BR /&gt;At the customer site, when he copy some data from NFS server to another NFS server&lt;BR /&gt;the following message appeared:&lt;BR /&gt;&lt;BR /&gt;[ENVIRONMENT] &lt;BR /&gt;RHEL AS 3 update6 &lt;BR /&gt;NFS server : NetApp server x 2&lt;BR /&gt;&lt;BR /&gt;----+--------------+---------+----------------&lt;BR /&gt; NetApp(/oradata) RHEL  NetApp(/oraback)&lt;BR /&gt;  &lt;BR /&gt;[MESSAGE] &lt;BR /&gt;/bin/cp : will not create hard link 'dir1' to directory 'dir2'&lt;BR /&gt;dir1:/oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS/audit&lt;BR /&gt;dir2:/oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS&lt;BR /&gt;&lt;BR /&gt;[ADDITIONAL INFORMATION] &lt;BR /&gt;- The nfs mount option are following:&lt;BR /&gt;    rw,fg,hard,nointr,rsize=32768,wsize=32768,tcp,nfsvers=3,nolock&lt;BR /&gt;- This copy has usually done by using shell script.&lt;BR /&gt;   The following are part of shell script:&lt;BR /&gt;      CP=/bin/cp&lt;BR /&gt;　    COPY_FROM=/oradata/xxxxx/sys/.snapshot&lt;BR /&gt;　    COPY_TO=/oraback/xxxxx/sys&lt;BR /&gt;       .........&lt;BR /&gt;       rm -rf ${COPY_TO}/*&lt;BR /&gt;　    ${CP} -rp ${COPY_FROM}/* ${COPY_TO}&lt;BR /&gt;&lt;BR /&gt;[FREQUENCY] &lt;BR /&gt;This phenomenon has occurred one time before now.&lt;BR /&gt;&lt;BR /&gt;[QUESTION] &lt;BR /&gt;- Why does the message appear ?  &lt;BR /&gt;  Could you tell me the possibility of this message ? &lt;BR /&gt;- If we can not find root cause, we must make any advice to catch the root cause.&lt;BR /&gt;  What shall we do to specify the root cause ? &lt;BR /&gt;&lt;BR /&gt;Thank you for advice.&lt;BR /&gt;Best Regards.&lt;BR /&gt;/Minoru.Asano&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Aug 2006 04:06:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853081#M66889</guid>
      <dc:creator>Minoru Asano</dc:creator>
      <dc:date>2006-08-30T04:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding "/bin/cp : will not create hard link"   message</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853082#M66890</link>
      <description>cp whitout parametrs is used to copy files NOT directories...&lt;BR /&gt;cp -r dir1 dir2 should be OK</description>
      <pubDate>Wed, 30 Aug 2006 04:18:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853082#M66890</guid>
      <dc:creator>g33k</dc:creator>
      <dc:date>2006-08-30T04:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding "/bin/cp : will not create hard link"   message</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853083#M66891</link>
      <description>Sorry didn't read carefully.. I think problem is in links&lt;BR /&gt;&lt;BR /&gt;Direct (hard) and indirect (soft or symbolic) links from one file or directory to another can be created using the ln command.&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;$ ln filename linkname&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;creates another directory entry for filename called linkname (i.e. linkname is a hard link). Both directory entries appear identical (and both now have a link count of 2). If either filename or linkname is modified, the change will be reflected in the other file (since they are in fact just two different directory entries pointing to the same file).&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;$ ln -s filename linkname&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;creates a shortcut called linkname (i.e. linkname is a soft link). The shortcut appears as an entry with a special type ('l'):&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;$ ln -s hello.txt bye.txt&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;$ ls -l bye.txt&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;lrwxrwxrwx 1 will finance 13 bye.txt -&amp;gt; hello.txt&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;$&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;The link count of the source file remains unaffected. Notice that the permission bits on a symbolic link are not used (always appearing as rwxrwxrwx). Instead the permissions on the link are determined by the permissions on the target (hello.txt in this case).&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;Note that you can create a symbolic link to a file that doesn't exist, but not a hard link. Another difference between the two is that you can create symbolic links across different physical disk devices or partitions, but hard links are restricted to the same disk partition. Finally, most current UNIX implementations do not allow hard links to point to directories.&lt;BR /&gt;&lt;BR /&gt;So I guess you have some hard link in directory you are trying to copy.&lt;BR /&gt;Use ls -l to see if I'm right</description>
      <pubDate>Wed, 30 Aug 2006 04:26:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853083#M66891</guid>
      <dc:creator>g33k</dc:creator>
      <dc:date>2006-08-30T04:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding "/bin/cp : will not create hard link"   message</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853084#M66892</link>
      <description>Hello, &lt;BR /&gt;&lt;BR /&gt;Thank you for quick reply.&lt;BR /&gt;&lt;BR /&gt;I am trying to reproduce this phenomenon at my lab, but I could not it.&lt;BR /&gt;If possible, could you tell me how to reproduce this message ? &lt;BR /&gt;&lt;BR /&gt;Thank you for advice.&lt;BR /&gt;Best Regards.&lt;BR /&gt;/Minoru.Asano</description>
      <pubDate>Thu, 31 Aug 2006 01:36:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853084#M66892</guid>
      <dc:creator>Minoru Asano</dc:creator>
      <dc:date>2006-08-31T01:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding "/bin/cp : will not create hard link"   message</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853085#M66893</link>
      <description>OK for human being:&lt;BR /&gt;&lt;BR /&gt;check the directory you are trying to copy:&lt;BR /&gt;&lt;BR /&gt;ls -l&lt;BR /&gt;&lt;BR /&gt;if you will see something like that&lt;BR /&gt;lrwxrwxrwx 1 will finance 13 bye.txt -&amp;gt; hello.txt&lt;BR /&gt;&lt;BR /&gt;it that it's not file but just link(ponter which refers to some real file).&lt;BR /&gt;&lt;BR /&gt;the problem is that cp is not able to copy this hard link to another physical disk.</description>
      <pubDate>Thu, 31 Aug 2006 10:36:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853085#M66893</guid>
      <dc:creator>g33k</dc:creator>
      <dc:date>2006-08-31T10:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding "/bin/cp : will not create hard link"   message</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853086#M66894</link>
      <description>The error message is complaining that the two directories&lt;BR /&gt;&lt;BR /&gt;/oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS/audit&lt;BR /&gt;and&lt;BR /&gt;/oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS&lt;BR /&gt;&lt;BR /&gt;have the same inode number.  They are two hard links to one directory.  That is not supposed to happen.  The cp source code has a comment noting that it does happen sometimes in Netapp servers.&lt;BR /&gt;&lt;BR /&gt;      /* Avoid damaging the destination file system by refusing to preserve&lt;BR /&gt;         hard-linked directories (which are found at least in Netapp snapshot&lt;BR /&gt;         directories).  */&lt;BR /&gt;&lt;BR /&gt;You could confirm the situation by running&lt;BR /&gt;ls -id /oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS/audit&lt;BR /&gt;and&lt;BR /&gt;ls -id /oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS&lt;BR /&gt;&lt;BR /&gt;then observing that the two directories have the same inode number.&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Aug 2006 18:00:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853086#M66894</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2006-08-31T18:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding "/bin/cp : will not create hard link"   message</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853087#M66895</link>
      <description>Hello, &lt;BR /&gt;Thank you for reply and detailed information.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;You could confirm the situation by running&lt;BR /&gt;&amp;gt;ls -id /oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS/audit&lt;BR /&gt;&amp;gt;and&lt;BR /&gt;&amp;gt;ls -id /oraback/xxxxx/sys/dbsys_snap_YYYYMMDDHHMSS&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;then observing that the two directories have the same inode number.&lt;BR /&gt;&lt;BR /&gt;Unfortunately, those file was deleted by daily operation, so he could not &lt;BR /&gt;confirm the inode information.&lt;BR /&gt;He will confirm it at next trouble time.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;By the way, he worry that the cp command argument which is specified at shell script was &lt;BR /&gt;different from error messages.&lt;BR /&gt;Regarding this phenomenon, is there any hints ? &lt;BR /&gt;&lt;BR /&gt;He executed the cp command like following:&lt;BR /&gt;/bin/cp -rp  SOURCE/.snapshot/dbsnap_sys_YYYYMMDDHHMISS/*  DESTINATION/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The file except directory was copied successfully, so shell parameter or " * " seems be no problem.&lt;BR /&gt;&lt;BR /&gt;After passing cp command's argument to /bin/ksh, is there any possibility to convert the path argument ? &lt;BR /&gt;&lt;BR /&gt;Thank you for support and advice.&lt;BR /&gt;Best Regards.&lt;BR /&gt;/Minoru.Asano&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Sep 2006 07:00:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853087#M66895</guid>
      <dc:creator>Minoru Asano</dc:creator>
      <dc:date>2006-09-13T07:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding "/bin/cp : will not create hard link"   message</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853088#M66896</link>
      <description>&lt;!--!*#--&gt;Your initial post indicated that the error message came from a script that did-&lt;BR /&gt;CP=/bin/cp&lt;BR /&gt;COPY_FROM=/oradata/xxxxx/sys/.snapshot&lt;BR /&gt;COPY_TO=/oraback/xxxxx/sys&lt;BR /&gt;.........&lt;BR /&gt;rm -rf ${COPY_TO}/*&lt;BR /&gt;${CP} -rp ${COPY_FROM}/* ${COPY_TO}&lt;BR /&gt;&lt;BR /&gt;That matches the paths in the error output.&lt;BR /&gt;It would be copying both the directories that appeared in the error message.&lt;BR /&gt;&lt;BR /&gt;If the command was-&lt;BR /&gt;/bin/cp -rp SOURCE/.snapshot/dbsnap_sys_YYYYMMDDHHMISS/* DESTINATION/&lt;BR /&gt;&lt;BR /&gt;then something is not as it seems.&lt;BR /&gt;Perhaps you really meant $SOURCE and $DESTINATION, or some expansion of those parts of the paths.  I would also be surprised that cp would mention that the&lt;BR /&gt;dbsnap_sys_YYYYMMDDHHMISS directory had the same inode as the dbsnap_sys_YYYYMMDDHHMISS/audit directory because that command line did not actually ask cp to copy the dbsnap_sys_YYYYMMDDHHMISS directory itself.</description>
      <pubDate>Wed, 13 Sep 2006 16:23:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regarding-quot-bin-cp-will-not-create-hard-link-quot-message/m-p/3853088#M66896</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2006-09-13T16:23:42Z</dc:date>
    </item>
  </channel>
</rss>

