{"id":959,"date":"2010-08-18T19:33:03","date_gmt":"2010-08-18T17:33:03","guid":{"rendered":"http:\/\/raftaman.net\/?p=959"},"modified":"2021-05-15T11:46:40","modified_gmt":"2021-05-15T09:46:40","slug":"adding-a-new-disk-to-a-xen-vm","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=959","title":{"rendered":"Adding a new disk to a Xen VM"},"content":{"rendered":"<p>Create a new image file (10GiB):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndd if=\/dev\/zero of=mailstore.img bs=1M count=10k\r\n<\/pre>\n<p>(Note: You can also create a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Sparse_file\">sparse file<\/a> with dd&#8217;s seek option. Have a look at the <a href=\"http:\/\/linux.die.net\/man\/1\/dd\">dd manpage<\/a> or the examples on <a href=\"http:\/\/en.wikipedia.org\/wiki\/Dd_%28Unix%29\">http:\/\/en.wikipedia.org\/wiki\/Dd_(Unix)<\/a>)<\/p>\n<p>Create the new filesystem:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmkfs.ext3 mailstore.img\r\n<\/pre>\n<p>Label the filesystem:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ne2label mailstore.img &lt;new-label&gt;\r\n<\/pre>\n<p>Edit the DomU&#8217;s config file, <code>\/etc\/xen\/&lt;hostname&gt;.cfg<\/code> and add the new disk:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ndisk = &#x5B; &quot;tap:aio:\/vm\/disk.img,xvda,w&quot;, \\\r\n         &quot;tap:aio:\/vm\/mailstore.img,xvdb,w&quot; ]\r\n<\/pre>\n<p>Start the VM:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nxm create &lt;hostname&gt;.cfg\r\n<\/pre>\n<p>Edit DomU&#8217;s <code>\/etc\/fstab<\/code> &#038; mount the disk:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;...]\r\nLABEL=\/&lt;new-label&gt;   \/&lt;mount-point&gt;   ext3   defaults   0 1\r\n&#x5B;...]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Create a new image file (10GiB): dd if=\/dev\/zero of=mailstore.img bs=1M count=10k (Note: You can also create a sparse file with dd&#8217;s seek option. Have a look at the dd manpage or the examples on http:\/\/en.wikipedia.org\/wiki\/Dd_(Unix)) Create the new filesystem: mkfs.ext3 mailstore.img Label the filesystem: e2label mailstore.img &lt;new-label&gt; Edit the DomU&#8217;s config file, \/etc\/xen\/&lt;hostname&gt;.cfg and add the new disk: disk =&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=959\">Read more &raquo;<\/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":[13,16],"class_list":["post-959","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-centos","tag-xen"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=959"}],"version-history":[{"count":18,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/959\/revisions"}],"predecessor-version":[{"id":979,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/959\/revisions\/979"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}