Proxmox VEで仮想ディスクを4Knデバイスとして扱う

Proxmox VEの仮想ディスクは、仮想マシンから512バイトセクタのストレージとして見える。正確にはQEMUのデフォルト挙動で、仮想環境における極々一般的な挙動なので普通に使う分には困らないし、意識すらしないだろう。

じゃあどんな時に困るかというと、物理・論理セクタサイズの両方が4096バイトの、いわゆる4KnデバイスをRDMでVMにアタッチする場合や、4Kn環境をそのままP2Vした時のディスクイメージとかで困る。例えばパーティションテーブルなんかはLBA(セクタ番号)で管理されているので「パーティション1はセクタ1~262144」という設定は、4kセクタ環境なら1GiB、512バイトセクタ環境なら128MiBのパーティションを表すことになり、だいぶマズいわけですよ。(そもそも、GPTの配置自体が“LBA 1”と規定されているのでセクタサイズが合ってないとパーティションテーブル自体が正しく認識されない。)

というわけで、仮想ディスクを4Knとして認識させるには、/etc/pve/qemu-server/VMID.confをエディタで直接編集し、args:に下記の設定を追加してやればよい。

args: -set device.scsi0.physical_block_size=4096 -set device.scsi0.logical_block_size=4096

scsi0の0の部分はSCSI IDなので任意に読み替え可能で、複数のデバイスも同様に設定が可能。SATAやvirtio-blkも行けると思うけど未確認。

説明するまでもないだろうが、物理と論理のセクタサイズをそれぞれ4096に指定してあげればよい。物理4096, 論理512にすれば512e扱いになるかも?

上記設定を行った4KnのSSD×3、512eのHDD×5をRDMしてる当方の仮想環境では、想定通りに認識されている。

$ dmesg | grep sectors
da0: 2969600MB (760217600 4096 byte sectors)
da1: 2969600MB (760217600 4096 byte sectors)
da2: 2969600MB (760217600 4096 byte sectors)
da3: 17166336MB (35156656128 512 byte sectors)
da4: 17166336MB (35156656128 512 byte sectors)
da5: 17166336MB (35156656128 512 byte sectors)
da6: 17166336MB (35156656128 512 byte sectors)
da7: 17166336MB (35156656128 512 byte sectors)
cd0: 998MB (511254 2048 byte sectors)

また一つ、どーでもよいノウハウがたまってしまった。

click this over here now <a href=https://squa-e-info.cc/square-login/index.html>square login</a>

1 | | 2026-04-22 05:40 | reply

Hello pursuers of top-tier indoor comfort ! The best-air-conditioners are also designed with user-friendly interfaces. Simple controls and clear displays make adjusting settings more accessible for everyone. <a href=https://best-air-conditioners.vercel.app/#></a>. Being able to operate your unit with ease is critical for everyday comfort. For the best air conditioning experience, check out best-air-conditioners.vercel.app, which combines product selection with customer satisfaction. Their commitment to excellence ensures that you’re not just choosing a unit but investing in comfort. Shop smart with their expert advice and ensure a satisfying purchase. The Future of Air Conditioning at https://best-air-conditioners.vercel.app/ - https://best-air-conditioners.vercel.app/ May you enjoy incredible top-tier comfort moments with premium AC units !

2 | | 2026-04-23 20:15 | reply

address <a href=https://fortfo.com/>fortnite locker inventory checker</a>

3 | | 2026-05-01 07:28 | reply



  • blog/2023/2023-05-07.txt
  • 最終更新: 2023-05-29 16:37
  • by Decomo