diskpart命令

diskpart is a Windows utility to create partitions on the disk. It is similar to the Linux fdisk utility. diskpart provides an interactive command shell where we will enter related commands to partition, format disk, and volumes. In order to run diskpart we need Administrator privileges. The best way to get Administrator privilege is opening MS-DOS as Administrator by right-clicking on it.

diskpart是Windows实用程序,用于在磁盘上创建分区。 它类似于Linux fdisk实用程序。 diskpart提供了一个交互式命令外壳,我们将在其中输入相关命令来分区,格式化磁盘和卷。 为了运行diskpart,我们需要管理员权限。 获得管理员特权的最佳方法是通过右键单击以管理员身份打开MS-DOS。

diskpart命令交互模式 (diskpart Command Interactive Mode)

diskpart is mainly used by its interactive shell. So we should enter this shell with the diskpart command. All commands issued bellow are used in interactive diskpart shell.

diskpart主要由其交互式外壳使用。 因此,我们应该使用diskpart命令输入此shell。 下面发布的所有命令都在交互式diskpart shell中使用。

> diskpart

Interactive Mode
互动模式

diskpart命令帮助(diskpart Command Help)

There are a lot of command supported by diskpart . We can list these commands with help

diskpart支持很多命令。 我们可以在help这些命令

> help

Help
帮帮我

列出磁盘和分区(List Disk and Partitions)

First we need to know how many disk there are. We will use list disk command for this. We will also get following information about disks.

首先,我们需要知道有多少个磁盘。 我们将为此使用list disk命令。 我们还将获得有关磁盘的以下信息。

  • Status状态
  • Size尺寸
  • Free自由
  • GPTGPT
> list disk

List Disk and Partitions
列出磁盘和分区

选择要格式化的磁盘(Select Disk To Format)

Now we will select the second disk which is numbered as 1. Because disk numbers start from 0. We will use select disk 1 . In order to execute format commands, we should select a disk.

现在,我们将选择第二个磁盘,编号为1。因为磁盘号从0开始。我们将使用select disk 1 。 为了执行格式化命令,我们应该选择一个磁盘。

> select disk 1

Select Disk
选择磁盘

清理驱动器分区表和信息(Clean Drive Partition Table and Information)

If there is an already set configuration we should clear them to make things simple.  We will use clean command.

如果已经设置好配置,我们应该清除它们以简化操作。 我们将使用clean命令。

> clean

Clean Drive
清洁驱动器

检查磁盘选择(Check Disk Selection)

In order to execute commands to format disk we should select the disk and partition. We have already selected disk but we can check this selection with list disk command too. Selected disk will have asterisk before its name.

为了执行格式化磁盘的命令,我们应该选择磁盘和分区。 我们已经选择了磁盘,但是我们也可以使用list disk命令检查此选择。 所选磁盘的名称前将带有星号。

> list disk

Check Disk Selection
检查磁盘选择

创建新的分区表(Create New Partition Table)

We will create a partition on the selected disk. We will issue create partition primary. There are primary and secondary partition types. IF we have less than 5 partitions in a disk we can use primarily for all of them.

我们将在所选磁盘上创建一个分区。 我们将发布create partition primary。 有主分区和辅助分区类型。 如果磁盘中的分区少于5个,则可以将其主要用于所有分区。

> create partition primary

Create Partition
创建分区

列出现有分区表和信息(List Existing Partition Table and Information)

Now we can list partition we have already created. We will use list partition command for this. Also following information about partition will be listed

现在我们可以列出已经创建的分区。 我们将为此使用list partition命令。 此外,还将列出有关分区的以下信息

  • Partition name分区名称
  • Partition Type分区类型
  • Szie西耶
  • Offset抵消
> list partition

List Partition
列表分区

选择要修改的分区(Select Partition To Modify)

In order to operate on the given partition, we should select the partition with the select partition command. This will select selected disks given partition according to number.

为了对给定的分区进行操作,我们应该使用select partition命令选择该分区。 这将根据编号选择给定分区的选定磁盘。

> select partition 1

Select Partition
选择分区

激活分区(Activate Partition)

In order to use partition we will activate it. We will use active command.

为了使用分区,我们将激活它。 我们将使用active命令。

> active

Activate Partition
激活分区

格式化分区(Format Partition)

This is one of the most important part. We will format the selected and activated partition. We will use format command. Also, we will specify the file system type with the FS option. label option is used to set the name of partition which is shown to the user. quick specifies the format operation speed. In this example, we set file system type NTFS and label D

这是最重要的部分之一。 我们将格式化选定并激活的分区。 我们将使用format命令。 另外,我们将使用FS选项指定文件系统类型。 标签选项用于设置显示给用户的分区名称。 quick指定格式操作速度。 在此示例中,我们设置文件系统类型为NTFS ,标签为D

> format FS=NTFS label=D quick

Format Partition
格式化分区

分配字母(Assign Letter)

In order to use the partition, we should assign a letter to the formatted partition. We will use assign command with letter option. In this example, we assign letter E to the partition.

为了使用分区,我们应该为格式化的分区分配一个字母。 我们将使用带letter选项的assign命令。 在此示例中,我们为分区分配字母E

> assign letter=E

Assign Letter
分配字母

We can see from screenshot that we have tried to assign D previously which is already assigned. This produced error and operation is not completed.

从屏幕截图中可以看到,我们已经尝试分配先前已分配的D 产生的错误和操作未完成。

.u61701e1e4954d8a325ae469814eec4a8 , .u61701e1e4954d8a325ae469814eec4a8 .postImageUrl , .u61701e1e4954d8a325ae469814eec4a8 .centered-text-area { min-height: 80px; position: relative; } .u61701e1e4954d8a325ae469814eec4a8 , .u61701e1e4954d8a325ae469814eec4a8:hover , .u61701e1e4954d8a325ae469814eec4a8:visited , .u61701e1e4954d8a325ae469814eec4a8:active { border:0!important; } .u61701e1e4954d8a325ae469814eec4a8 .clearfix:after { content: ""; display: table; clear: both; } .u61701e1e4954d8a325ae469814eec4a8 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u61701e1e4954d8a325ae469814eec4a8:active , .u61701e1e4954d8a325ae469814eec4a8:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u61701e1e4954d8a325ae469814eec4a8 .centered-text-area { width: 100%; position: relative; } .u61701e1e4954d8a325ae469814eec4a8 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u61701e1e4954d8a325ae469814eec4a8 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u61701e1e4954d8a325ae469814eec4a8 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u61701e1e4954d8a325ae469814eec4a8:hover .ctaButton { background-color: #E67E22!important; } .u61701e1e4954d8a325ae469814eec4a8 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u61701e1e4954d8a325ae469814eec4a8 .u61701e1e4954d8a325ae469814eec4a8-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u61701e1e4954d8a325ae469814eec4a8:after { content: ""; display: block; clear: both; }

LEARN MORE  Compare FAT32 vs exFAT vs NTFS File Systems

.u61701e1e4954d8a325ae469814eec4a8 , .u61701e1e4954d8a325ae469814eec4a8 .postImageUrl , .u61701e1e4954d8a325ae469814eec4a8 .centered-text-area { min-height: 80px; position: relative; } .u61701e1e4954d8a325ae469814eec4a8 , .u61701e1e4954d8a325ae469814eec4a8:hover , .u61701e1e4954d8a325ae469814eec4a8:visited , .u61701e1e4954d8a325ae469814eec4a8:active { border:0!important; } .u61701e1e4954d8a325ae469814eec4a8 .clearfix:after { content: ""; display: table; clear: both; } .u61701e1e4954d8a325ae469814eec4a8 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u61701e1e4954d8a325ae469814eec4a8:active , .u61701e1e4954d8a325ae469814eec4a8:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u61701e1e4954d8a325ae469814eec4a8 .centered-text-area { width: 100%; position: relative; } .u61701e1e4954d8a325ae469814eec4a8 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u61701e1e4954d8a325ae469814eec4a8 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u61701e1e4954d8a325ae469814eec4a8 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u61701e1e4954d8a325ae469814eec4a8:hover .ctaButton { background-color: #E67E22!important; } .u61701e1e4954d8a325ae469814eec4a8 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u61701e1e4954d8a325ae469814eec4a8 .u61701e1e4954d8a325ae469814eec4a8-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u61701e1e4954d8a325ae469814eec4a8:after { content: ""; display: block; clear: both; }

了解更多比较FAT32与exFAT与NTFS文件系统

从Diskpart Interactive Shell退出(Exit From Diskpart Interactive Shell)

We can exit from the diskpart interactive shell with exit command like below.

我们可以使用如下的exit命令从diskpart交互式shell中exit

> exit

翻译自: https://www.poftut.com/windows-diskpart-command-tutorial-examples-format-disk/

diskpart命令

diskpart命令_Windows Diskpart命令教程相关推荐

  1. 昊鼎王五:Windows运行中的所有命令_Windows快捷命令_运行中的所有命令

    昊鼎王五:Windows运行中的所有命令_Windows快捷命令_"运行"中的所有命令 winver 检查Windows版本 wmimgmt.msc 打开Windows管理体系结构 ...

  2. tracert命令_Windows Tracert命令教程

    tracert命令 Windows operating system provides some basic tools to troubleshoot the network. tracert is ...

  3. bat 命令返回结果_bat教程[284] unzip解压

    古树屋Click to follow us (1)unzip命令的简介 C:\Users\86137\Desktop>unzip -hUnZip 6.00 of 20 April 2009, b ...

  4. 区块链教程Fabric1.0源代码分析Peer peer channel命令及子命令实现

    区块链教程Fabric1.0源代码分析Peer peer channel命令及子命令实现,2018年下半年,区块链行业正逐渐褪去发展之初的浮躁.回归理性,表面上看相关人才需求与身价似乎正在回落.但事实 ...

  5. linux sed p变量,Linux sed 命令详解系列教程之各种问题解决

    本文目录: 1 sed中使用变量和变量替换的问题 2 反向引用失效问题 3 "-i"选项的文件保存问题 4 贪婪匹配问题 5 sed命令"a"和"N& ...

  6. 启动mysql55命令_mysql服务的启动和停止登陆mysql增加新用命令和方法实例教程

    mysql服务的启动和停止登陆mysql增加新用命令和方法实例教程,mysql常见常用操作命令汇总总结,增删查改命令,启动用户管理,数据库管理等. mysql服务的启动和停止 net stop mys ...

  7. find基础命令与提权教程

    find基础命令与提权教程 find命令用来在指定目录下查找文件,若不指定目录则视为当前目录 find常用参数 语法:find [path-] [expression] path为查找路径,.为当前路 ...

  8. cad角度命令怎么输入_CAD教程 | CAD大佬也是这样过来的,制图命令的输入方法及操步骤...

    1 命令的输入方法及操作步骤 在绘图时,可以用两种方法:一种是键盘输入,一种是鼠标输入.新手建议大家先使用鼠标输入.等我们熟悉这些功能键之后,可以使用快捷键来快速提高绘图效率.鼠标输入可以直接点击工具 ...

  9. Docker在Centos7安装、及命令(详细安装教程)

    Docker在Centos7安装.及命令(详细安装教程) 为什么使用Docker Docker中包括三个基本概念 Docker安装 Docker获取镜像 使用刚刚获取的centos镜像,创建一个容器, ...

  10. python写通讯录_Python实现命令行通讯录实例教程

    1.实现目标 编写一个命令行通讯录程序,可以添加.查询.删除通讯录好友及电话 2.实现方法 创建一个类来表示一个人的信息.使用字典存储每个人的对象,名字作为键. 使用pickle模块永久地把这些对象存 ...

最新文章

  1. 服务器可以响应字符类型的数据吗,HTTP - Response
  2. 正则表达式学习神器!
  3. java 使用servlet做学生管理系统(无框架)
  4. C#委托的介绍(delegate、Action、Func、predicate)
  5. Spring框架中bean的生命周期
  6. mysql sql select_mysql SQL Select 语句 简单应用
  7. leetcode 797. All Paths From Source to Target | 797. 所有可能的路径(回溯法)
  8. 新Rider预览版发布,对F#的支持是亮点
  9. Linux加密框架crypto crypto_alg|cipher_alg数据结构|AES例子
  10. 模拟电子技术不挂科学习笔记3(放大电路的分析方法)
  11. Facebook账户 “ 解封、防封、养号 ” 知识要点
  12. Spring整合MyBatis之MapperFactoryBean
  13. json 转 map,循环得到 key,value
  14. matlab gui串口通信,Matlab GUI上位机界面实现串口通信
  15. Linux服务器网卡驱动安装及故障排除
  16. teraterm linux环境,linux ssh telnet TeraTerm终端中文显示乱码解决方法
  17. 皮尔逊相关系数公式手写代码【Python+详细注解】(Pearson correlation coefficient)
  18. rails分页(kaminari)
  19. (转)当android调试遇到ADB server didn't ACK以及顽固的sjk_daemon进程 .
  20. Excel如何提取单元格中最后一次出现的数值

热门文章

  1. android retrofit实例,Retrofit使用步骤
  2. 大写字母转换为小写字母
  3. 佳能打印服务 android,佳能打印机app
  4. Android 字符串求值工具(科学计算)
  5. 农历php,php 阴历-农历-转换类代码
  6. vue 自定义 文字背景
  7. 【ICML 2020联邦学习论文解读】SCAFFOLD: Stochastic Controlled Averaging for Federated Learning
  8. 我一直在维护的石墨文档开源了
  9. 设计圈都这么卷的吗!看霜降海报哪家强
  10. wtl,9到10版的改进