On Fri, Oct 13, 2017 at 04:14:09PM -0500, Andrew Daugherity wrote:
> On Thu, Oct 12, 2017 at 6:42 PM, Mike Larkin <mlar...@azathoth.net> wrote:
> >> oh. I didn't know that is how it was finding things.
> >>
> >
> > When booting it this way in qemu, qemu just reports the ID as "".
> >
> > So are you sure this is the way it is supposed to work?
> 
> Yes... with some caveats.
> 
> The Linux device manager (udev, I think?  They've gone through
> several.) creates symlinks under /dev/disk/by-{id,label,path,uuid}/,
> so that you can use more permanent names in case the disk order (sda,
> sdb, etc.) changes; there are also library calls to open a
> device/partition by ID, UUID, etc., (via libblkid I believe, which
> lets you use things like LABEL=foo or UUID=abcd... as the block device
> passed to mount(8) or listed in fstab).  The SUSE installer is
> "helpfully" attempting to use these IDs; e.g. with a SATA disk under
> VirtualBox, it uses a repo URL of
> 'hd:///?device=/dev/disk/by-id/ata-VBOX_HARDDISK_VB40007e3d-cdaea0a1-part2'.
> 
> However, you are correct that qemu virtio disks do not report IDs (or
> report blank ones) -- at least by default (apparently with recent
> qemu, there is an option to set a drive's serial number, but it
> doesn't seem to be commonly used).  I did a test installation of
> openSUSE under Proxmox VE (qemu/KVM) using virtio disks, and the only
> thing under /dev/disk/by-id is the emaulated IDE CD-ROM. -- nothing
> for /dev/vda or vdb.  Notably, the installer configured its repo as
> 'hd:///?device=/dev/vda2' without me having to tell it that, as I had
> to under vmm.
> 
> By comparison, the opensuse VM I installed under OpenBSD vmm *does*
> show some 'by-id' devices:
> /dev/disk/by-id:
> total 0
> lrwxrwxrwx 1 root root  9 Oct 13 13:21 virtio-______L____I_U_ -> ../../vdb
> lrwxrwxrwx 1 root root 10 Oct 13 13:21 virtio-______L____I_U_-part1 ->
> ../../vdb1
> lrwxrwxrwx 1 root root 10 Oct 13 13:21 virtio-______L____I_U_-part2 ->
> ../../vdb2
> (Currently /dev/vda is the VM's hard disk and vdb is the ISO...
> strange that there are only links for vdb, but not vda.  Of course
> accessing via these symlinks works, since they point at the real
> device, but doing whatever library call to open
> 'virtio-______L____I_U_-part2' would most likely fail, and obviously
> the correct symlinks did not exist during installation.)
> 
> My best guess is that when udev gets a blank ID, it skips the by-id
> stuff, and thus the installer uses the real disk device, but since vmm
> doesn't implement that call, instead of marking the disk as not having
> an ID, invalid disk IDs somehow get used.
> 
> 
> -Andrew

Just cleaning out old email threads. This should be in better shape now
that ccardenas@ has implemented proper CD-ROM device support.

-ml

Reply via email to