Passthrough Physical Disk to Virtual Machine (VM) - Proxmox VE (https://pve.proxmox.com/mediawiki/opensearch_desc.php) (Proxmox VE (en)) (https://pve.proxmox.com/mediawiki/api.php?action=rsd) (Proxmox VE Atom feed) (https://pve.proxmox.com/mediawiki/index.php?title=Special:RecentChanges&feed=atom) (https://pve.proxmox.com/wiki/Passthrough_Physical_Disk_to_Virtual_Machine_(VM)#Identify_Disk) Passthrough Physical Disk to Virtual Machine (VM) From Proxmox VE Jump to navigation Jump to search By adding the raw physical device to the Virtual machine, you can test installers and other disk repair tools that work with disk controllers like ddrescue , Clonezilla or Ubuntu Rescue Remix. NOTE : This guide is meant for QEMU/KVM based Virtual Machines, not for Container. For the latter see (https://forum.proxmox.com/threads/container-with-physical-disk.42280/#post-203292) https://forum.proxmox.com/threads/container-with-physical-disk.42280/#post-203292 As the disk is attached to the physical and virtual host, this will also prevent Virtual Machine live migration. A second side effect is host system IO wait, when running ddrescue, other VM's running on the host can stutter. Contents 1 Attach Pass Through Disk 1.1 Identify Disk 1.1.1 lshw 1.1.2 List disk by-id with lsblk 1.1.3 Short List 1.2 Update Configuration 1.2.1 Hot-Plug/Add physical device as new virtual SCSI disk 1.2.2 Hot-Unplug/Remove virtual disk 1.3 Check Configuration File 1.4 Stop and Restart KVM Virtual Machine 2 Tutorial 3 Disk Recovery Tools Attach Pass Through Disk Identify Disk Before adding a physical disk to host make note of vendor, serial so that you'll know which disk to share in /dev/disk/by-id/ lshw lshw is not installed by default on Proxmox VE (see lsblk for that below), you can install it by executing apt install lshw lshw -class disk -class storage ... *-disk description: ATA Disk product: ST3000DM001-1CH1 vendor: Seagate physical id: 0.0.0 bus info: scsi@3:0.0.0 logical name: /dev/sda version: CC27 serial: Z1F41BLC size: 2794GiB (3TB) configuration: ansiversion=5 sectorsize=4096 ... Note that device names like /dev/sdc should never be used, as this can change between reboots. Use the stable /dev/disk/by-id paths instead. Check by listing all of that directory then look for the disk added by matching serial number from lshw and the physical disk: ls -l /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC lrwxrwxrwx 1 root root 9 Jan 21 10:10 /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC -> ../../sda or try ls -l /dev/disk/by-id | grep Z1F41BLC List disk by-id with lsblk The lsblk is pre-installed, you can print and map the serial and WWN identifiers of attached disks using the following two commands: lsblk -o +MODEL,SERIAL,WWN ls -l /dev/disk/by-id/ You can also use an extended one liner to get the path directly: lsblk |awk 'NR==1{print $0" DEVICE-ID(S)"}NR>1{dev=$1;printf $0" ";system("find /dev/disk/by-id -lname \"*"dev"\" -printf \" %p\"");print "";}'|grep -v -E 'part|lvm' NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT DEVICE-ID(S) sda 8:0 0 7.3T 0 disk /dev/disk/by-id/wwn-0x5000c500c35cd719 /dev/disk/by-id/ata-ST8000DM004-2CX188_ZCT1DNY1 sdb 8:16 1 29G 0 disk /dev/disk/by-id/usb-Generic_STORAGE_DEVICE-0:0 sdc 8:32 0 931.5G 0 disk /dev/disk/by-id/usb-JMicron_Generic_0123456789ABCDEF-0:0 sdd 8:48 0 1.8T 0 disk /dev/disk/by-id/wwn-0x5000c500661eeebd /dev/disk/by-id/ata-ST2000DX001-1CM164_Z1E783H2 (https://unix.stackexchange.com/questions/387855/make-lsblk-list-devices-by-id) make-lsblk-list-devices-by-id Short List find /dev/disk/by-id/ -type l|xargs -I{} ls -l {}|grep -v -E '[0-9]$' |sort -k11|cut -d' ' -f9,10,11,12 /dev/disk/by-id/ata-ST8000DM004-2CX188_ZCT1DNY1 -> ../../sda /dev/disk/by-id/wwn-0x5000c500c35cd719 -> ../../sda /dev/disk/by-id/usb-Generic_STORAGE_DEVICE-0:0 -> ../../sdb /dev/disk/by-id/usb-JMicron_Generic_0123456789ABCDEF-0:0 -> ../../sdc /dev/disk/by-id/ata-ST2000DX001-1CM164_Z1E783H2 -> ../../sdd /dev/disk/by-id/wwn-0x5000c500661eeebd -> ../../sdd Update Configuration Hot-Plug/Add physical device as new virtual SCSI disk qm set 592 -scsi2 /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC update VM 592: -scsi2 /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC Hot-Unplug/Remove virtual disk qm unlink 592 --idlist scsi2 update VM 592: -delete scsi2 Check Configuration File grep Z1F41BLC /etc/pve/qemu-server/592.conf scsi2: /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC,size=2930266584K Stop and Restart KVM Virtual Machine You may need to configure the guest operating system now that the disk is available. Tutorial (https://dannyda.com/2020/08/26/how-to-passthrough-hdd-ssd-physical-disks-to-vm-on-proxmox-vepve/) Example with screenshots Disk Recovery Tools Ubuntu Rescue Remix - (http://www.geekyprojects.com/storage/how-to-recover-data-even-when-hard-drive-is-damaged/) how to use Ubuntu Rescue Remix and Ddrescue ddrescue gnu ddrescue Clonezilla TestDisk PhotoRec Recuva Foremost Parted Magic SpinRite - Low Cost Commercial - Smartctl tutoral for Proxmox VE planned Retrieved from "" Cookies help us deliver our services. By using our services, you agree to our use of cookies. (https://www.proxmox.com/en/privacy-policy) More information (OK) OK Navigation menu (https://pve.proxmox.com/mediawiki/index.php?title=Special:UserLogin&returnto=Passthrough+Physical+Disk+to+Virtual+Machine+%28VM%29) (You are encouraged to log in; however, it is not mandatory [alt-shift-o]) Log in (https://pve.proxmox.com/wiki/Passthrough_Physical_Disk_to_Virtual_Machine_(VM)) (View the content page [alt-shift-c]) Page (https://pve.proxmox.com/mediawiki/index.php?title=Talk:Passthrough_Physical_Disk_to_Virtual_Machine_(VM)&action=edit&redlink=1) (Discussion about the content page (page does not exist) [alt-shift-t]) Discussion (https://pve.proxmox.com/wiki/Passthrough_Physical_Disk_to_Virtual_Machine_(VM)) Read (https://pve.proxmox.com/mediawiki/index.php?title=Passthrough_Physical_Disk_to_Virtual_Machine_(VM)&action=edit) (This page is protected. You can view its source [alt-shift-e]) View source (https://pve.proxmox.com/mediawiki/index.php?title=Passthrough_Physical_Disk_to_Virtual_Machine_(VM)&action=history) (Past revisions of this page [alt-shift-h]) View history (More options) Search (Search Proxmox VE) (Search Proxmox VE [alt-shift-f]) (Search the pages for this text) (Search) (Go to a page with this exact name if it exists) (Go) (https://pve.proxmox.com/wiki/Main_Page) (Visit the main page) (https://pve.proxmox.com/wiki/Main_Page) Proxmox VE (https://pve.proxmox.com/pve-docs/) Documentation (current) (https://pve.proxmox.com/pve-docs-7/) Documentation (7.x) (https://pve.proxmox.com/wiki/Downloads) Downloads (https://pve.proxmox.com/wiki/Installation) Installation (https://pve.proxmox.com/wiki/Get_support) Get support Sites (https://www.proxmox.com/) proxmox.com (https://forum.proxmox.com/) Support forum (https://bugzilla.proxmox.com/) Bugtracker (https://git.proxmox.com/) Source code (https://pve.proxmox.com/wiki/FAQ) FAQ Tools (https://pve.proxmox.com/wiki/Special:WhatLinksHere/Passthrough_Physical_Disk_to_Virtual_Machine_(VM)) (A list of all wiki pages that link here [alt-shift-j]) What links here (https://pve.proxmox.com/wiki/Special:RecentChangesLinked/Passthrough_Physical_Disk_to_Virtual_Machine_(VM)) (Recent changes in pages linked from this page [alt-shift-k]) Related changes (https://pve.proxmox.com/wiki/Special:SpecialPages) (A list of all special pages [alt-shift-q]) Special pages (Printable version of this page [alt-shift-p]) Printable version (https://pve.proxmox.com/mediawiki/index.php?title=Passthrough_Physical_Disk_to_Virtual_Machine_(VM)&oldid=11538) (Permanent link to this revision of this page) Permanent link (https://pve.proxmox.com/mediawiki/index.php?title=Passthrough_Physical_Disk_to_Virtual_Machine_(VM)&action=info) (More information about this page) Page information (https://pve.proxmox.com/mediawiki/index.php?title=Special:CiteThisPage&page=Passthrough_Physical_Disk_to_Virtual_Machine_%28VM%29&id=11538&wpFormIdentifier=titleform) (Information on how to cite this page) Cite this page This page was last edited on 6 December 2022, at 23:32. (https://pve.proxmox.com/wiki/Proxmox_VE:Privacy_policy) Privacy policy (https://pve.proxmox.com/wiki/Proxmox_VE:About) About Proxmox VE (https://pve.proxmox.com/wiki/Proxmox_VE:General_disclaimer) Disclaimers (https://www.mediawiki.org/) (Powered by MediaWiki) ()