title: Proxmox VE: How to create a raw disk and pass it through to a VM
body: <p>I am searching for an answer on how to create and pass through a raw device to a VM using proxmox. Through that I am hoping to have full control of the disk including S.M.A.R.T. stats and disk spindown.
  Currently I am using passthrough using the SATA passthrough offered by proxmox. 
  Unfortunately I have no clue how to create a raw disk file from my (empty) disk). Furthermore I am not entirely certain on how to bind it to the VM.</p>
  
  <p>I hope someone knows the relevant steps.</p>
  
  <hr>
  
  <p><strong>Side notes:</strong>
  This question is just a measure I want to try out to achieve a certain goal. For the sake of simplicity I posed my question confined to the part above. However, if you have a better idea, feel free to give me a hint. So far I have tried a lot of things to achieve my ultimate goal. </p>
  
  <p><strong>Goal that I want to achieve:</strong>
  I am using Proxmox VE 5.3-8 on a HP Proliant Gen 8 server. It hosts several VMs among which OMV should serve as a NAS. Since the files will not be accessed too often, I opt for a spindown of the drives. 
  My goal is reduction of noise and power savings.</p>
  
  <p><strong>Current status:</strong>
  I passed through two disks by adding them to 
  /etc/pve/nodes/pve/qemu-server/vmid.conf
  <code>sata1: /dev/disk/by-id/{disk-id}</code></p>
  
  <p>Through that I do see SMART stats and everything except disk spindown works fine. Using virtio instead of SATA does not give me SMART values.
  using hdparm -y to put a drive to sleep does not work inside the VM. Doing the same on the proxmox console result in a sleep, but it wakes up a few seconds later.</p>
  
  <p>Passing through the entire HBA is currently not an option.</p>
  
  <p>I read in a forum that first installing Debian and then manually installing the proxmox packages resulted in a success. However that was still for Debian jessie and three years ago. 
  <a href="https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Stretch" rel="nofollow noreferrer">Install Proxmox VE on Debian Stretch</a>
  Before I try this as a last resort, I want to make sure if passing the disk through as a raw file will lead to the result.</p>
  
  <p>Maybe someone has an idea on how to achieve my ultimate goal.</p>