online diskonline disk

使脱机磁盘进入联机状态。Takes the offline disk to the online state. 对于基本磁盘,此命令尝试使所选磁盘和该磁盘上的所有卷联机。For basic disks, this command attempts to bring online the selected disk and all volumes on that disk. 对于动态磁盘,此命令会尝试将未标记为 "外部" 的所有磁盘都置于本地计算机上。For dynamic disks, this command attempts to bring online all disks that are not marked as foreign on the local computer. 它还尝试使动态磁盘集上的所有卷联机。It also attempts to bring online all volumes on the set of dynamic disks.

如果磁盘组中的动态磁盘处于联机状态,并且它是组中的唯一磁盘,则会重新创建原始组,并将磁盘移到该组。If a dynamic disk in a disk group is brought online and it's the only disk in the group, then the original group is recreated and the disk is moved to that group. 如果组中有其他磁盘并且它们处于联机状态,则磁盘只会重新添加到组中。If there are other disks in the group and they're online, then the disk is simply added back into the group. 如果选定磁盘的组包含镜像卷或 RAID-5 卷,此命令还会重新同步这些卷。If the group of a selected disk contains mirrored or RAID-5 volumes, this command also resynchronizes these volumes.

备注

必须选择磁盘才能使 联机磁盘 命令成功。A disk must be selected for the online disk command to succeed. 使用 " 选择磁盘 " 命令选择磁盘,并将焦点移动到该磁盘。Use the select disk command to select a disk and shift the focus to it.

重要

如果在只读磁盘上使用此命令,则此命令将失败。This command will fails if it's used on a read-only disk.

语法Syntax

online disk [noerr]

参数Parameters

有关使用此命令的说明,请参阅 重新激活丢失或脱机的动态磁盘For instructions about using this command, see Reactivate a Missing or Offline Dynamic Disk.

参数Parameter 说明Description
noerrnoerr 仅用于脚本。For scripting only. 出现错误时,DiskPart 继续处理命令,就像未发生错误一样。When an error is encountered, DiskPart continues to process commands as if the error did not occur. 如果没有此参数,则错误会导致 DiskPart 退出并出现错误代码。Without this parameter, an error causes DiskPart to exit with an error code.

示例Examples

若要使具有焦点的磁盘联机,请键入:To take the disk with focus online, type:

online disk

其他参考Additional References