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

Disk Management is a crucial component of the Windows operating system that allows users to perform advanced storage tasks such as creating, resizing, and formatting partitions. This article will guide you through the various ways to manage disks in Windows using both the graphical Disk Management tool and command-line utilities like Diskpart and PowerShell.

Using Disk Management GUI:

  1. Accessing Disk Management:

    • Press Windows + X and select "Disk Management" from the menu.
    • Alternatively, you can open the Run dialog with Windows + R, type diskmgmt.msc, and press Enter.
  2. Creating a New Partition:

    • Right-click on an unallocated space on your drive and select "New Simple Volume."
    • Follow the New Simple Volume Wizard to specify the volume size, assign a drive letter, and format the partition.
  3. Resizing a Partition:

    • Right-click on the partition you wish to resize and select "Extend Volume" or "Shrink Volume."
    • Follow the wizard to specify the amount of space to add or remove.
  4. Formatting a Partition:

    • Right-click on the partition you wish to format and select "Format."
    • Choose the file system (e.g., NTFS, FAT32), allocation unit size, and volume label, then click OK.

Using Command Line Tools:

  1. Diskpart:

    Diskpart is a powerful command-line utility for disk management. Here's how to use it:

    • Open Command Prompt as an administrator.
    • Type diskpart and press Enter to launch the Diskpart tool.
    • Use list disk to display all disks.
    • Use select disk X (replace X with the disk number) to select a disk.
    • Use list partition to display partitions on the selected disk.
    • Use create partition primary size=XXXX to create a new partition of specified size in MB.
    • Use format fs=ntfs quick to format the partition with NTFS file system.
    • Use assign letter=X to assign a drive letter to the partition.
  2. PowerShell:

    PowerShell provides cmdlets for disk management, offering a scriptable way to manage disks:

    • Open PowerShell as an administrator.
    • Use Get-Disk to list all disks.
    • Use Initialize-Disk -Number X to initialize a disk (replace X with the disk number).
    • Use New-Partition -DiskNumber X -UseMaximumSize -AssignDriveLetter to create a new partition.
    • Use Format-Volume -DriveLetter X -FileSystem NTFS -NewFileSystemLabel "NewVolume" to format the partition.

Examples:

  • Creating a Partition using Diskpart:

    diskpart
    list disk
    select disk 1
    create partition primary size=10240
    format fs=ntfs quick
    assign letter=E
  • Creating a Partition using PowerShell:

    Get-Disk
    Initialize-Disk -Number 1
    New-Partition -DiskNumber 1 -UseMaximumSize -AssignDriveLetter
    Format-Volume -DriveLetter E -FileSystem NTFS -NewFileSystemLabel "NewVolume"

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.