{"id":550,"date":"2021-03-14T22:43:37","date_gmt":"2021-03-14T21:43:37","guid":{"rendered":"https:\/\/petr.maxbox.cz\/?p=550"},"modified":"2021-03-14T22:53:30","modified_gmt":"2021-03-14T21:53:30","slug":"raid1-ubuntu-16-04-p2v-physical-to-virtual-conversion-using-clonezilla-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/petr.maxbox.cz\/index.php\/2021\/03\/14\/raid1-ubuntu-16-04-p2v-physical-to-virtual-conversion-using-clonezilla-ubuntu-16-04\/","title":{"rendered":"RAID1 Ubuntu 16.04 P2V (physical to virtual conversion) using clonezilla Ubuntu 16.04"},"content":{"rendered":"\r\n<p>ispirace zde: <a href=\"https:\/\/www.youtube.com\/watch?v=wSTk9BLwF5k&amp;ab_channel=LawrenceSystems\">https:\/\/www.youtube.com\/watch?v=wSTk9BLwF5k&amp;ab_channel=LawrenceSystems<\/a><\/p>\r\n<p>video z instalace zde: <a href=\"https:\/\/maxbox.cz\/nextcloud\/index.php\/s\/jE2bzDi9TS7kHo5\">https:\/\/maxbox.cz\/nextcloud\/index.php\/s\/jE2bzDi9TS7kHo5<\/a><\/p>\r\n\r\n\r\n\r\n<p>Na st\u00e1vaj\u00edc\u00edm fyzick\u00e9m serveru maxbox je Ubuntu 16.04.6 LTS (Xenial Xerus)<\/p>\r\n\r\n\r\n\r\n<p>software RAID1 (2 x 2TB SATA HDD WDC WD2004FBYZ)<\/p>\r\n\r\n\r\n\r\n<p>Struktura disk\u016f je n\u00e1sleduj\u00edc\u00ed<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">petr@maxbox:~$ sudo fdisk -l\r\nDisk \/dev\/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: dos\r\nDisk identifier: 0x4d84172a\r\n\r\nDevice \u00a0 \u00a0 Boot\u00a0 \u00a0 \u00a0 Start\u00a0 \u00a0 \u00a0 \u00a0 End\u00a0 \u00a0 Sectors\u00a0 Size Id Type\r\n\/dev\/sda1\u00a0 *\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 2048\u00a0 195311615\u00a0 195309568 93.1G fd Linux raid autodetect\r\n\/dev\/sda2\u00a0 \u00a0 \u00a0 \u00a0 195313662 3907028991 3711715330\u00a0 1.7T\u00a0 5 Extended\r\n\/dev\/sda5 \u00a0 \u00a0 \u00a0 3891404800 3907028991 \u00a0 15624192\u00a0 7.5G fd Linux raid autodetect\r\n\/dev\/sda6\u00a0 \u00a0 \u00a0 \u00a0 195313664 3891404799 3696091136\u00a0 1.7T fd Linux raid autodetect\r\n\r\nPartition table entries are not in disk order.\r\n\r\n\r\nDisk \/dev\/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: dos\r\nDisk identifier: 0x076a9f4c\r\n\r\nDevice \u00a0 \u00a0 Boot\u00a0 \u00a0 \u00a0 Start\u00a0 \u00a0 \u00a0 \u00a0 End\u00a0 \u00a0 Sectors\u00a0 Size Id Type\r\n\/dev\/sdb1\u00a0 *\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 2048\u00a0 195311615\u00a0 195309568 93.1G fd Linux raid autodetect\r\n\/dev\/sdb2\u00a0 \u00a0 \u00a0 \u00a0 195313662 3907028991 3711715330\u00a0 1.7T\u00a0 5 Extended\r\n\/dev\/sdb5 \u00a0 \u00a0 \u00a0 3891404800 3907028991 \u00a0 15624192\u00a0 7.5G fd Linux raid autodetect\r\n\/dev\/sdb6\u00a0 \u00a0 \u00a0 \u00a0 195313664 3891404799 3696091136\u00a0 1.7T fd Linux raid autodetect\r\n\r\nPartition table entries are not in disk order.\r\n\r\n\r\nDisk \/dev\/md0: 93.1 GiB, 99931389952 bytes, 195178496 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/md2: 7.5 GiB, 7995392000 bytes, 15616000 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/md1: 1.7 TiB, 1892264443904 bytes, 3695828992 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<\/pre>\r\n\r\n\r\n\r\n\r\n\r\n<p>Na ProxMoxu vytvo\u0159\u00edme virtu\u00e1ln\u00ed server linux (bez instalace konkr\u00e9tn\u00edho opera\u010dn\u00edho syst\u00e9mu) s velikost\u00ed disku 2 TB = 2048 GB = 2097152 MB\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Na tomto virtu\u00e1ln\u00edm serveru nabootujeme z CD Live Clonezilla<\/p>\r\n\r\n\r\n\r\n<p>v Clonezilla odskok do termin\u00e1lu<\/p>\r\n\r\n\r\n\r\n<p>pomoc\u00ed \u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo fdisk \/dev\/sda\u00a0<\/code>\u00a0<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>vytvo\u0159it disk DOS:\u00a0\u00a0 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">o \u00a0 create a new empty DOS partition table<\/code><\/li>\r\n<li>na n\u011bm vytvo\u0159it stejn\u011b velk\u00e9 odd\u00edly (partitions) jako jsou na fyzick\u00e9m (zdrojov\u00e9m) serveru <strong>(Extended partition nevytv\u00e1\u0159et &#8211; nen\u00ed pot\u0159eba.)<\/strong><\/li>\r\n<li>nadefinovat typ odd\u00edlu na \u201cLinx raid autodetect\u201d (fd)<\/li>\r\n<\/ul>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/dev\/sda1\u00a0 *\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 2048\u00a0 195311615\u00a0 195309568 93.1G fd Linux raid autodetect\r\n\/dev\/sdb5 \u00a0 \u00a0 \u00a0 3891404800 3907028991 \u00a0 15624192\u00a0 7.5G fd Linux raid autodetect\r\n\/dev\/sdb6\u00a0 \u00a0 \u00a0 \u00a0 195313664 3891404799 3696091136\u00a0 1.7T fd Linux raid autodetect<\/pre>\r\n\r\n\r\n\r\n\r\n\r\n<p>Zdrojov\u00fd server rebootovat a spustit na n\u011bm CD clonezilla live<\/p>\r\n<ul>\r\n<li>vybrat klonov\u00e1n\u00ed local partition to remote partition<\/li>\r\n<li>vybrat prvn\u00ed partition, kterou budeme p\u0159en\u00e1\u0161et.<br \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/jAWgYoE4s3FJCpg_eqTUoiKA1LmAex0ePIvkAg6mxwdgF7Ci-g3HtWfm7LckG7R8pGaXzeSbDsJjqbbANxJ8FlcSBFhQ8xn0kY1yybPHeWstljUMKeAGxblAJZhG8bgLm3sNEkOb\" width=\"504\" height=\"422\" \/><\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Na c\u00edlov\u00e9m stroji spustit CD Clonezilla live<\/p>\r\n<ul>\r\n<li>vybrat part_to_remote_part<\/li>\r\n<li>vybrat odpov\u00eddaj\u00edc\u00ed target partition (partition se stejnou velikost\u00ed jako na zdrojov\u00e9m sesrveru).\u00a0<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Zah\u00e1jit proces p\u0159enosu.<\/p>\r\n\r\n\r\n\r\n<p>Takto opakovat pro v\u0161echny 3 partitions\u00a0<\/p>\r\n\r\n\r\n\r\n\r\n\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/gcImj1Ow2RFKKovQBG-8fTtKE6VQ5geUuhv04I92G8sB8CU6E2w6sv9MgoWuXTRlaS6sEOk5pMmmQrqwXg6Ee7tbXixOctXME748lKY86Hj0UN3kno2D74sI4JCgmsR8d9MpxeTq\" width=\"577\" height=\"213\" \/><\/p>\r\n\r\n\r\n\r\n<p>Na Proxmox reboot virtu\u00e1ln\u00edho serveru\u00a0 (jako bootovac\u00ed vybrat CD Ubuntu server disk).\u00a0 Ve volb\u011b na CD vybrat rescue mode.<\/p>\r\n\r\n\r\n\r\n<p>Odsko\u010dit do shellu (Alt+F2)<\/p>\r\n\r\n\r\n\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cat\/proc\/mdstat\r\nall disks inactive<\/pre>\r\n<p>z menu rescue Ubuntu vybrat<\/p>\r\n<ul>\r\n<li>&#8220;assemble disc array&#8221;<\/li>\r\n<li>partitons to assemble automatic\u00a0<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>\u00a0Alt+F2 vidime, ze jsou inactive<\/p>\r\n<p>get detailed information about a RAID device\u00a0<\/p>\r\n<p>\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mdadm -D \/dev\/mdX<\/code>\u00a0 tvrdi RAID0 (ale je to nena\u010dten\u00e9)<\/p>\r\n<p>more detailed information by using the -E or &#8211;examine options:<\/p>\r\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mdadm\u00a0 -E \/dev\/sda1,2,3<\/code> spr\u00e1vn\u011b tvrd\u00ed <code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">RAID1 1 clean a 1 removed device, clean degraded<\/code><\/p>\r\n<p>\r\n\r\n<\/p>\r\n\r\n\r\n\r\n\r\n\r\n<p>re-start RAID<\/p>\r\n\r\n\r\n\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mdadm -R \/dev\/md127\r\nmdadm -R \/dev\/md126\r\nmdadm -R \/dev\/md125<\/pre>\r\n<p>Run the following commands to change the array and filesystem back to read-write mode:<\/p>\r\n\r\n\r\n\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mdadm -w \/dev\/md127\r\nmdadm -w \/dev\/md126\r\nmdadm -w \/dev\/md125<\/pre>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dmesg\r\n\/dev\/md125 switched to read-write mode\r\n<\/pre>\r\n<p>v menu Ubuntu &#8220;go back&#8221; + znovu &#8220;enter rescue mode&#8221;<\/p>\r\n\r\n\r\n\r\n<p>rescue mode nab\u00edz\u00ed jako root uz i ty mdX<\/p>\r\n\r\n\r\n\r\n<p>v\u00fdb\u011br toho, u ktereho\u00a0 vedle v <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cat \/proc\/mdstat<\/code> vidime, ze obsahuje sda1<\/p>\r\n\r\n\r\n\r\n<p>v menu Ubuntu &#8220;reinstall GRUB boot loader&#8221;<\/p>\r\n\r\n\r\n\r\n<p>zadat device <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/dev\/sda<\/code><\/p>\r\n\r\n\r\n\r\n<p>reboot from hdd (not from the Ubuntu rescue CD)<\/p>\r\n\r\n\r\n\r\n<p>nabootuje Ubuntu 16.04<\/p>\r\n\r\n\r\n\r\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cat \/proc\/mdstat<\/code><\/p>\r\n\r\n\r\n\r\n<p>ted uz jsou \/dev\/md0,1,2\u00a0<\/p>\r\n\r\n\r\n\r\n<p>posledni uklid &#8211; neexistujici \u010dlen v RAID<\/p>\r\n\r\n\r\n\r\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mdadm --grow \/dev\/mdX --raid-devices=1 --force<\/code>\u00a0\u00a0 &#8230; opet postupne<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>ispirace zde: https:\/\/www.youtube.com\/watch?v=wSTk9BLwF5k&amp;ab_channel=LawrenceSystems video z instalace zde: https:\/\/maxbox.cz\/nextcloud\/index.php\/s\/jE2bzDi9TS7kHo5 Na st\u00e1vaj\u00edc\u00edm fyzick\u00e9m serveru maxbox je Ubuntu 16.04.6 LTS (Xenial Xerus) software RAID1 (2 x 2TB SATA HDD WDC WD2004FBYZ) Struktura disk\u016f je n\u00e1sleduj\u00edc\u00ed petr@maxbox:~$ sudo fdisk -l Disk \/dev\/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size<\/p>\n<p class=\"text-right\"><span class=\"screen-reader-text\">Continue Reading&#8230; RAID1 Ubuntu 16.04 P2V (physical to virtual conversion) using clonezilla Ubuntu 16.04<\/span><a class=\"btn btn-secondary continue-reading\" href=\"https:\/\/petr.maxbox.cz\/index.php\/2021\/03\/14\/raid1-ubuntu-16-04-p2v-physical-to-virtual-conversion-using-clonezilla-ubuntu-16-04\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-550","post","type-post","status-publish","format-standard","hentry","category-nezarazene"],"_links":{"self":[{"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":10,"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":558,"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/posts\/550\/revisions\/558"}],"wp:attachment":[{"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/petr.maxbox.cz\/index.php\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}