Disk passthrough in Proxmox

The first step is to identify the disk you want to pass through. For this, there are multiple methods:

fdisk -l
ls -l /dev/disk/by-label
ls -l /dev/disk/by-uuid
ls -l /dev/disk/by-id

Note that using /dev/sdX is not a great option since the letter attribution can change, whereas a disk’s uuid will not.

Then, you’ll want to copy whatever label/uuid/id that is relevant, and to allow disk passthrough (direct access) to the VM there are now two options:

1. Through the Proxmox console

qm set {vmid} -{ide|sata|scsi}# /dev/disk/by-{label|uuid|id}/{reference}

with vmid the ID of your VM, ide or sata the type of disk you want to add.

Note that ide value can be 0-3, sata can be 0-5 and scsi 0-13. Also, ide0 is generally the boot disk and ide2 will be the CD drive; Adjust depending on your configuration.

example:

qm set 101 -sata0 /dev/disk/by-label/data01

This will modify the {vmid}.conf file, which bring us to option 2.

2. By directly modifying the {vmid}. conf file in /etc/pve/qemu-server/

Add a line as follows:

{ide|sata|scsi}#: /dev/disk/by-{label|uuid|id}/{reference}

example:

sata0: /dev/disk/by-label/data01

 

You’ll want to shutdown then boot the VM (not just a regular restart) for the changes to take effect, after which the disk should be accessible in your VM.

This entry was posted in Linux and tagged , , , , , , . Bookmark the permalink.

2 Responses to Disk passthrough in Proxmox

  1. Pingback: VFIO, Because I Got Tired of Rebooting my Server – Potatoblog

  2. Pingback: ProxMox – HDD Passthrough – Bujakiewicz Paweł

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.