Create a Proxmox VM for the drives to be mounted to and take note of its ID.
Use fdisk -l
to list all connected drives:
You'll see something like this:
Disk /dev/sda: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: <COPY_THIS>
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: ...
Copy disk model and use it in the following command:
ls -l /dev/disk/by-id/ | grep <PASTE_HERE>
You'll see output like so:
lrwxrwxrwx 1 root root 9 Dec 7 21:59 ata-<MODEL>_<SERIAL> -> ../../sda
lrwxrwxrwx 1 root root 9 Dec 7 21:59 ata-<MODEL>_<SERIAL> -> ../../sdb
Take note of/copy the filename(s), for example ata-ABCD_1234
.
To actually pass the desired drives into the underlying QEMU VM, run the below command, incrementing the number in scsi1
for every additional drive. Ensure you update the device path to match the filename from above (both model and S/N), and update the serial=
part with just the S/N (everything after _
).
qm set 100 -scsi1 /dev/disk/by-id/ata-ABCD_1234,serial=1234
If it works as expected you should see output like this:
update VM 100: -scsi1 /dev/disk/by-id/ata-ABCD_1234
Back in the Proxmox UI, the VM's hardware tab should reflect the newly passed through drives:
You should now be able to see and use these drives inside your VM. Удачи вам!
I would like to thank Robert Mizen for creating this great video on the process which I used to make this gist.
Check it out here: https://youtu.be/2mvCaqra6qY