差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

下次修改
前次修改
pc:raid:megaraid:howtomapvdtoospath [2016/08/04 09:42]
tony 建立
pc:raid:megaraid:howtomapvdtoospath [2023/06/25 09:48] (目前版本)
行 1: 行 1:
 +{{tag>​megaraid storcli smartctl}}
 ====== How to map the MegaRAID VirtualDrive to the OS Path? ====== ====== How to map the MegaRAID VirtualDrive to the OS Path? ======
 ===== Linux ===== ===== Linux =====
行 6: 行 7:
 </​code>​ </​code>​
 {{:​pc:​raid:​megaraid:​skip_vd_drives_linux.png|}} {{:​pc:​raid:​megaraid:​skip_vd_drives_linux.png|}}
 +===== Windows =====
 +Windows上有幾種作法,目前第一種作法是確定可行,第二種和第三種還在反證中或找明確文件:​
 +  * 與smartctl比對
 +  * 序號反轉
 +  * 使用PCI資訊
 +以下是我的範例:​\\
 +{{:​pc:​raid:​megaraid:​storcli_vd_win.png|}}
 +==== smartctl ====
 +smartctl的輸出中,有個Logical Unit Id會與SCSI NAA ID對應:\\
 +{{:​pc:​raid:​megaraid:​smartctl_6.5_win.png|}}
 +==== 序號反轉 ====
 +<​code>​
 +0x60030480070a14001dd43d642574735c # SCSI NA ID
 +030480070a14001dd43d642574735c ​    # remove 0x60,6為IEEE registered extended format
 +5c747425643dd41d00140a07800403 ​    # 以byte為單位反轉030480070a14001dd43d642574735c則為序號少開頭兩個0
 +</​code>​
 +序號可以到WMI中的Win32_DiskDrive中取得:​\\
 +{{:​pc:​raid:​megaraid:​wmiexplorer_win32_diskdrive.png|}}\\
 +假如你是使用diskid32去取序號,則是將030480070a14001dd43d642574735c字串反轉。
 +==== PCI ====
 +這方法只是推測,假如說LSI Card是在bus且有兩個virtual drive(ID為0與1),在Win32_DiskDrive中的PNPDeviceID如下:​
 +<​code>​
 +PNPDeviceID:​ SCSI\DISK&​VEN_SMC&​PROD_LSI2208\5&​25F6E07A&​1&​010000
 +PNPDeviceID:​ SCSI\DISK&​VEN_SMC&​PROD_LSI2208\5&​25F6E07A&​1&​010100
 +</​code>​
 +尾巴的格式可能為1.0.0,也可能為010000;第一個byte應該就是bus,第二個就是fun也就是virtual drive id,第三個不重要省略。這個方法還需要測試與找明確證據。
 +===== Summary =====
 +在windows與liunx上最一致的做法,是藉由storcli與smartctl的比對,去找出VD與OS Path的對應;但要注意smartctl的GPL license與在linux上編譯執行檔參照函示庫的問題。
 +===== Reference =====
 +  * [[https://​social.technet.microsoft.com/​Forums/​windowsserver/​en-US/​8fb1fc12-9dbd-4a55-a70a-542c1c69f231/​how-can-i-match-wwn-with-a-physical-disk?​forum=winserverpowershell|How can I match wwn with a physical disk?]]
 +  * [[https://​bryanchain.com/​2016/​01/​20/​breaking-down-an-naa-id-world-wide-name/​|Breaking Down an NAA ID / World Wide Name]]
 +  * [[http://​serverfault.com/​questions/​381177/​megacli-get-the-dev-sd-device-name-for-a-logical-drive|MegaCli:​ Get the /dev/sd* device name for a logical drive]]
 +  * [[https://​github.com/​chicks-net/​megamap|megamap]]
 +  * [[https://​www.smartmontools.org/​wiki/​Download|smartctl download]]
  
 +=====    =====
 +----
 +\\
 +~~DISQUS~~