******************************************************************************
*** The PARTNEW Command Syntax ***
******************************************************************************
Besides the mappings in the above section, you may instead choose to create a
new primary partition with the PARTNEW command. PARTNEW can generate a primary
partition entry (in the partition table) for a logical partition.
For example,
partnew (hd0,3) 0x07 (hd0,4)+1
where the file (hd0,4)+1 stands for the whole partition (hd0,4). This command
will create a new primary partition (hd0,3) whose type is 0x07 and whose
contents/data is the same as that of the logical partition (hd0,4).
Just like a whole logical partition, a contiguous partition image file can
also be used with PARTNEW:
partnew (hd0,3) 0x00 (hd0,0)/my_partition.img
The type 0x00 indicates a type-auto-detection of the image MY_PARTITION.IMG.
The above command will create a new primary partition (hd0,3) with a proper
type and with contents/data being exactly that of the contiguous file
(hd0,0)/my_partition.img.
PARTNEW will automatically correct the "hidden sectors" in the BPB and the
modification will be permanent. And PARTNEW modifies the partition table
permanently.
In addition to creating new partition entries, PARTNEW can also be used to
delete(erase, or wipe) a primary partition entry. For example,
partnew (hd0,3) 0 0 0
which will empty the last entry in the partition table in MBR. Generally,
you should use the form of "partnew PARTITION 0 0 0" to erase the entry.
Note that only the entry would be erased, and the data stored in the partition
will not be touched.