簡體   English   中英

Powershell 無法運行 mount

[英]Powershell can't run mount

嘗試將 NFS 共享掛載到 Windows 2012 R2 服務器上,但不確定如何解釋拋出的錯誤。

以管理員身份運行 powershell 並輸入以下命令...

PS C:\Windows\system32> whoami
domain\myuser


PS C:\Windows\system32> mount -o nolock mapr006:/mapr z:
New-PSDrive : Parameter cannot be processed because the parameter name 'o' is ambiguous. Possible matches include:
-OutVariable -OutBuffer.
At line:1 char:7
+ mount -o nolock mapr006:/mapr z:
+       ~~
    + CategoryInfo          : InvalidArgument: (:) [New-PSDrive], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameter,Microsoft.PowerShell.Commands.NewPSDriveCommand



PS C:\Windows\system32> mount mapr006:/mapr z:

cmdlet New-PSDrive at command pipeline position 1
Supply values for the following parameters:
Root: mapr006:/mapr
mount : Cannot find a provider with the name 'z:'.
At line:1 char:1
+ mount mapr006:/mapr z:
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (z::String) [New-PSDrive], ProviderNotFoundException
    + FullyQualifiedErrorId : ProviderNotFound,Microsoft.PowerShell.Commands.NewPSDriveCommand



PS C:\Windows\system32> get-alias mount

CommandType     Name                                               ModuleName
-----------     ----                                               ----------
Alias           mount -> New-PSDrive



PS C:\Windows\system32> New-PSDrive Z -PsProvider FileSystem -Root \\mapr006\mapr
New-PSDrive : The specified drive root "\\mapr006\mapr" either does not exist, or it is not a folder.
At line:1 char:1
+ New-PSDrive Z -PsProvider FileSystem -Root \\mapr006\mapr
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ReadError: (Z:PSDriveInfo) [New-PSDrive], IOException
    + FullyQualifiedErrorId : DriveRootError,Microsoft.PowerShell.Commands.NewPSDriveCommand



PS C:\Windows\system32> New-PSDrive Z -PsProvider FileSystem -Root \\172.18.4.109\mapr
New-PSDrive : The specified drive root "\\172.18.4.109\mapr" either does not exist, or it is not a folder.
At line:1 char:1
+ New-PSDrive Z -PsProvider FileSystem -Root \\172.18.4.109\mapr
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ReadError: (Z:PSDriveInfo) [New-PSDrive], IOException
    + FullyQualifiedErrorId : DriveRootError,Microsoft.PowerShell.Commands.NewPSDriveCommand

得到許多錯誤。 我認為上面嘗試的命令符合進程期望的內容,因此不確定此時我做錯了什么(通常用於 linux)。 請注意,在最后一個命令中,它告訴我\\\\172.18.4.109\\mapr不是文件夾,但在文件資源管理器 GUI 中使用“映射網絡驅動器”時,我實際上能夠安裝此位置。

任何有更多 Windows 經驗的人都可以就調試技巧或可能發生的事情以及如何解決這個問題提供任何建議嗎?

如果您需要的很簡單,您可以使用:

假設服務器將是“mapr006”和要掛載的文件夾“mapr”

New-PSDrive -Name "z" -Root "\\mapr006\mapr" -Persist -PSProvider "FileSystem"

如果您需要更復雜的東西,我應該解釋以下內容:

mount 是一個別名

PS C:\Users\Juan_Pablo> alias mount

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           mount -> New-PSDrive

您可以看到可用的 cmdlet:

PS C:\Users\Juan_Pablo> get-command *nfs*

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Get-NfsUser                                        11.5.0.... VMware.VimAutomation.Storage
Cmdlet          New-NfsUser                                        11.5.0.... VMware.VimAutomation.Storage
Cmdlet          Remove-NfsUser                                     11.5.0.... VMware.VimAutomation.Storage
Cmdlet          Set-NfsUser                                        11.5.0.... VMware.VimAutomation.Storage
Application     nfsadmin.exe                                       10.0.19... C:\WINDOWS\system32\nfsadmin.exe
Application     nfsclnt.exe                                        10.0.19... C:\WINDOWS\system32\nfsclnt.exe
Application     nfsmgmt.msc                                        0.0.0.0    C:\WINDOWS\system32\nfsmgmt.msc

New-PSDrive 沒有所有掛載選項,但您可以通過鍵入完整位置的路徑來使用“掛載”。 假設服務器將是“mapr006”和要掛載的文件夾“mapr”

C:\WINDOWS\System32\mount.exe mtype=hard -o anon -o nolock -o fileaccess=644 \\mapr006\mapr z:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM