{"id":447,"date":"2009-08-11T22:29:43","date_gmt":"2009-08-11T20:29:43","guid":{"rendered":"http:\/\/raftaman.net\/?p=447"},"modified":"2021-05-15T11:46:41","modified_gmt":"2021-05-15T09:46:41","slug":"mounting-xen-images","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=447","title":{"rendered":"Mounting xen images"},"content":{"rendered":"<p>Mounting images that contain only one partition is rather easy. But how to mount image with multiple partitions? <code>kpartx<\/code> is the solution!<\/p>\n<p>You can list all partitions within the image with<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\n# fdisk -l \/vm\/dhcpd.img \r\nDisk \/vm\/dhcpd.img: 0 MB, 0 bytes\r\n255 heads, 63 sectors\/track, 0 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\n\r\n        Device Boot      Start         End      Blocks   Id  System\r\n\/vm\/dhcpd.img1   *           1         127     1020096   83  Linux\r\n<\/pre>\n<p><code>kpartx<\/code> can be used to create maps from the block devices<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nkpartx -a \/path\/to\/xen\/image.img\r\n<\/pre>\n<p>And those maps can be mounted as usual<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nmount -o rw \/dev\/mapper\/loop0p1 \/mnt\/\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mounting images that contain only one partition is rather easy. But how to mount image with multiple partitions? kpartx is the solution! You can list all partitions within the image with # fdisk -l \/vm\/dhcpd.img Disk \/vm\/dhcpd.img: 0 MB, 0 bytes 255 heads, 63 sectors\/track, 0 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=447\">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,7,16],"class_list":["post-447","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-centos","tag-fedora","tag-xen"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/447","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=447"}],"version-history":[{"count":3,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/447\/revisions"}],"predecessor-version":[{"id":980,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/447\/revisions\/980"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}