{"id":1120,"date":"2012-05-23T12:36:57","date_gmt":"2012-05-23T05:36:57","guid":{"rendered":"http:\/\/adhi.widjajanto.net\/weblog\/index.php\/2012\/05\/23\/convert_vdi_to_1\/"},"modified":"2015-06-05T14:24:56","modified_gmt":"2015-06-05T07:24:56","slug":"convert_vdi_to_1","status":"publish","type":"post","link":"https:\/\/adhi.widjajanto.net\/blog\/2012\/05\/23\/convert_vdi_to_1\/","title":{"rendered":"Convert VDI to Physical Harddisk"},"content":{"rendered":"<p>Part 1: Copy VM to Physical Harddisk:<br \/>\nOption 1:<\/p>\n<ul>\n<li>Shutdown your (i.e) <strong>source.vdi<\/strong> completely<\/li>\n<li>Use USB-HDD adaptor, plug in the target harddisk<\/li>\n<li>Get <a target=\"_blank\" href=\"http:\/\/sourceforge.net\/projects\/gparted\/files\/gparted-live-stable\/\">GParted LiveCD ISO<\/a><\/li>\n<li>From root user, create new VM using wizard and directly mount the detected USB-HDD adaptor<\/li>\n<li>Add GParted LiveCD ISO and source.vdi to the VM, and set it to boot from CD<\/li>\n<li>Start the VM, GParted launched<\/li>\n<li>Copy the whole partition from source to target &#038; resize the copied partition if necessary.<\/li>\n<li>Shutdown the VM<\/li>\n<\/ul>\n<p>Option 2:<\/p>\n<ul>\n<li>Shutdown your (i.e) <strong>source.vdi<\/strong> completely<\/li>\n<li>From root user, create (i.e) <strong>target.vmdk<\/strong> from (i.e) <strong>\/dev\/sdb<\/strong> using this command: <em>VBoxManage internalcommands createrawvmdk -filename target.vmdk -rawdisk \/dev\/sdb<\/em><\/li>\n<li>Get <a target=\"_blank\" href=\"http:\/\/sourceforge.net\/projects\/gparted\/files\/gparted-live-stable\/\">GParted LiveCD ISO<\/a><\/li>\n<li>From root user, create new VM using wizard and directly mount target.vmdk (theoritically it can be mounted after the VM wizard complete but I always got un-explainable error)<\/li>\n<li>Add GParted LiveCD ISO and source.vdi to the VM, and set it to boot from CD<br \/>\nStart the VM, GParted launched<\/li>\n<li>Copy the whole partition from source to target &#038; resize the copied partition if necessary.<\/li>\n<li>Shutdown the VM<\/li>\n<\/ul>\n<p>Part 2: Fix GRUB from physical hardware:<\/p>\n<ul>\n<li>Plug in the harddisk (i.e) \/dev\/sda<\/li>\n<li>Boot to CD or USB (NEVER FROM RUNNING OS!!!)<\/li>\n<li>sudo su<\/li>\n<li>mkdir \/media\/target<\/li>\n<li>mount \/dev\/sda1 \/media\/target<\/li>\n<li>mount &#8211;bind \/dev \/media\/target\/dev<\/li>\n<li>mount &#8211;bind \/proc \/media\/target\/proc<\/li>\n<li>mount &#8211;bind \/sys \/media\/target\/sys<\/li>\n<li>chroot \/media\/target<\/li>\n<li>grub-install \/dev\/sda<\/li>\n<li>exit<\/li>\n<li>reboot<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Part 1: Copy VM to Physical Harddisk: Option 1: Shutdown your (i.e) source.vdi completely Use USB-HDD adaptor, plug in the target harddisk Get GParted LiveCD ISO From root user, create new VM using wizard and directly mount the detected USB-HDD adaptor Add GParted LiveCD ISO and source.vdi to the VM,&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-1120","post","type-post","status-publish","format-standard","hentry","category-it-freaks"],"_links":{"self":[{"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/posts\/1120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/comments?post=1120"}],"version-history":[{"count":1,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/posts\/1120\/revisions"}],"predecessor-version":[{"id":1678,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/posts\/1120\/revisions\/1678"}],"wp:attachment":[{"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/media?parent=1120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/categories?post=1120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/tags?post=1120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}