Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Manage Disks and Partitions Using DiskPart in Windows

DiskPart is a powerful command-line utility in Windows that allows users to manage their computer's disks, partitions, and volumes. It is particularly useful for performing tasks that are not possible through the graphical Disk Management tool. DiskPart can be used to create, delete, and resize partitions, convert disks between different formats, and more. This article will guide you through some common tasks you can perform with DiskPart.

Examples:

Example 1: How to List All Disks

To view all disks connected to your system, you can use the following command in DiskPart:

  1. Open Command Prompt as an administrator.
  2. Type diskpart and press Enter to start the DiskPart utility.
  3. At the DiskPart prompt, type list disk and press Enter.

This command will display all the disks, along with their status, size, free space, and other details.

C:\> diskpart
DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          500 GB      0 B
  Disk 1    Online          100 GB   100 GB

Example 2: How to Select a Disk and Create a Partition

Once you have identified the disk you want to work with, you can select it and create a new partition:

  1. In DiskPart, type select disk 1 (replace '1' with the disk number you want to select) and press Enter.
  2. To create a new partition, type create partition primary size=50000 and press Enter. This command creates a primary partition of 50,000 MB (approximately 50 GB).
DISKPART> select disk 1
Disk 1 is now the selected disk.

DISKPART> create partition primary size=50000
DiskPart succeeded in creating the specified partition.

Example 3: How to Format a Partition

After creating a partition, you may need to format it before use:

  1. Select the partition you want to format by typing select partition 1 and pressing Enter.
  2. Format the partition using the command format fs=ntfs quick for a quick format with the NTFS file system.
DISKPART> select partition 1
Partition 1 is now the selected partition.

DISKPART> format fs=ntfs quick
  100 percent completed
DiskPart successfully formatted the volume.

Example 4: How to Assign a Drive Letter

To make the partition accessible, you need to assign it a drive letter:

  1. Ensure the partition is selected.
  2. Use the command assign letter=E to assign the drive letter 'E'.
DISKPART> assign letter=E
DiskPart successfully assigned the drive letter or mount point.

Conclusion

DiskPart is an essential tool for advanced disk management tasks in Windows. It offers capabilities beyond what is available in the GUI, making it indispensable for IT professionals and power users. Always exercise caution when using DiskPart, as incorrect commands can lead to data loss.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.