2010-03-02 53 views
-1

有人可以請讓我知道我們如何能如果在本地磁盤或SAN確定。確定驅動器是SAN

由於

+2

爲什麼這個標記爲SQL服務器?聽起來更像是一個ServerFault.com的東西 – 2010-03-02 15:46:46

回答

0

SAN被併入到一個物理網絡拓撲中的存儲區域網絡 拓撲結構,它 這意味着提供了存儲用於共享/經由網絡(通常是TCP/IP)存儲數據...這與NFS(網絡文件共享)類似,或者使用Microsoft特定的服務器消息塊協議在服務器上指定共享並使用驅動器盤符 - 通用命名約定,其中共享驅動器映射到驅動器盤符的形式爲' \\服務器\富」。

能否請您澄清,如果這是你在找什麼?如何確定驅動器是否映射到共享驅動器,如'\\ servername \ foo'?

看一看這個線程在這裏...在映射驅動器和斷開映射驅動器here。在這裏檢查路徑是否在網絡here上。

編輯:由於zombiesheep的澄清,由於我的困惑我對參加CompTIA Network + 2009年訓練期間由他人被告知後.....咄!

希望這會有所幫助, 最好的問候, 湯姆。

+1

對不起,但SAN通常不通過網絡連接。它通常通過光纖通道直接連接到服務器中的某種主機總線適配器上。然後,服務器負責根據其認爲合適的方式使用分配的空間,無論是內部存儲,網絡服務還是其他任何服務。聽起來像是你將它與NAS(網絡附加存儲)混淆起來對不起,前惠普StorageWorks工程師在這裏。 :) – ZombieSheep 2010-03-02 15:49:19

+0

@ZombieSheep:哦......好的......有趣的是......我接受你的話......今年早些時候我正在學習CompTIA網絡+ 2009年,那是我通過CBT教的...... 。你會相信... SAN的拓撲...感嘆...感謝您的領導,我會糾正這個不知何故... :) – t0mm13b 2010-03-02 15:54:16

2

沒有「OS不可知」的方式來確定文件系統是通過SAN回結束。

也就是說,請讓我們知道你使用的是什麼操作系統,所以我們可以幫助確定特定操作系統的方式來確定此(除了要求存儲管理員)。

+0

我有同樣的問題,我想對*​​ nix框。你可以請教我嗎?謝謝。 – kolslorr 2011-03-31 03:28:44

0

在這裏你去,用C#和WMI。使用這個你可以從命令提示符輸入「enumSANDrives」,它會列出它們。您可能需要稍微調整一下描述,然後通過Scriptomatic或其他方式手動查看WMI類,以匹配您的特定SAN。

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Collections; 
using System.ComponentModel; 
using System.Data; 
using System.Diagnostics; 
using System.IO; 
using System.Management; 
using System.Data.SqlClient; 
using Microsoft.Win32; 
using System.Net; 
using System.Net.NetworkInformation; 
using System.Runtime.InteropServices; 
using System.Security.Permissions; 
using System.Security.Principal; 

namespace EnumSANDrives 
{ 
    class Program 
    { 


     static void Main(string[] args) 
     { 
      //1. Start with the Win32_DiskDrive class and query for instances of Win32_DiskPartition using the DeviceID property and the 
      //Win32_DiskDriveToDiskPartition association class. Now you have a collection of the partitions on the physical drive. 
      //2. Query for the Win32_LogicalDisk that represents the partition using the Win32_DiskPartition.DeviceID property and 
      //Win32_LogicalDiskToPartition association class. 
      //3. Get the drive letter from the Win32_LogicalDisk.DeviceID. 

      ConnectionOptions connOptions = new ConnectionOptions(); 
      connOptions.Username = "<username>"; 
      connOptions.Password = "<pwd>"; 
      connOptions.Authentication = AuthenticationLevel.Packet; 
      connOptions.Impersonation = ImpersonationLevel.Impersonate; 
      connOptions.EnablePrivileges = true; 
      ManagementScope manScope = new ManagementScope(String.Format(@"\\{0}\ROOT\CIMV2", machine), connOptions); 
      manScope.Connect(); 
      ObjectQuery oQueryDiskDrive = new ObjectQuery("select * from Win32_DiskDrive"); 
      ManagementObjectSearcher oSearcherDiskDrive = new ManagementObjectSearcher(manScope, oQueryDiskDrive); 
      ManagementObjectCollection oReturnDiskDrive = oSearcherDiskDrive.Get(); 
      foreach (ManagementObject DiskDrive in oReturnDiskDrive) 
      { 
       ObjectQuery oQueryDiskPartition = new ObjectQuery("ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" + DiskDrive["DeviceID"] + "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition"); 
       ManagementObjectSearcher oSearcherDiskPartition = new ManagementObjectSearcher(manScope, oQueryDiskPartition); 
       ManagementObjectCollection oReturnDiskPartition = oSearcherDiskPartition.Get(); 
       foreach (ManagementObject DiskPartition in oReturnDiskPartition) 
       { 
        ObjectQuery oQueryLogicalDisk = new ObjectQuery("ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" + DiskPartition["DeviceID"] + "'} WHERE AssocClass = Win32_LogicalDiskToPartition"); 
        ManagementObjectSearcher oSearcherLogicalDisk = new ManagementObjectSearcher(manScope, oQueryLogicalDisk); 
        ManagementObjectCollection oReturnLogicalDisk = oSearcherLogicalDisk.Get(); 
        foreach (ManagementObject LogicalDisk in oReturnLogicalDisk) 
        { 
         try 
         { 
          //Console.Write("Drive Name : " + LogicalDisk["DeviceID"].ToString()); 
          if (DiskDrive["PNPDeviceID"] != null) 
          { 
           if (DiskDrive["PNPDeviceID"].ToString().Contains("VEN_EMC")) 
           { 
            Console.WriteLine("Drive Name : " + LogicalDisk["DeviceID"].ToString() + " - " + "EMC SAN " + DiskDrive["Model"].ToString()); 
           } 
           if (DiskDrive["PNPDeviceID"].ToString().Contains("VEN_IBM")) 
           { 
            Console.WriteLine("Drive Name : " + LogicalDisk["DeviceID"].ToString() + " - " + "IBM SAN " + DiskDrive["Model"].ToString()); 
           } 
           if (DiskDrive["PNPDeviceID"].ToString().Contains("VEN_COMPAQ")) 
           { 
            Console.WriteLine("Drive Name : " + LogicalDisk["DeviceID"].ToString() + " - " + "HP SAN " + DiskDrive["Model"].ToString()); 
           } 



          } 
          //Console.WriteLine("Size : " + BytesToGB(DiskDrive["Size"].ToString())); 
          //Console.WriteLine("Used Space : " + BytesToGB((Convert.ToDouble(DiskDrive["Size"].ToString()) - Convert.ToDouble(LogicalDisk["FreeSpace"].ToString())).ToString())); 
          //Console.WriteLine("Free Space : " + BytesToGB(LogicalDisk["FreeSpace"].ToString())); 
         } 
         catch (Exception) 
         { 
          continue; 
         } 
        } 
       } 
      } 

     } 
    } 
} 
相關問題