How to mount qcow2 image
I've read that with qemu-nbd and the network block device kernel module, I can mount a qcow2 image. I haven't seen any tutorials on mounting a qcow2 via a loop device. Is it possible? If not, why?
I don't really understand the difference between a qcow2 and an iso.
qemu loop-device nbd
add a comment |
I've read that with qemu-nbd and the network block device kernel module, I can mount a qcow2 image. I haven't seen any tutorials on mounting a qcow2 via a loop device. Is it possible? If not, why?
I don't really understand the difference between a qcow2 and an iso.
qemu loop-device nbd
2
You don't mount a qcow2 image via a loop device; you mount it via the network block device (nbd). Not intuitive, but easy enough to find via your favourite search engine.
– roaima
Mar 8 '16 at 21:35
related: serverfault.com/questions/213232/mount-qcow2-snapshots
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Jan 15 at 23:50
add a comment |
I've read that with qemu-nbd and the network block device kernel module, I can mount a qcow2 image. I haven't seen any tutorials on mounting a qcow2 via a loop device. Is it possible? If not, why?
I don't really understand the difference between a qcow2 and an iso.
qemu loop-device nbd
I've read that with qemu-nbd and the network block device kernel module, I can mount a qcow2 image. I haven't seen any tutorials on mounting a qcow2 via a loop device. Is it possible? If not, why?
I don't really understand the difference between a qcow2 and an iso.
qemu loop-device nbd
qemu loop-device nbd
asked Mar 8 '16 at 17:50
onlyaneggonlyanegg
31538
31538
2
You don't mount a qcow2 image via a loop device; you mount it via the network block device (nbd). Not intuitive, but easy enough to find via your favourite search engine.
– roaima
Mar 8 '16 at 21:35
related: serverfault.com/questions/213232/mount-qcow2-snapshots
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Jan 15 at 23:50
add a comment |
2
You don't mount a qcow2 image via a loop device; you mount it via the network block device (nbd). Not intuitive, but easy enough to find via your favourite search engine.
– roaima
Mar 8 '16 at 21:35
related: serverfault.com/questions/213232/mount-qcow2-snapshots
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Jan 15 at 23:50
2
2
You don't mount a qcow2 image via a loop device; you mount it via the network block device (nbd). Not intuitive, but easy enough to find via your favourite search engine.
– roaima
Mar 8 '16 at 21:35
You don't mount a qcow2 image via a loop device; you mount it via the network block device (nbd). Not intuitive, but easy enough to find via your favourite search engine.
– roaima
Mar 8 '16 at 21:35
related: serverfault.com/questions/213232/mount-qcow2-snapshots
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Jan 15 at 23:50
related: serverfault.com/questions/213232/mount-qcow2-snapshots
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Jan 15 at 23:50
add a comment |
2 Answers
2
active
oldest
votes
A loop device just turns a file into a block device. If the file has some special internal mapping of its blocks, the loop device won't translate any of it. qcow2 is special... it has special mapping inside that handles different snapshots of the same blocks stored in different places. If you mount that as a loop device, you'll just get one big block device that doesn't represent the actual data in the image.
Another option is to convert to raw and mount as a loop device:
qemu-img convert -p -O raw oldfile.qcow2 newfile.raw
But then you have to convert it back to qcow2 to use it again as before.
I think using qemu-nbd is not the most efficient IO, but is easy. Mounting it in a VM, like one booted with a live usb, is easy too. Converting doesn't make much sense... it was just an example of how they're different.
2
guestmount is the easy way! It does the mounting-in-a-vm under the hood, but it's all wrapped up neatly.
– Gilles
Mar 8 '16 at 23:08
nice! I hadn't heard of that.
– onlyanegg
Mar 10 '16 at 4:18
add a comment |
Thanks to Gilles for pointing out guestmount. Mounting a qcow2 image is very simple on RHEL/Centos/Fedora:
First install guestmount (comes as part of libguestfs-tools in Centos6)
yum install libguestfs-tools libguestfs
Then you should be able to auto-magically mount your qcow2 image using the -i option
guestmount -a path_to_image.qcow2 -i --ro /mount_point
You can manually specify mount points (within the image) using the -m option.
As always read the man page on guestmount for more details...
Note: This only addresses the question title. Please see Peter's answer for the differences between qcow2 and ISOs...
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268460%2fhow-to-mount-qcow2-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
A loop device just turns a file into a block device. If the file has some special internal mapping of its blocks, the loop device won't translate any of it. qcow2 is special... it has special mapping inside that handles different snapshots of the same blocks stored in different places. If you mount that as a loop device, you'll just get one big block device that doesn't represent the actual data in the image.
Another option is to convert to raw and mount as a loop device:
qemu-img convert -p -O raw oldfile.qcow2 newfile.raw
But then you have to convert it back to qcow2 to use it again as before.
I think using qemu-nbd is not the most efficient IO, but is easy. Mounting it in a VM, like one booted with a live usb, is easy too. Converting doesn't make much sense... it was just an example of how they're different.
2
guestmount is the easy way! It does the mounting-in-a-vm under the hood, but it's all wrapped up neatly.
– Gilles
Mar 8 '16 at 23:08
nice! I hadn't heard of that.
– onlyanegg
Mar 10 '16 at 4:18
add a comment |
A loop device just turns a file into a block device. If the file has some special internal mapping of its blocks, the loop device won't translate any of it. qcow2 is special... it has special mapping inside that handles different snapshots of the same blocks stored in different places. If you mount that as a loop device, you'll just get one big block device that doesn't represent the actual data in the image.
Another option is to convert to raw and mount as a loop device:
qemu-img convert -p -O raw oldfile.qcow2 newfile.raw
But then you have to convert it back to qcow2 to use it again as before.
I think using qemu-nbd is not the most efficient IO, but is easy. Mounting it in a VM, like one booted with a live usb, is easy too. Converting doesn't make much sense... it was just an example of how they're different.
2
guestmount is the easy way! It does the mounting-in-a-vm under the hood, but it's all wrapped up neatly.
– Gilles
Mar 8 '16 at 23:08
nice! I hadn't heard of that.
– onlyanegg
Mar 10 '16 at 4:18
add a comment |
A loop device just turns a file into a block device. If the file has some special internal mapping of its blocks, the loop device won't translate any of it. qcow2 is special... it has special mapping inside that handles different snapshots of the same blocks stored in different places. If you mount that as a loop device, you'll just get one big block device that doesn't represent the actual data in the image.
Another option is to convert to raw and mount as a loop device:
qemu-img convert -p -O raw oldfile.qcow2 newfile.raw
But then you have to convert it back to qcow2 to use it again as before.
I think using qemu-nbd is not the most efficient IO, but is easy. Mounting it in a VM, like one booted with a live usb, is easy too. Converting doesn't make much sense... it was just an example of how they're different.
A loop device just turns a file into a block device. If the file has some special internal mapping of its blocks, the loop device won't translate any of it. qcow2 is special... it has special mapping inside that handles different snapshots of the same blocks stored in different places. If you mount that as a loop device, you'll just get one big block device that doesn't represent the actual data in the image.
Another option is to convert to raw and mount as a loop device:
qemu-img convert -p -O raw oldfile.qcow2 newfile.raw
But then you have to convert it back to qcow2 to use it again as before.
I think using qemu-nbd is not the most efficient IO, but is easy. Mounting it in a VM, like one booted with a live usb, is easy too. Converting doesn't make much sense... it was just an example of how they're different.
answered Mar 8 '16 at 21:53
PeterPeter
88468
88468
2
guestmount is the easy way! It does the mounting-in-a-vm under the hood, but it's all wrapped up neatly.
– Gilles
Mar 8 '16 at 23:08
nice! I hadn't heard of that.
– onlyanegg
Mar 10 '16 at 4:18
add a comment |
2
guestmount is the easy way! It does the mounting-in-a-vm under the hood, but it's all wrapped up neatly.
– Gilles
Mar 8 '16 at 23:08
nice! I hadn't heard of that.
– onlyanegg
Mar 10 '16 at 4:18
2
2
guestmount is the easy way! It does the mounting-in-a-vm under the hood, but it's all wrapped up neatly.
– Gilles
Mar 8 '16 at 23:08
guestmount is the easy way! It does the mounting-in-a-vm under the hood, but it's all wrapped up neatly.
– Gilles
Mar 8 '16 at 23:08
nice! I hadn't heard of that.
– onlyanegg
Mar 10 '16 at 4:18
nice! I hadn't heard of that.
– onlyanegg
Mar 10 '16 at 4:18
add a comment |
Thanks to Gilles for pointing out guestmount. Mounting a qcow2 image is very simple on RHEL/Centos/Fedora:
First install guestmount (comes as part of libguestfs-tools in Centos6)
yum install libguestfs-tools libguestfs
Then you should be able to auto-magically mount your qcow2 image using the -i option
guestmount -a path_to_image.qcow2 -i --ro /mount_point
You can manually specify mount points (within the image) using the -m option.
As always read the man page on guestmount for more details...
Note: This only addresses the question title. Please see Peter's answer for the differences between qcow2 and ISOs...
add a comment |
Thanks to Gilles for pointing out guestmount. Mounting a qcow2 image is very simple on RHEL/Centos/Fedora:
First install guestmount (comes as part of libguestfs-tools in Centos6)
yum install libguestfs-tools libguestfs
Then you should be able to auto-magically mount your qcow2 image using the -i option
guestmount -a path_to_image.qcow2 -i --ro /mount_point
You can manually specify mount points (within the image) using the -m option.
As always read the man page on guestmount for more details...
Note: This only addresses the question title. Please see Peter's answer for the differences between qcow2 and ISOs...
add a comment |
Thanks to Gilles for pointing out guestmount. Mounting a qcow2 image is very simple on RHEL/Centos/Fedora:
First install guestmount (comes as part of libguestfs-tools in Centos6)
yum install libguestfs-tools libguestfs
Then you should be able to auto-magically mount your qcow2 image using the -i option
guestmount -a path_to_image.qcow2 -i --ro /mount_point
You can manually specify mount points (within the image) using the -m option.
As always read the man page on guestmount for more details...
Note: This only addresses the question title. Please see Peter's answer for the differences between qcow2 and ISOs...
Thanks to Gilles for pointing out guestmount. Mounting a qcow2 image is very simple on RHEL/Centos/Fedora:
First install guestmount (comes as part of libguestfs-tools in Centos6)
yum install libguestfs-tools libguestfs
Then you should be able to auto-magically mount your qcow2 image using the -i option
guestmount -a path_to_image.qcow2 -i --ro /mount_point
You can manually specify mount points (within the image) using the -m option.
As always read the man page on guestmount for more details...
Note: This only addresses the question title. Please see Peter's answer for the differences between qcow2 and ISOs...
edited 3 mins ago
answered 9 mins ago
maloomaloo
234
234
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268460%2fhow-to-mount-qcow2-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
You don't mount a qcow2 image via a loop device; you mount it via the network block device (nbd). Not intuitive, but easy enough to find via your favourite search engine.
– roaima
Mar 8 '16 at 21:35
related: serverfault.com/questions/213232/mount-qcow2-snapshots
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Jan 15 at 23:50