{"id":9998,"date":"2023-04-19T22:00:15","date_gmt":"2023-04-20T03:00:15","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=9998"},"modified":"2023-04-28T22:32:31","modified_gmt":"2023-04-29T03:32:31","slug":"mounting-a-qcow-file","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=9998","title":{"rendered":"Mounting a QCOW File"},"content":{"rendered":"\n<p>We had a power outage on Monday that took out the drive that holds our VMs. There are backups, <em>but<\/em> the backup drive copies had superblock errors and all sorts of issues. To recover our data, I learned all sorts of new things &#8212; firstly that you <em>can<\/em> mount a QCOW file and copy data out. First, you have to connect a network block device to the file. Once it is connected, you can use fdisk to list the partitions on the drive and mount those partitions. In this example, I had a partition called nbd0p1 that I mounted to \/mnt\/data_recovery<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nmodprobe nbd max_part=2\nqemu-nbd --connect=\/dev\/nbd0 \/path\/to\/server_file.qcow2\nfdisk \/dev\/nbd0 -l\nmount \/dev\/nbd0p1 \/mnt\/data_recovery\n<\/pre><\/div>\n\n\n<p>Once you are done, unmount it and disconnect from the network block device. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\numount \/mnt\/data_recovery\nqemu-nbd --disconnect \/dev\/nbd0\nrmmod nbd\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>We had a power outage on Monday that took out the drive that holds our VMs. There are backups, but the backup drive copies had superblock errors and all sorts of issues. To recover our data, I learned all sorts of new things &#8212; firstly that you can mount a QCOW file and copy data &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[1844,47,294,1195],"class_list":["post-9998","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-disaster-recovery","tag-fedora","tag-linux","tag-redhat"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9998"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9998\/revisions"}],"predecessor-version":[{"id":9999,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9998\/revisions\/9999"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}