{"id":175,"date":"2010-11-11T08:12:50","date_gmt":"2010-11-11T15:12:50","guid":{"rendered":"http:\/\/journeyman.ivystreetinc.com\/?p=175"},"modified":"2010-11-17T13:28:52","modified_gmt":"2010-11-17T20:28:52","slug":"dns-343-how-to-copy-drive-to-drive-faster","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=175","title":{"rendered":"DNS-343 How To Copy Drive to Drive Faster"},"content":{"rendered":"<p>The time came this week when I decided to replace my aging 500GB drives with something bigger and newer so I purchased two 2TB drives for about $95 a piece and started the task of dropping them into my NAS server planning for my usual mirrored configuration.\u00a0 I&#8217;m concerned with long term redundant storage on my NAS which is the DLink DNS-343.\u00a0 Can&#8217;t say enough about how much I like it.<\/p>\n<p>Currently my DNS-343 has 4 drives, two 1TB drives in a RAID 1 (mirrored) config, and the two 500GB drives mirrored.\u00a0 I treat the larger array like long-term memory, and the smaller array as short term and it is my more active array.\u00a0 I do this because the drives spin down on the DNS-343 when not in use so the larger drives are less apt to failure, being less used, protecting that data even more.\u00a0 And with planned drive upgrades its a nice way to rotate hardware through the NAS.<\/p>\n<p>So my planned upgrade would happen like this:<\/p>\n<ol>\n<li> First, you have two choices for the 500 GB data, since you won&#8217;t transfer this until last:\n<ol>\n<li>You can make a tar.gz of the data,\u00a0 transfer somewhere safe, and move it over at the end.<\/li>\n<li>You can just put one drive in the end and transfer the data in a telnet session.<\/li>\n<\/ol>\n<\/li>\n<li>Remove the 500GB Drives.<\/li>\n<li>Add the 2TB drives.<\/li>\n<li>Build the 2TB mirror array.<\/li>\n<li>Copy the data from the 1TB mirror to the 2TB mirror.<\/li>\n<li>Remove the 2TB drives, and replace with the 500GB drives.<\/li>\n<li>Rebuild the 1TB mirror, and copy the 500GB array data to the 1TB array.<\/li>\n<li>Put the 2TB drives back into place, and use the 500GB drives for something else maybe my surveillance system I am playing with (puppy linux has a nice live CD that recognizes camera hardware and has monit0r apps &#8212; &#8216;nother story).<\/li>\n<\/ol>\n<p>So I do all that but step 4, copy data, is taking FOREVER.\u00a0 I figure I have to copy about 700GBs over.\u00a0 It was taking days.\u00a0 Till finally &#8211; DOH! &#8211; I figured it out.<\/p>\n<p>Wired up to my network, I was using Windows from my notebook to do the copying.\u00a0 On a 100Mbps network!!!!\u00a0 And considering that the drives have to mirror the data, the network has other traffic on it, etc. its no wonder.<\/p>\n<p>Now at best, a 100Mbps network could copy 1 GB of data in about 82 seconds\u00a0 (1 gigbyte = 8192 megabits).\u00a0 That&#8217;s about 16 hours.\u00a0 But this wasn&#8217;t happening!\u00a0 The copy was taking <em>days<\/em>.<\/p>\n<p>So, I downloaded a cool free program off of CNET called Lan Speed Test to test my local.\u00a0 It was reporting my LAN speeds to actually be around 60Mbps.\u00a0 So that&#8217;s about 137 seconds to copy gigabyte.\u00a0 About 27 hours to copy all that data.\u00a0 But it was taking even longer &#8212; because of the read\/writes on the mirror on the NAS, I measured manually and the transfer was taking about 4 minutes a gigabyte!!\u00a0 Easily, it was going to take 47 hours or longer to copy and that&#8217;s the time it was taking.<\/p>\n<p>I thought &#8212; gee why don&#8217;t I just telnet in and do a Linux copy?\u00a0 I can telnet into my router, my modem.\u00a0 Well, it was <strong>almost <\/strong>trivial, I found out that you need to drop something called a &#8220;fun-plug&#8221; onto your machine to add telnet functionality.\u00a0 DLink probably locked it off at some level.\u00a0 People even root these NAS devices and install Debian, but I don&#8217;t want to program the thing I just want to finish installing my drives!!!!!<\/p>\n<p>So here were the steps:<\/p>\n<ol>\n<li>Make sure your DNS-343 is upgraded to the most current firmware.\u00a0 Currently its 1.03, obtained from the DLink site.<\/li>\n<li>Search on the net for &#8220;DNS-343 telnet&#8221; and you will find out about Fonz&#8217;s funplug.<\/li>\n<li>Download it from his site &#8212; two files.\u00a0 I got version 0.5, fun_plug and fun_plug.tgz.<\/li>\n<li>Drop the two files onto Volume_1.\u00a0 Fortunately, the drives I was keeping (the 1 TB drives) were in that configuration.<\/li>\n<li>Restart the DNS-343.\u00a0 It will unpack and install the telnet files on the device.<\/li>\n<li>Telnet into your device from the command line like &#8220;telnet 192.168.0.32&#8221; &#8212; don&#8217;t worry you aren&#8217;t prompted for a uid or password. (about security in a moment)<\/li>\n<li>The mirrored devices are located under \/mnt.\u00a0 What I did was go to the 2TB mirror under \/mnt\/HD_b2 (<strong>cd \/mnt\/HD_b2<\/strong>) and issued the copy command (use the -a option to preserve the directory timestamps): <strong>cp -a \/mnt\/HD_a2\/* .<br \/>\n<\/strong><\/li>\n<li>The copy ensues.<\/li>\n<li>At then end, just remove the fun_plug files and reboot &#8212; now the telnet functionality is uninstalled.\u00a0 There are ways of doing security and leaving it in but, like I said, I&#8217;m not interested in playing around I just wanted to copy files.\u00a0 By removing telnet altogether I don&#8217;t have that security hole.<\/li>\n<li>OK &#8212; to copy the data from the original drives.\u00a0 The DNS-343 won&#8217;t recognize the old RAID if you put it back.\u00a0 What you can do it insert one drive, mount it, and copy it or &#8212; if you tar&#8217;d up the filed and saved them just transfer them from wherever you stored them.<\/li>\n<\/ol>\n<p>So how was the performance?<\/p>\n<p>Well, at least four times faster easily than the network method.\u00a0 The data was being copied at a rate of about 1GB\/minute from one internal drive to another on the DNS-343.\u00a0 With this method I could copy all my data to the new drives in about 12 hours.\u00a0 Also it frees up my notebook from having to leave it running or at home while the copy is executing.<\/p>\n<p>Honestly, I was hoping for faster!\u00a0 The drives are 3 GBit sata drives, and I believe the busses in the device are supposed to be just that.\u00a0 But even if the busses are the older 1.5 GBit speeds, it should only have to take about, supposedly, 7 seconds to copy over 1 GB (1.5 GBit speed = about 150MB\/second) so my 700 GBs of data should have only taken 12 minutes to copy in a perfect world.\u00a0 \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The time came this week when I decided to replace my aging 500GB drives with something bigger and newer so I purchased two 2TB drives for about $95 a piece and started the task of dropping them into my NAS server planning for my usual mirrored configuration.\u00a0 I&#8217;m concerned with long term redundant storage on [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/175"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=175"}],"version-history":[{"count":7,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/175\/revisions"}],"predecessor-version":[{"id":177,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/175\/revisions\/177"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}