Normally, when I passthrough a disk to a VM I use the entire disk. I am looking at attempting to passthrough a partition in KVM. First question is that possible/ok? Looking at this doc it seems to be the way to go which supprised me.



Guest virtual machines should not be given write access to whole disks or block devices (for example, /dev/sdb). Guest virtual machines with access to whole block devices may be able to modify volume labels, which can be used to compromise the host physical machine system. Use partitions (for example, /dev/sdb1) or LVM volumes to prevent this issue.

My next question is I have read about how to do this via /dev/sdX and by diskID, but DiskID seems to be the entire disk, IE:


<disk type='block' device='disk'>
        <source dev='/dev/disk/by-id/ata-Corsair_CSSD-F120GB2_1109650632000461003B' />
        <target dev='hdc' bus='virtio' />

And the whole point of using the by-id is because /sdX can change. I was wondering if I can use LABEL or UUID? Anybody with experience, I'd like some input.

Thank you


If you look carefully at the disk symlinks in /dev/disk/by-id you will see that there are also links for each partition on the block devices. For instance:


Use the one corresponding to your desired partition.

  • I did look into that, but if I change the partition, isn't the "part-#" going to change, at that point I could just use /dev/sd* almost. I know that this system won't change often, so I could just partition it and use one of those two methods, but I'd like to learn how to do it "portable" style for future. – FreeSoftwareServers Feb 7 '18 at 6:49
  • I'm literally about to do some partitioning, so I can't set this up until after I do that, but if I could do it by LABEL or UUID, I could just set it up now and change the other partitions later – FreeSoftwareServers Feb 7 '18 at 6:49
  • The partition number will always be the same unless you repartition the block device. – Michael Hampton Feb 7 '18 at 6:50
  • Thats the plan, I'm about to delete part-3 and grow part-2, but I want to passthrough lets say "part-5", im worried if I do any changes in the future,"part-5" could become "part-4", but its UUID wouldn't change. – FreeSoftwareServers Feb 7 '18 at 6:51
  • 1
    turns out you can do by-uuid or by-label! @Michael Hampton, I was tab completing when I figured it out. – FreeSoftwareServers Feb 25 '18 at 2:05

Passing through disks doesn't support the LABEL/UUID format of FSTAB, but is possible. You can passthrough a disk via any of the following symlinks in /dev/disk/by-* eg:

cd /dev/disk/by-
by-id/        by-label/     by-partlabel/ by-partuuid/  by-path/      by-uuid/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.