{"id":58,"date":"2017-03-23T23:06:28","date_gmt":"2017-03-23T23:06:28","guid":{"rendered":"https:\/\/ramblings.gregconway.com\/?p=58"},"modified":"2019-12-30T18:20:28","modified_gmt":"2019-12-30T18:20:28","slug":"clone-a-windows-boot-disk-to-a-smaller-disk-using-linuxaomei-backupper-standard-4-0-2","status":"publish","type":"post","link":"https:\/\/ramblings.gregconway.com\/?p=58","title":{"rendered":"Clone a Windows boot disk to a smaller disk using Linux"},"content":{"rendered":"<p>I while ago I foolishly borrowed a 4Tb SSHD from an ongoing project and now I need the disk back whilst preserving the data that&#8217;s on it. All I have is a 2Tb disk, which is enough for me to fit all the data on, but the disk duplicator can&#8217;t deal with it as the source drive is bigger than the target drive.<\/p>\n<p>1\/ In Windows &#8211; I used disk management to shrink the partition on the 4Tb disk down to the smallest possible size &#8211; approx 1.5Tb.<\/p>\n<p>2\/ In Linux I examined \/proc\/partitions and worked out my source disk is \/dev\/sdd and my target disk is \/dev\/sde.<\/p>\n<p>3\/ I used DD to copy the entire disk &#8211;<\/p>\n<p>dd if=\/dev\/sdd of=\/dev\/sde bs=128K conv=noerror,sync<\/p>\n<p>This eventually errored saying the disk was full. Another glance at \/proc\/partitions suggested the operation had failed, as I could only see \/dev\/sde (and not also \/dev\/sde1, \/dev\/sde2, etc). This was the case even after a reboot.<\/p>\n<p>4\/ However, I fired the disk up in Windows where it was immediately recognised as the originally 4Tb drive that&#8217;s now a 1.5Tb partition, along with an additional 0.5Tb of free space.<\/p>\n<p>5\/ I used computer management to resize the partition to maximum size (2Tb) and now I&#8217;m running chkdsk \/f (or&#8230; from the properties of the target hard drive&#8230; tools \/ error-checking \/ check now)&#8230; because you should always do this after manipulating partitions before you re-use the source disk! \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I while ago I foolishly borrowed a 4Tb SSHD from an ongoing project and now I need the disk back whilst preserving the data that&#8217;s on it. All I have is a 2Tb disk, which is enough for me to &hellip; <a href=\"https:\/\/ramblings.gregconway.com\/?p=58\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=58"}],"version-history":[{"count":2,"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":60,"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions\/60"}],"wp:attachment":[{"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ramblings.gregconway.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}