Proxmox storage tips/HDD pass through

Check/list hdd hw

ls /dev/disk/by-id/
lsblk

Check MD raid status

cat /proc/mdstat

Remove a hdd from software raid md0

mdadm –fail /dev/md0 /dev/sdx1
mdadm –remove /dev/md0 /dev/sdx1

mdadm –remove /dev/md0 /dev/sdx2

udevadm info –query=all –name=/dev/sdx | grep ID_SERIAL

zfs list
zpool status zfstorage

Remove a hdd from zpool

zpool detach zfstorage /dev/disk/by-id/….
zpool status zfstorage

clear data

mdadm –misc –zero-supperblock /dev/sdx1
mdadm –misc –zero-supperblock /dev/sdx2
wipefs -a /dev/sdx

clear all left part on sdx

fdisk /dev/sdx
wipefs -a /dev/sdx

check disk status

lsblk

Pass through sdx to proxmox vm

First get hdd ID via ls /dev/disk/by-id/

ls /dev/disk/by-id/
ata-SAMSUNG_HD163GJ_S2FXJ9CZ901590
ata-SAMSUNG_HD163GJ_S2FXJ9CZ901590-part1
ata-TOSHIBA_DT01ACA100_3760GKPMS
ata-TOSHIBA_DT01ACA100_3760GKPMS-part1
ata-TOSHIBA_DT01ACA100_3760GKPMS-part2
ata-TOSHIBA_DT01ACA100_3760GKPMS-part3
dm-name-pve-root
dm-name-pve-swap
dm-name-pve-vm–100–disk–0
dm-name-pve-vm–120–disk–0
dm-uuid-LVM-jsdRy3n7YEN9lUjDu7eJrm2gDt4Rglc6b3YrMsfnXrYnge2iBD83bRQYJsa69nUR
dm-uuid-LVM-jsdRy3n7YEN9lUjDu7eJrm2gDt4Rglc6cqZGFVeXAN3LtZRd8Zn6YIFKfnBeoNcP
dm-uuid-LVM-jsdRy3n7YEN9lUjDu7eJrm2gDt4Rglc6fM0HYcbqNOaaxUyeJ1czczSJmMz52cfS
dm-uuid-LVM-jsdRy3n7YEN9lUjDu7eJrm2gDt4Rglc6sAQBR4OvFDoNpE2dePEveFWcg5tfLORK
lvm-pv-uuid-sKwOBA-sEun-ifF5-Mv78-xRbX-fRSu-m3LGbF
wwn-0x5000039fefc036b2
wwn-0x5000039fefc036b2-part1
wwn-0x5000039fefc036b2-part2
wwn-0x5000039fefc036b2-part3
wwn-0x50024e92034cfe22
wwn-0x50024e92034cfe22-part1

Prepare a HDD to pass through

fdisk /dev/sdx
lsblk
wipefs -a /dev/sdx

Get list/ID of KVM VM

qm list

  VMID NAME                 STATUS     MEM(MB)    BOOTDISK(GB) PID
   106 server              stopped    2512               0.00 0

Pass through sdx to proxmox vm

qm set 106 -virtio0 /dev/disk/by-id/ata-SAMSUNG_HD163GJ_S2FXJ9CZ901590

https://www.youtube.com/watch?reload=9&v=Qumdkf3etGU

Leave a Reply