Hack #46. Create or Delete NTFS Partitions from the Recovery Console
Create and delete NTFS partitions using the DISKPART from the Recovery Console.
Windows versions from NT to Windows Server 2003 know nothing about FDISK but provide their own partitioning tool, DISKPART, which is run from the Windows Recovery Console. DISKPART is a command-line utility used to add/create or delete NTFS partitions with some very simple commands.
Boot using your recovery diskettes or setup CD and select the Recovery Console option. Alternatively, you can boot with a DOS diskette that provides CD-ROM support and type:
\i386\winnt32.exe /cmdconsAt the command prompt, issue the DISKPART command followed by the appropriate command.
The following command lines delete a partition:
diskpart /delete \Device\HardDisk0\Partition3diskpart /delete F:The following command line adds a 2,048 MB partition:
diskpart /add \Device\HardDisk0 2048Type
exitto leave the Recovery Console and restart the system.
The command line for DISKPART supports only the /add and /delete commands:
/addAdds a new partition. Supports the optional parameter
size, which specifies the partition size in megabytes./delete device_name | drive_name | partitionDeletes a partition.
device_namespecifies the device on which to create or delete a partition. Use theMAPcommand from the Recovery Console command line to get a list of device names (for example,\Device\HardDisk0).drive_namespecifies the partition you want to delete by drive letter ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access