<br><br><div class="gmail_quote">On 19 October 2012 07:32, neo3 matrix <span dir="ltr"><<a href="mailto:neo3matrix@gmail.com" target="_blank">neo3matrix@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hi all,</div><div><br></div><div>I have installed RHEL6 as guest OS on Citrix Xen Server. After installation of OS, I can see disk names as /dev/xvda, /dev/xvdb instead of traditional convention like /dev/sda, /dev/sdb on guest OS.</div>

<div><br></div><div>Generally, on physical machines, in /proc/scsi/scsi file, we get a unique entry for every disk connected to the system. For e.g. string "scsi02:00:00:01" indicates that this disk is connected to the machine via Host=2, Channel=00, Id=00 Lun=01. This helps me in my project to uniquely identify each and every disk in scenarios where many times after reboot OR in SAN boot cases OR in some Disaster Recovery procedures, disk names might change from say /dev/sda to /dev/sdb after reboot. But, this Host:Channel:ID:Lun combination remains same for every disk and I can uniquely identify the disks though their /dev/sd* names have changed.</div>

<div><br></div><div>For my project, on Citrix Xenserver, I need to know the unique disk location for such Xen guest OS devices by which I can easily identify disks across the reboots for the above mentioned cases. </div>
<br></blockquote><div><br><br>Oooh.   Complicated question.<br><br>To start with, those SCSI-type disk identifiers are not as deterministic as you might hope.  "Host=2" merely refers to the SCSI controller that was discovered at position number 2.   These days, discovery order counts for nothing: devices are discovered and initialised concurrently, more or less, so while you might get devices discovered in the "right" order almost all the time, you might find that powering on a machine on a particularly cold morning changes the order in which things are discovered.   Even worse, if what used to be /dev/sdb goes AWOL then you're not left with a hole in the sequence, everything from what used to be /dev/sdc onwards gets renamed.<br>
<br>The good news with Xen disks is that they really do have deterministic slots.   The virtual disk in slot xvdb will always be xvdb (the "vbd-NNN" numbers simply refer to event channels, they aren't random but they might as well be).  You would need to edit the VM definition in the host to change the virtual disks.<br>
<br>Even more good news: you don't need to use the /dev/sdX, /dev/xvdX, etc names at all.<br><br>If you look in /dev/disk you'll find several directories.  The one you're probably most interested in is /dev/disk/by-uuid: entries in /etc/fstab should be using the UUID= format to identify things that aren't logical volumes (logical volumes are named within their volume group and the physical volumes that make up a volume group aren't tied to specific devices although they do have specific UUIDs).<br>
<br>Running "blkid" (as root) is quite useful as well.<br><br>jch<br></div></div>