LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 07-05-2012, 05:18 PM   #1
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Rep: Reputation: Disabled
How can drive order be forced?


I want to create a VM that is "bound" (for lack of a better word) to a given physical drive. I want to partition the physical drive into three slices, one for the core OS, one for swap, and the rest for data. So for example, I might have something like this:

/dev/sda1 --8GB root partition
/dev/sda2 --10GB swap partition
/dev/sda3 --data partition spanning the rest of the drive space

When I tried this, I used the following virt-install command to define the mapping:

virt-install --disk path=/dev/sda1 --disk path=/dev/sda2 --disk path=/dev/sda3 ...

My intent was to have /dev/sda1 be mapped to /dev/vda on my VM, and /dev/sda2 to be mapped to /dev/vdb, and /dev/sda3 to be mapped to /dev/vdc. However, what I got was the first two mappings reversed--sda1 was mapped to vdb and sda2 was mapped to vda.

So my question is how can I guarantee the drive mapping will be in a specific order? I didn't see anything in the drive options to specify an id or anything like that.
 
Old 07-06-2012, 03:18 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,937

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
This has been here for a few days so leeme ask some questions.

You are trying to boot to some OS and then use that mounted partition to then run a VM? Not sure how you even got it to boot at all. I would have thought the command ought to be -disk path=/dev/hdc \

I think you are trying to use a virtio block device. http://www.linux-kvm.org/page/Boot_f...o_block_device

Just to get post some action really is all I an saying.
 
Old 07-06-2012, 07:40 PM   #3
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
I have in fact used the option "-disk path=/dev/sdX" where sdX is some free drive on my system. That works fine. This gives me a single virtual drive under my VM /named /dev/vda. If I use "-disk path=/dev/sdX1 -disk path=/dev/sdX2 -disk path=/dev/sdX3" where I first partition my drive into specific slices, that also works fine and the VM sees three virtual drives named /dev/vda through /dev/vdc. The problem was that it seemed that the drive order did not map directly to what I gave on the command line. However, I've done some additional tests today and I believe I may have been incorrect about that. In a second test at least the virtual drive order matched. I have to do some more tests to see exactly what's going on.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to config forced device order in ALSA? Q.. Fedora 2 12-19-2011 11:56 AM
mdadm forced resyncing to activate spare drive javaholic Linux - Server 3 12-15-2008 06:24 AM
drive order changing... IcoNyx Linux - Hardware 5 07-24-2007 07:04 AM
Sata Raid 1 and Single Sata drive drive order issue Kvetch Linux - Hardware 5 03-19-2007 06:50 PM
changing drive's order r_x Linux - Hardware 1 07-19-2005 04:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration