Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Windows Server 2008 R2 : Managing Disks and Disk Storage - Understand the Basics (part 2) - Work with Partitions & Use DiskPart

6/25/2011 11:46:14 AM

3. Work with Partitions

After you create your partitions, you can perform a variety of tasks on the drives, including reformatting, deleting, and extending. All of these tasks are done in the Disk Management utility. In addition, you can perform almost all of these tasks by merely right-clicking the volumes.

3.1. Format a Partition

You need to format a partition to prepare the drive for use. When you format the volume, you will lose all your existing data, so make sure you have a backup of the volume if you want to save any of the data on it.

  1. Open Server Manager by selecting Start => Administrative Tools => Server Manager.

  2. In the Server Manager tree, click Storage.

  3. In Storage, click Disk Management.

  4. Right-click the volume you want to format.

  5. Select Format.

  6. Next, you can select how to format the drive. After you make your selection, click Next.

  7. Review the warning about erasing the data on the volume, and click OK.

3.2. Delete a Partition

If you need to repurpose the drive or get rid of an existing partition, you can delete your partitions. Remember, when you delete a volume, you will lose all your existing data, so make sure you have a backup of the volume if you want to save any of the data from it.

  1. Open Server Manager by selecting Start => Administrative Tools => Server Manager.

  2. In the Server Manager tree, click Storage.

  3. In Storage, click Disk Management.

  4. Right-click the volume you want to delete.

  5. Select Delete.

  6. Review the warning about erasing the data on the volume, and click Yes.

3.3. Extend a Partition

You may find you have an existing volume that is not large enough to meet your current needs for data storage on your server. In that case, you can extend the volume with disks that have unallocated space on them. When you extend an existing volume, you create a new spanned volume.

  1. Open Server Manager by selecting Start => Administrative Tools => Server Manager.

  2. In the Server Manager tree, click Storage.

  3. In Storage, click Disk Management.

  4. Right-click the volume in the bottom window of the middle pane you want to extend.

  5. Select Extend Volume.

  6. On the Welcome screen, click Next.

  7. On the Select Disks screen, select the disks you want to use to extend the volume, and click Add to place them in the selected option.

  8. Select the size you want to make the volume. You can select a size for each disk individually. Click Next.

  9. Review the summary screen, and click Finish.

  10. You may see a warning dialog box about the drives needing to be converted to dynamic drives. After you review the warning, click Yes.

3.4. Shrink an Existing Volume

If you have an existing volume you want to shrink, you can reduce the size through the Disk Management utility. After you shrink the volume, any space you removed from the volume will become unallocated space.

  1. Open Server Manager by selecting Start => Administrative Tools => Server Manager.

  2. In the Server Manager tree, click Storage.

  3. In Storage, click Disk Management.

  4. Right-click the volume in the bottom window of the middle pane you want to shrink

  5. Select Shrink Volume.

  6. You can select the size you want to shrink the volume by; you will see a screen similar to Figure 9. This allows you to choose the amount you want to reduce from the volume. You cannot shrink the volume to smaller than the existing data on the volume. After you make your selection, click Shrink.

Figure 9. Shrinking a volume

4. Use DiskPart

You may want to use the command prompt to work with your drive partitions, and in the case of Server Core installation, you will need to use the command prompt to work with your partitions. Windows Server 2008 R2 provides a command-line utility called DiskPart that you can use to work with disks and partitions. To access DiskPart, follow these steps:

  1. To open a command prompt, select Start => All Programs => Accessories => Command Prompt.

  2. At the command prompt, type diskpart, and hit Enter. You will see a screen similar to Figure 10, with the DiskPart utility loaded and waiting for you to enter commands.

Figure 10. DiskPart

After you load DiskPart, you need to use commands to perform tasks such as creating volumes, formatting partitions, extending volumes, and so on. You can also take the commands, combine them in a script, and then use DiskPart to process the commands in the file. For example, typing diskpart /s c:\diskscript.txt will run DiskPart with the commands listed in diskscript.txt.

Table 2 describes some of the common commands used in DiskPart.

Table 2. DiskPart Switches
SwitchDescription
selectThis allows you to select the disk, partition, or volume. Using the select command allows you to access the information about the select object with the detail or list command. Before you can use the detail or list commands, you need to use the select command to set the object you want to work with.
detailThis displays detailed information about the object you have currently selected.
listThis displays existing information about your server's storage; you can list the disk, volume, or partitions.
createThis allows you to create volumes, partitions, or volumes.
formatThis allows you to format the partitions. This command's true power comes from using it in a script.
extendThis allows you to use the command prompt to extend an existing volume.

NOTE

When you are working with disks and using the select command to target disks on your system, it is important to note how the drives are numbered. Drives are numbered beginning with 0. That means the first drive in your system is drive 0. So, if you wanted to use the select command to select the first disk, the command would look as follows:

select disk 0

4.1. DiskPart Script Examples

Here are some examples of basic scripts you can run with DiskPart to help you see how you can utilize this powerful command. You can create simple script files using Notepad. If you have created the script file, you can type diskpart /s <path and name of the script file>.

The following script will select and list the partitions of disk 1 and output detailed information about partition 1:

select disk 1
list partition
select partition 1
detail partition

The following script will convert disk 2 to dynamic, format the disk with NTFS, create a new volume that's 1GB, assign a drive letter of G, and add a label of "New DiskPart Drive":

select disk 2
convert dynamic
create volume simple size=1000 disk=2
assign letter g
select volume g
format FS=NTFS label="New DiskPart Drive" quick

The following script will convert disk 2 and disk 3 to dynamic, create a mirrored volume of 2GB, assign a drive letter of M, format the new mirrored volume with NTFS, and add a label of "New Mirrored Drive":

select disk 2
convert dynamic
select disk 3
convert dynamic
create volume mirror size=2000 disk=2,3
assign letter m
select volume m
format FS=NTFS label="New Mirrored Drive" quick

As you can see, DiskPart is extremely powerful, and it provides a great tool for scripting your disk management tasks.
Other -----------------
- SharePoint 2010 : Securing a SharePoint Farm
- SharePoint 2010 : Introducing SharePoint Security
- SQL Server 2008 : SQL Server Configuration Manager (part 2) - SQL Server Network Configuration
- SQL Server 2008 : SQL Server Configuration Manager (part 2) - SQL Server Network Configuration
- SQL Server 2008 : SQL Server Configuration Manager (part 1) - SQL Server Services
- BizTalk 2009 : WCF LOB Adapter SDK - WCF LOB Adapter Vivisected
- BizTalk 2009 : WCF LOB Adapter SDK - WCF LOB Adapters vs. WCF Services
- BizTalk 2009 : Understanding the WCF LOB Adapter
- SQL Server 2008 High Availability : Database Clustering
- SQL Server 2008 High Availability : Database Mirroring (part 2) - SharePoint and Database Mirroring
 
 
Top 10 video Game
-   Uncharted 4: A Thief's End | E3 2015 Extended Gameplay Trailer
-   V.Next [PC] Kickstarter Trailer
-   Renowned Explorers [PC] Launch Date Trailer
-   The Void (Game Trailer)
-   World of Warships [PC] Open Beta Trailer
-   F1 2015 | Features Trailer
-   Battle Fantasia Revised Edition | Debut Trailer for Steam
-   Victor Vran [PC] Story Trailer
-   Star Wars Battlefront PC Alpha footage
-   Skyforge [PC] Open Beta Gameplay Trailer
-   Armored Warfare [PC] PvE Trailer
-   F1 2015 [PS4/XOne/PC] Features Trailer
-   Act of Aggression [PC] Pre-Order Trailer
-   Sword Coast Legends [PC] Campaign Creation E3 2015 Trailer
-   Sword Coast Legends [PC] Campaign Creation E3 2015 Dungeon Run Trailer
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
programming4us programming4us
PS4 game trailer XBox One game trailer
WiiU game trailer 3ds game trailer
Trailer game
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer