Windows 2003 partition magician: Diskpart

Source: Internet
Author: User
Tags exit extend file system new set safe mode

As you may know, under Windows Server 2003, the normal version of the partition magician is not running, and Windows built-in command-line tool DiskPart is capable of doing most of the partition magician's work, and it is very powerful. When you enter DiskPart, you will see a private prompt, diskpart> (Note: This is not a path), as shown in the picture, where you can enter a number of related and also child commands that are specific to it. In this carefully designed case, you can see how DiskPart is expanding the partitions without destroying the data, which undoubtedly provides us with a whole new set of ways to manage our partitions.

Step one: Open the DiskPart integrated environment

Boot to Safe Mode with command prompt, enter DiskPart.

Next, enter the list disk to display the installed hard drive, as you can see from the figure, only one hard drive, shown as Disk 0 (if two hard drives are installed, the 2nd hard disk will appear as Disk 1). Enter "Select Disk 0" to select the hard drive (or set the Focus property for the hard drive). Then enter the list partition display partition, which obviously has two primary partitions, two extended partitions.

Step two: Delete Partition 3

Enter select partition 3 to have the focus attribute on the partition 3 (5004MB), and then enter the delete partition to delete the partition. Compare the values after the 1th, 22 list partition commands in the figure, and it is easy to see that the original partition 3 has been deleted.

Tip: After you enter select Partition 3, if you enter the list Partition command, you can see a * number before the partition 3. Any hard disk or partition with focus attributes has a * number before it can make the user glance at the current action object.

Step Three: Partition expansion

Enter select partition 1 to have the focus property, and then enter extend, and the last allocation space vacated by the deletion of the partition is automatically added to the 1th partition. If you enter list partition to see the capacity changes of partition 1, compare the values of the 1th and 32 list partition commands in Figure 1 to see this.

Note: When you extend a partition with focus to the nearest unallocated space, for normal partitions, unallocated space must be on the same disk and must be adjacent to the partition with focus.

If the partition to be expanded is formatted as NTFS, no data is lost when it is enlarged, and if the file system is not NTFS, the command fails, but no changes are made to the partition and data is not corrupted.

DiskPart cannot extend the current boot partition or the partition that contains the paging file. As you can see from the diagram, there are two primary partitions in My computer, and partition 5 is the active partition. Otherwise, you cannot enlarge the partition 1.

Syntax for the Extend command:

Extend [size=n]

Parameter Description: Size=n represents the amount of space (in megabytes) that is added to the current partition, and if no size is specified, the disk expands to occupy all of the nearest contiguous unallocated space.

Regardless of the changes made to the hard disk partition, this includes creating, deleting, expanding, and so on, without having to restart the computer to take effect (this is not what the Zone Magician can do), but in "My Computer" (DiskPart is working in a command prompt window, you can open My computer from the desktop at the same time) You can't see these partitions, but why, you don't have the drive letter (that is, the letter) specified for it, the first partition specifies the letter as an example.

The 1th partition has the Focus property first, and then the command Assign,diskpart is automatically assigned a letter. Of course, you can use the command assign letter=x to manually specify that when you specify it manually, it cannot be the same as the existing letter. After this process, you can look up these partitions in my computer.

Step four: Set the partition 1 as the active partition

First Use Select Parttition 1 to have the Focus property and then enter the command active. Finally enter exit, exit DiskPart integrated environment, let the computer automatically restart. Note, however, that in the "My Computer", partition 1 must have a full operating system, or the computer will not start properly. ---http://www.bianceng.cn

If used DiskPart, you will feel that its design is in line with people's thinking habits, is generally the first to specify focus, and then to operate, in the course of operation can also display the status of the partition at any time to master progress. Input help to see all of the subcommand, when you enter a fault, it will also automatically lists the list of child commands and a brief description to guide you to the straight. In addition, after installing Windows 2003, the most familiar partition magician (not server version) is not functioning properly, using DiskPart is a good choice.

As mentioned earlier, the focus must be specified before any operation under DiskPart, that is, to indicate which object is to be manipulated, which makes the operational logic clear, but on the other hand, if the focus is accidentally executed with a destructive command, such as deleting a partition, it can cause irreparable damage. Therefore, always use the list command to view the status of each partition. The focus partition has an asterisk (*) flag before it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.