{"id":359,"date":"2017-12-28T12:36:19","date_gmt":"2017-12-28T12:36:19","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=359"},"modified":"2017-12-28T12:36:19","modified_gmt":"2017-12-28T12:36:19","slug":"can-you-run-fsck-on-a-disk-image-or-raw-file","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/can-you-run-fsck-on-a-disk-image-or-raw-file.html","title":{"rendered":"Can you run fsck on a disk image or raw file?"},"content":{"rendered":"<p><strong>Question:\u00a0Can you run fsck on a disk image or raw file?<\/strong><\/p>\n<p>Answer: I believe you are referring to KVM disk image\/raw files. It could be the disk image created from a dd clone. The answer yes, you can run fsck on a disk image. You can also use other fsck attribute as required as following:<\/p>\n<blockquote><p>fsck.ext4 -fyC \/somefile.raw<\/p><\/blockquote>\n<p>Remember to use specific partition fsck binary, here, we have used ext4 binary for a ext4 file system loaded on the image file. Running badblock program on an image file can be bad. You may use -c (small c) to run badblock check with the fsck:<\/p>\n<blockquote><p>fsck.ext4 -C -fyc \/somefile.raw<\/p><\/blockquote>\n<p>This sometimes create undesired results and not advisable.<\/p>\n<p><strong>Question: What other option do I have?<\/strong><\/p>\n<p>Answer: You can mount the image using loop back device and then run the file system check. This can be done using kpartx as described in this post:\u00a0<a href=\"https:\/\/mellowhost.com\/billing\/index.php?rp=\/knowledgebase\/82\/How-to-Mount-raw-VM-disk-images-KVMorXenorVMW.html\" target=\"_blank\" rel=\"noopener\">How to: Mount raw VM disk images (KVM\/Xen\/VMW)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question:\u00a0Can you run fsck on a disk image or raw file? Answer: I believe you are referring to KVM disk image\/raw files. It could be the disk image created from a dd clone. The answer yes, you can run fsck on a disk image. You can also use other fsck attribute as required as following: &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/can-you-run-fsck-on-a-disk-image-or-raw-file.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Can you run fsck on a disk image or raw file?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[169,12,150,25],"tags":[174,173,145,175],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/359"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=359"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/359\/revisions"}],"predecessor-version":[{"id":360,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/359\/revisions\/360"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}