IT tutorials
 
Windows
 

Windows 8 : Managing disks and storage (part 5) - Using Microsoft Drive Optimizer to organize data - The DiskPart utility

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
10/10/2014 9:12:49 PM

The DiskPart utility

This section looks at the DiskPart utility in more detail, explaining the options available with DiskPart and how it might be used when performing maintenance on or troubleshooting a computer. The DiskPart utility and commands are designed to work directly with disks, volumes, and partitions.

When you launch DiskPart from a command line, you are prompted to allow or deny its use by User Account Control. Because DiskPart can make potentially harmful changes to your system, you are prompted to verify that it should be allowed to run. A new command prompt window opens that is running DiskPart.exe. When DiskPart is loaded, your cursor follows the DISKPART> prompt, which is shown in Figure 8.

The DiskPart prompt

Figure 8. The DiskPart prompt

From this prompt, your command-line session can execute any of the DiskPart options and commands. Many commands, DIR for example, will produce different results within DiskPart than might appear when executing the command outside DiskPart. DIR returns a list of the commands available within the DISKPART prompt. This is shown in Figure 9.

Executing DIR within the DiskPart prompt

Figure 9. Executing DIR within the DiskPart prompt

Using DiskPart to manage and review existing items on your Windows 8–based computer can be a great starting point for adding or removing volumes and other potentially dangerous maneuvers.

Note

GETTING HELP FOR COMMANDS

When working with DiskPart, help is available for all the commands by typing help before a command. For example, typing Help Add displays help items related to the Add command.

  • Active Marks the selected partition as active

  • Add Adds a mirror to a simple volume

  • Assign Assigns a drive letter or mount point to the selected volume

  • Attach Attaches a virtual disk file

  • Attributes Manipulates the attributes of a disk or volume

  • Automount Enables or disables automatic mount for basic volumes

  • Break Breaks a mirror set

  • Clean Removes the configuration data or all data from a disk or volume

  • Compact Reduces the physical size of a file

  • Convert Converts a basic disk or volume to a dynamic disk or volume

  • Create Creates a partition, virtual disk, or volume

  • Delete Removes a partition, virtual disk, or volume

  • Detail Provides object details

  • Detach Disconnects a virtual disk file

  • Exit Quits DiskPart

  • Extend Extends a volume

  • Expand Expands a virtual disk file’s maximum size

  • Filesystems Displays current and supported file systems on the selected volume

  • Format Formats the selected disk, partition, or volume

  • GPT Assigns attributes to the selected GPT partition

  • Help Displays help for a DiskPart command or a list of all commands

  • Import Imports a disk group

  • Inactive Sets the selected object to inactive

  • List Displays a list of objects

  • Merge Merges a child disk with its parent

  • Online Sets an offline object online

  • Offline Sets an online object offline

  • Recover Refreshes the state of all disks in a pack, attempts recovery on invalid disks, and resynchronizes mirrored and RAID-5 volumes

  • Rem Enables comment lines in scripts; takes no action on the command line

  • Remove Removes a drive letter or mount point

  • Repair Repairs a RAID-5 volume with a failed disk

  • Rescan Rescans the computer for new or changed disks or volumes

  • Retain Places a retained partition under a single volume

  • SAN Displays or sets the SAN policy for the currently started operating system

  • Select Shifts the context or focus of DiskPart to a disk, partition, volume, or other object

  • SetID Changes the partition type

  • Shrink Decreases the size of the selected volume

  • UniqueID Displays or sets the GUID Partition Table identifier or Master Boot Record signature of a disk

DiskPart performs a number of the same functions as the Disk Management console, providing a command-line alternative to the GUI. In addition to running operations directly at the command line, you can script DiskPart actions to automate the process of managing disks, volumes, and partitions.

Similar to the earlier example of extending the size of a volume with computer management, you can use DiskPart to shrink volumes where space might no longer be needed. For example, you added 250 MB to the documents volume earlier in this lesson. Now, you no longer need the additional space; perhaps a large number of files are no longer needed in your testing. By using DiskPart, you can reclaim this space. To do so, complete the following steps:

  1. Open the Start screen.

  2. Search for DiskPart.

  3. Press Enter or tap or click the result returned to launch the utility.

  4. Allow DiskPart when prompted for UAC by tapping or clicking Yes.

  5. List the volumes available within the computer by typing list volume on the command line and pressing Enter.

  6. From the list of volumes, select the volume to shrink by typing select volume # on the command line, where # is the number of the volume returned in the previous step. Press Enter.

  7. Shrink the volume by 250 MB by typing Shrink desired=250 on the command line and tapping or clicking Enter.

  8. Type Exit on the command line and press Enter to close DiskPart.

Important

DISKPART MAKES CHANGES IMMEDIATELY

Shrinking volumes or partitions by using DiskPart happens almost immediately. Typing Shrink by itself on the command line will reduce the selected volume to the smallest available size.

Even though the DiskPart command-line tool can be scripted, it still requires you to work with one object at a time. When one operation completes, the script can move on to the next object. The following is an example of a script using DiskPart:

Select volume  1
Clean
Create partition primary size=300
Exit

This script selects volume 1 and cleans it, which removes all partitions and data from the disk. Then the script creates a 300-MB primary partition on volume 1.

To execute a script in DiskPart, type the following command:

diskpart -s <scriptfile>
 
Others
 
- Windows 8 : Managing disks and storage (part 4) - Using Microsoft Drive Optimizer to organize data - Check Disk (chkdsk)
- Windows 8 : Managing disks and storage (part 3) - Using Microsoft Drive Optimizer to organize data
- Windows 8 : Managing disks and storage (part 2) - Disk Defragmenter and Disk Cleanup
- Windows 8 : Managing disks and storage (part 1) - Using disk management
- Windows 8 : Sharing printers - Configuring shared printers, Configuring printing permissions
- Windows 8 : Sharing files and folders (part 6) - Understanding NTFS permissions - Identifying permissions, Taking ownership of a resource
- Windows 8 : Sharing files and folders (part 5) - Understanding NTFS permissions - Creating advanced security settings
- Windows 8 : Sharing files and folders (part 4) - Understanding NTFS permissions - Modifying file or folder permissions
- Windows 8 : Sharing files and folders (part 3) - Sharing a folder
- Windows 8 : Sharing files and folders (part 2) - Enabling folder sharing using the Windows 8 interface, Enabling folder sharing using the traditional interface
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us