{"id":632,"date":"2015-05-01T15:23:55","date_gmt":"2015-05-01T19:23:55","guid":{"rendered":"https:\/\/www.devolve.net\/blog\/?p=632"},"modified":"2015-05-01T15:23:55","modified_gmt":"2015-05-01T19:23:55","slug":"clone-hard-disk-with-rsync","status":"publish","type":"post","link":"https:\/\/www.devolve.local\/clone-hard-disk-with-rsync\/","title":{"rendered":"Clone hard disk with rsync"},"content":{"rendered":"

I recently wanted to move a system over to a faster, larger SSD. I didn’t want to have to re-install an OS, figure out which old files to transfer over, and then re-configure everything. That’s not a fun time in my book. <\/p>\n

Here’s what I did (on a live system, yeah!) to clone my disk. Note<\/strong> that this may cause data loss, don’t blame me, keep backups, blah blah…<\/p>\n

First, use a partition tool like GNU parted<\/code> to create a nice big partition on the new drive and mark it as bootable. Leave some space for other partitions or swap space. If you use a separate \/boot partition, then I think that needs the bootable flag instead. I’m only using a single root partition and swap. For the purposes of this tutorial, I’ll call my new root partition \/dev\/sdb1. YMMV. <\/p>\n

\r\nsudo su -\r\nmkdir d\r\nmount \/dev\/sdb1 d\r\nrsync -avhPWHAXx \/ d\/<\/pre>\n

Wait a while.<\/p>\n

blkid<\/pre>\n

Take note of the UUID listed for \/dev\/sdb.<\/p>\n

vi d\/etc\/fstab<\/pre>\n

Or use whatever editor you like and put the UUID for \/dev\/sdb in place of the existing UUID for \/.<\/p>\n

\r\nmount --bind \/dev d\/dev\r\nmount --bind \/sys d\/sys\r\nmount --bind \/proc d\/proc\r\nchroot d\r\ngrub-install \/dev\/sdb\r\nupdate-grub\r\nexit\r\numount d\/dev\r\numount d\/sys\r\numount d\/proc\r\numount d\r\nrmdir d<\/pre>\n

Now you should just need to swap out the drives.<\/p>\n","protected":false},"excerpt":{"rendered":"

I recently wanted to move a system over to a faster, larger SSD. I didn’t want to have to re-install an OS, figure out which old files to transfer over, and then re-configure everything. That’s not a fun time in my book. Here’s what I did (on a live system, yeah!) to clone my disk. […]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[34,16,26],"_links":{"self":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/632"}],"collection":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/comments?post=632"}],"version-history":[{"count":4,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/632\/revisions"}],"predecessor-version":[{"id":637,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/632\/revisions\/637"}],"wp:attachment":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/media?parent=632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/categories?post=632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/tags?post=632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}