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 in Windows Using Disk Management and Command Line Tools

Managing disks efficiently is crucial for maintaining the health and performance of a Windows system. Windows provides several tools to manage disks, partitions, and volumes, including the Disk Management utility and command-line tools like DiskPart and PowerShell. This article will guide you through the process of using these tools to perform common disk management tasks.

Using Disk Management

Disk Management is a graphical utility in Windows that allows you to view and manage the disks installed on your computer. You can perform tasks such as creating, deleting, and formatting partitions, as well as assigning drive letters.

Accessing Disk Management

  1. Press Windows + X and select "Disk Management" from the menu.
  2. Alternatively, press Windows + R, type diskmgmt.msc, and press Enter.

Creating a New Partition

  1. In the Disk Management window, locate the disk with unallocated space.
  2. Right-click on the unallocated space and select "New Simple Volume."
  3. Follow the New Simple Volume Wizard to specify the size, assign a drive letter, and format the partition.

Deleting a Partition

  1. Right-click on the partition you want to delete and select "Delete Volume."
  2. Confirm the action when prompted.

Using DiskPart Command Line Tool

DiskPart is a powerful command-line utility that provides more advanced disk management capabilities.

Accessing DiskPart

  1. Open the Command Prompt as an administrator by searching for cmd, right-clicking on it, and selecting "Run as administrator."
  2. Type diskpart and press Enter to start the DiskPart utility.

Creating a New Partition with DiskPart

  1. List the available disks by typing list disk and pressing Enter.
  2. Select the disk where you want to create a partition by typing select disk X, replacing X with the disk number.
  3. Create a partition by typing create partition primary size=XXXX, replacing XXXX with the desired size in MB.
  4. Format the partition by typing format fs=ntfs quick and assign a drive letter with assign letter=X, replacing X with the desired letter.

Deleting a Partition with DiskPart

  1. List the partitions on the selected disk by typing list partition.
  2. Select the partition you want to delete by typing select partition X, replacing X with the partition number.
  3. Delete the partition by typing delete partition.

Using PowerShell for Disk Management

PowerShell provides cmdlets for managing disks and volumes, offering a scriptable way to automate disk management tasks.

Listing Disks and Volumes

Open PowerShell as an administrator and use the following commands:

Get-Disk          # Lists all disks
Get-Partition     # Lists all partitions on all disks
Get-Volume        # Lists all volumes

Creating a New Partition with PowerShell

New-Partition -DiskNumber X -UseMaximumSize -AssignDriveLetter
Format-Volume -FileSystem NTFS -DriveLetter X

Replace X with the appropriate disk number and desired drive letter.

Deleting a Partition with PowerShell

Remove-Partition -DiskNumber X -PartitionNumber Y

Replace X with the disk number and Y with the partition number.

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.