qemu: use physical hard disk (host drives) - dangerous?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
qemu: use physical hard disk (host drives) - dangerous?
The qemu documentations tells that it's possible to use a physical hard disk (host drives) directly, but that it's only save if used READ-ONLY:
Quote:
Hard disks can be used. Normally you must specify the whole disk (`/dev/hdb' instead of `/dev/hdb1') so that the guest OS can see it as a partitioned disk. WARNING: unless you know what you do, it is better to only make READ-ONLY accesses to the hard disk otherwise you may corrupt your host data (use the `-snapshot' command line option or modify the device permissions accordingly).
Why is it dangerous to use a host drive not read-only? Is the problem the simultanous write access from host and guest to the same filesystem?
Can i use a host drive safely in read/write mode if this drive is not mounted at the host and used by the guest exclusively?
I'm curious as to how you'd do this. The documentation isn't particularly clear in this area, and I don't want to mess up my data! I'm using ProxMox for virtualization on a server, and I have a physical hardware RAID volume (with partitions already created and data on them) that I'd like one of my guests (and only the one guest, not the host nor the other guests) to have access to. It's /dev/sda (the partition sda1) on my host system. How would I go about adding this to the virtual machine?
i think it's only possible to add the whole disk to the guest - see section "Using Host Drives" of the qemu documentation: http://qemu-forum.ipi.fi/viewtopic.php?f=3&t=4599
So you can add hda and not hdaX
But what should work:
- If you are using LVM you can add a logical volume
- If you are using Raid you should be able to add a logical raid device
i think it's only possible to add the whole disk to the guest - see section "Using Host Drives" of the qemu documentation: http://qemu-forum.ipi.fi/viewtopic.php?f=3&t=4599
So you can add hda and not hdaX
But what should work:
- If you are using LVM you can add a logical volume
- If you are using Raid you should be able to add a logical raid device
I understand... but I don't know how to add a device. What commands would I use at the Qemu monitor to add the device /dev/sda on the host, without damaging it, and then how would I add it to a VM (either at the monitor or using ProxMox)?
well I was starting quemu from the command line in a terminal. I don't have it setup in front of me right now. How do you start quemu?
The "Qemu Monitor" is embedded in my ProxMox Virtual Environment webpage. I'm not even 100% sure they're compatible, but it's worth a try. Here's a screenshot so I can know if we're talking about the right thing:
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,151
Rep:
Hmm, I've never seen that before. Is there a way to change the command line options that quemu is launched with? do you know what image file quemu is looking for?
I am assuming: (please correct me.)
1) This is all running on a linux box you have physical access to.
2) Proxmox is some kind of web application allowing you to work through your browser.
3) You are trying to run linux inside quemu with some kind of dedicated server set up on the VM
Hmm, I've never seen that before. Is there a way to change the command line options that quemu is launched with? do you know what image file quemu is looking for?
I am assuming: (please correct me.)
1) This is all running on a linux box you have physical access to.
2) Proxmox is some kind of web application allowing you to work through your browser.
3) You are trying to run linux inside quemu with some kind of dedicated server set up on the VM
Yes but it's much more complex than that... if that screen isn't the usual Qemu screen I'm not going to mess around with it. Oh well, thanks!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.