From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wangpan" Subject: Re: Re: How to get the real device in guest os after attached a disk? Date: Wed, 18 Jul 2012 12:01:11 +0800 Message-ID: <1951555288.45486.1342584074069.JavaMail.hzwangpan@corp.netease.com> References: <1936723074.42171.1342496460585.JavaMail.hzwangpan@corp.netease.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: "kvm" , "Ryan Harper" , "libvir-list" To: "Stefan Hajnoczi" Return-path: Received: from m31-109.vip.163.com ([220.181.31.109]:44281 "EHLO corp.netease.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750718Ab2GREBm (ORCPT ); Wed, 18 Jul 2012 00:01:42 -0400 In-Reply-To: CAJSP0QVaQZ6JJvC=D35mw4-Hy_qF_T6sYcQgvSYkMm4s+KcFEQ@mail.gmail.com Sender: kvm-owner@vger.kernel.org List-ID: Thanks Stefan, But how can I get the serial info in the guest os? I have tried 'hdparm', 'sdparm', 'lshw', 'smartctl' and failed finally. for example, root@debian:~# hdparm -i /dev/vdc /dev/vdb: HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device HDIO_GET_IDENTITY failed: Inappropriate ioctl for device The XML be attached is: WD-WMAP9A966149
The kernel info: root@debian:~# uname -a Linux debian 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64 GNU/Linux >On Tue, Jul 17, 2012 at 4:40 AM, Wangpan wrote: >> I have a question as the subject above, the reason I want to know this is that, if I attach some disks on the guest, >> for example, I specified /dev/vdc&/dev/vdd(target device) at the cmd line by using 'virsh attach-disk', but they may be /dev/vdb&/dev/vdc in the guest os, >> so if the guest user want to detach the /dev/vdb(guest device), he\she will be confused with the two target devices /dev/vdb&/dev/vdc, >> because he\she doesn't know the corresponding relation of the guest device and target device, >> he\she may detach an error device /dev/vdd(target device) which corresponding to /dev/vdc(guest device). >> >> Could anyone give me some idea? > >You can use the virtio-blk serial or file system/volume labels to >distinguish them. > >For libvirt disk information, see the Domain XML documentation: >http://libvirt.org/formatdomain.html#elementsDisks > >Stefan