{"id":15308,"date":"2016-07-22T11:45:41","date_gmt":"2016-07-22T15:45:41","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=15308"},"modified":"2016-07-22T14:18:15","modified_gmt":"2016-07-22T18:18:15","slug":"xcode-8-illegal-hard-links-prevent-cloning","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/07\/22\/xcode-8-illegal-hard-links-prevent-cloning\/","title":{"rendered":"Xcode 8 Illegal Hard Links Prevent Cloning"},"content":{"rendered":"<p>After I installed Xcode 8 Beta 3, I could no longer back up my hard drive. SuperDuper reported errors like:<\/p>\n<blockquote><p>Error creating hard link \/Volumes\/HD Clone 14A\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Frameworks\/AccessibilityAudit.framework\/Versions\/A\/Resources\/en.lproj\/AuditIssues.strings to \/Volumes\/HD Clone 14A\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Resources\/en.lproj\/AuditIssues.strings for inode (null)<\/p>\n<p>Cloning HD, error creating hard link for file in Xcode-beta.app.<\/p><\/blockquote>\n<p>At first I thought that the drive was damaged, but the error still occurred after reformatting it. SuperDuper&rsquo;s <a href=\"https:\/\/twitter.com\/dnanian\/status\/755487421479981056\">Dave Nanian<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/dnanian\/status\/755487421479981056\"><p>Structure became illegal (hard link into app bundle) in 10.10.3 - break link by duplicating file...<\/p>\n<p>I assume they just did this in the latest beta. (It was previously an issue with Retrospect &amp; Anaconda.)<\/p><\/blockquote>\n<p>Indeed, Xcode-beta.app does contain a hard-linked file:<\/p>\n<pre>ls -l \/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility\\ Inspector.app\/Contents\/Frameworks\/AccessibilityAudit.framework\/Resources\/en.lproj\/\ntotal 48\n-rw-r--r--@ 2 mjt  staff   6141 Jul 14 18:08 AuditIssues.strings\n-rw-r--r--@ 1 mjt  staff     42 Jul 14 18:08 Localizable.strings\n-rw-r--r--@ 1 mjt  staff  10726 Jul 14 18:08 LocalizableOSX.strings<\/pre>\n<p>Note the &ldquo;2&rdquo; for &ldquo;AuditIssues.strings&rdquo;. Here are the two files with the same inode:<\/p>\n<pre>find \/Applications\/Xcode-beta.app\/ -name AuditIssues.strings -print -exec stat -f \"%i\" {} \\;\n\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Frameworks\/AccessibilityAudit.framework\/Versions\/A\/Resources\/en.lproj\/AuditIssues.strings\n38530212\n\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Resources\/en.lproj\/AuditIssues.strings\n38530212<\/pre>\n<p>The fix is to make the two files independent copies:<\/p>\n<pre>cd \"\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Resources\/en.lproj\/\"\nmv AuditIssues.strings AuditIssues.strings.old\ncp AuditIssues.strings.old AuditIssues.strings\nrm AuditIssues.strings.old<\/pre>\n<p>Now the files have different inodes:<\/p>\n<pre>find \/Applications\/Xcode-beta.app\/ -name AuditIssues.strings -print -exec stat -f \"%i\" {} \\;\n\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Frameworks\/AccessibilityAudit.framework\/Versions\/A\/Resources\/en.lproj\/AuditIssues.strings\n38530212\n\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Resources\/en.lproj\/AuditIssues.strings\n39006606<\/pre>\n<p>Update (2016-07-22): <a href=\"https:\/\/groups.google.com\/a\/continuum.io\/forum\/#!topic\/anaconda\/CB0zClGfh3c\">Mike Bombich<\/a> (developer of Carbon Copy Cloner) on the similar issue with Anaconda:<\/p>\n<blockquote cite=\"https:\/\/groups.google.com\/a\/continuum.io\/forum\/#!topic\/anaconda\/CB0zClGfh3c\"><p>This turns out to be an issue specific to <tt>*.app\/Contents\/PkgInfo<\/tt> and <tt>*.app\/Contents\/Resources\/*.lproj<\/tt> files. OS X does not want to permit the creation of a hard link between one of these items in an application bundle to another file in a non-application-bundle folder. I was unable to find an explanation for this behavior in Apple&rsquo;s documentation, nor in the source code for HFS or the OS X kernel.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>After I installed Xcode 8 Beta 3, I could no longer back up my hard drive. SuperDuper reported errors like: Error creating hard link \/Volumes\/HD Clone 14A\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Frameworks\/AccessibilityAudit.framework\/Versions\/A\/Resources\/en.lproj\/AuditIssues.strings to \/Volumes\/HD Clone 14A\/Applications\/Xcode-beta.app\/Contents\/Applications\/Accessibility Inspector.app\/Contents\/Resources\/en.lproj\/AuditIssues.strings for inode (null) Cloning HD, error creating hard link for file in Xcode-beta.app. At first I thought that the drive was damaged, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[146,1408,1199,369,226],"class_list":["post-15308","post","type-post","status-publish","format-standard","hentry","category-technology","tag-backup","tag-hard-links","tag-mac-os-x-10-11","tag-superduper","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=15308"}],"version-history":[{"count":9,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15308\/revisions"}],"predecessor-version":[{"id":15317,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15308\/revisions\/15317"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=15308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=15308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=15308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}