{"id":243,"date":"2014-04-29T09:14:53","date_gmt":"2014-04-29T08:14:53","guid":{"rendered":"http:\/\/www.anginf.de\/?p=243"},"modified":"2017-09-12T23:35:56","modified_gmt":"2017-09-12T21:35:56","slug":"copy-a-complete-filesystem-containing-hardlinks-symlinks-different-user-names-etc-via-tcpip","status":"publish","type":"post","link":"https:\/\/www.anginf.de\/?p=243","title":{"rendered":"Copy a complete filesystem containing hardlinks, symlinks, different user names etc. via TCP\/IP"},"content":{"rendered":"<p>I had to move a LOT of data from an old linux server to a new one. As both systems had four disks configured as a software RAID-5, I couldn&#8217;t connect all drives to one computer. I was simply out of ports to plug the drives into. \ud83d\ude42<\/p>\n<p>I wanted to use <code>rsync<\/code>, that way I could make sure that all the permissions etc. will stay intact. This was important for me, as a part of the data was from the BackupPC-directory, and BackupPC uses a special user and uses a LOT of hardlinks.<\/p>\n<p>Simply copying everything with rsync wasn&#8217;t a success, the underlying SSH worked well, but the speed was by far too slow (~20MB\/s). The &#8222;old&#8220; machine wasn&#8217;t simply powerful enough to handle RAID-5, SSH and rsync with maximum performance at the same time.<\/p>\n<p>Using a differenct cyper (<code>-c arcfour<\/code>) helped a bit, but the speed was still too slow (~40MB\/s). As both computers were in the same secured LAN, I figured I didn&#8217;t need the additional protection and could use the rsync itself.<\/p>\n<p>In the config file and the commands below you must change &#8222;hostname&#8220; to the name of the &#8222;server&#8220; and the &#8222;sharename&#8220; accordingly. If you&#8217;re using a different IP range, change this as well.<\/p>\n<p>On the server (here: the old machine) I created a file &#8222;rsyncd.conf&#8220; with the following contents:<\/p>\n<pre lang=\"ini\">\r\nuse chroot = true\r\nhosts allow = 192.168.0.0\/24\r\nlog file = \/var\/log\/rsyncd.log\r\nlog format = %h %o %f %l %b\r\n\r\n[sharename]\r\ncomment = sharename\r\npath = \/\r\nread only = no\r\nlist = yes\r\nuid = root\r\ngid = root\r\n<\/pre>\n<p>And run this command on the server:<\/p>\n<pre lang=\"bash\">\r\nrsync --config=rsyncd.conf --daemon\r\n<\/pre>\n<p>On the client (here: the new, receiving machine) run this command:<\/p>\n<pre lang=\"bash\">\r\nrsync --delete -avPH hostname::sharename .\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I had to move a LOT of data from an old linux server to a new one. As both systems had four disks configured as a software RAID-5, I couldn&#8217;t connect all drives to one computer. I was simply out of ports to plug the drives into. \ud83d\ude42 I wanted to use rsync, that way &hellip; <a href=\"https:\/\/www.anginf.de\/?p=243\" class=\"more-link\"><span class=\"screen-reader-text\">Copy a complete filesystem containing hardlinks, symlinks, different user names etc. via TCP\/IP<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-243","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"_links":{"self":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=243"}],"version-history":[{"count":5,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/243\/revisions"}],"predecessor-version":[{"id":566,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/243\/revisions\/566"}],"wp:attachment":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}