Skip to content
Menu
Marius Serbanica – Tech Blog
  • My Tech Blog
  • About me
  • Contact Me
  • Curriculum Vitae
  • Projects
  • Current Projects List
  • Certifications
  • Home Lab
  • Self-Hosted
  • Linux Cheat Sheet
  • Linux Commands
  • Privacy Policy
  • Site Map
Marius Serbanica – Tech Blog
December 1, 2023December 7, 2023

Passthrough for HDD/SSD/Physical disks to VM on Proxmox VE(PVE)

1 Install lshw on PVE

1.1 Bring up the terminal from PVE directly or via SSH or by using “Shell” from PVE web GUI

1.2 Enter the following command to install lshw

apt install lshw

2 Check & note down details about physical disks we want to passthrough

2.1 Using the following command

lshw -class disk -class storage

...
*-disk
description: ATA Disk
product: SHdi1uhJ-128s
vendor: Wester Digital
physical id: 0.0.0
bus info: scsi@2:0.0.0
logical name: /dev/sdb
version: DC09
serial: SJFhf7219
size: 15000GiB (15TB)
configuration: ansiversion=5 sectorsize=512
...

We should use disk by their ID rather than name (/dev/sda) which can change and will cause trouble

2.2 Use the following command to list all physical disk IDs

ls -l /dev/disk/by-id/

2.3 Now we need to find the one that matches the “product” or “serial”

as shown below –

..... /dev/disk/by-id/ata-xxxxxxxxx-xxxxx_xxx ......

Or you could try

ls -al /dev/disk/by-id | grep SHdi1uhJ
or
ls -al /dev/disk/by-id | grep SJFhf7219

3 Add the disk to VM

3.1 Bring up the terminal or shell for the PVE host again

3.2 Execute the following command

qm set 100 -scsi1 /dev/disk/by-id/ata-xxxxxxxxx-xxxxx_xxx

The output should look like this:

update VM 100: -scsi1 /dev/disk/by-id/ata-xxxxxxxxx-xxxxx_xxx

100: The VM id which can be found from PVE web GUI (besides the VM’s name)

scsi1: The virtual port number that the disk will be used to attach to the VM

For example, in the following configuration, the disk is attached by using -scsi0, if we want to attach another disk, we can use -scsi1 or -scsi2 or -scsi3 etc…..

4 Check if the disk attached successfully

grep SHdi1uhJ /etc/pve/qemu-server/100.conf

References

“Physical disk to kvm – Proxmox VE”, Pve.proxmox.com, 2020. [Online]. Available: https://pve.proxmox.com/wiki/Physical_disk_to_kvm

Share on Social Media
x facebook linkedin

Leave a Reply Cancel reply

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

Join my LinkedIn Network.

Recent Posts

  • Kubernetes cluster. Why and how
  • Installing GNU-World on ircu2
  • Replacing Cloudflare Tunnel with Tailscale on a VPS
  • KASM – My main workspace RBI
  • Transforming a Mini PC into a Powerful Home Network Hub / Router/ Firewall with OPNsense

Archives

  • February 2025
  • January 2025
  • October 2024
  • May 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023

Categories

  • How-To
  • Tech Industry
  • Tech, but personal
  • Tutorials

Recent Comments

  1. IRC Lamer on Installing GNU-World on ircu2
  2. severus2231 on Transforming a Mini PC into a Powerful Home Network Hub / Router/ Firewall with OPNsense
  3. admin on Mounting a NAS (Network Attached Storage) device on Linux
  4. abL on Mounting a NAS (Network Attached Storage) device on Linux
  5. Alin R on Cleaning up your Linux OS.
Social Media
Find me on social media
Facebook Twitter Instagram LinkedIn

©2025 Marius Serbanica – Tech Blog