Is it safe to format/delete the Windows XP (D:) primary partition, in
which the Windows Boot manager is defined?
Yes, however you computer will be in an unbootable state after you format the partition. You will need to recreate the Windows 7 boot files yourself.
To do this, after you format the XP partition as NTFS, do these commands from Windows 7.
First, just to be safe, put a valid MBR and PBR in place:
bootsect /nt60 D: /force /mbr
bootsect /nt60 D: /force
Now, you need the boot files to be properly located on the partition XP used to be on (which is your boot partition).
md D:\boot
robocopy C:\Windows\boot\PCAT\ D:\boot\ /MIR
Finally, we need a BCD for windows to boot properly.
bcdedit /createstore D:\boot\BCD
bcdedit /import D:\boot\BCD
bcdedit /create {bootmgr}
bcdedit /set {bootmgr} device boot
bcdedit /timeout 7
bcdedit /create /d "Windows 7" /application osloader
At this point you should have a long GUID number returned. (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
You'll want to use that number in the place of GUID
bcdedit /default {*GUID*}
bcdedit /set {default} device partition=d:
bcdedit /set {default} osdevice partition=c:
bcdedit /set {default} path \Windows\System32\winload.exe
bcdedit /set {default} systemroot \Windows
bcdedit /set {default} detecthal yes
bcdedot /displayorder {default} addlast
Ideally however you should create a dedicated boot partition like windows does by default. This way you don't have to worry about this sort of thing.
Delete the XP partition, and create a ~100MB primary NTFS partition, then a second primary partition. Treat that 100MB partition as the XP partition when following steps above.
is it possible to format/delete the Windows XP (D:) primary partition?
if yes, how?
These commands will format it. You may need to boot from a Windows recovery/installation media (usb/cdrom) to perform them though if Windows complains about it being the only primary or the only boot partition.
(Please note, the commands below are specific to this question only. If you are reading this looking for help, and are NOT the original poster, please carefully determine the proper disk numbers and partition numbers to apply to your specific disk configuration)
To format:
diskpart
select disk 0
select par 1
format fs=ntfs quick
act
To delete, then create, format, and assign a drive letter.
diskpart
select disk 0
select par 1
delete
create par pri
act
format fs=ntfs quick
assign letter=d