Change the partition size
gparted from external disk (e.g., Ubuntu Live USB disk) and adjust partition sizes as you want.
gparted has bugs around handling HFS, so it behaves as if it has hung while it is moving a partition that contains HFS. Be patient and let it work. It may take more than 2 hours.
- If Windows won’t boot after this, you have to either reconfigure legacy MBR or rebuild BCD.
gptsync from external disk.
fdisk and mark Windows partition as active.
- This activeness seems not exclusive; i.e. more than one partition can be active at the same time. I’m not sure this causes any problems.
- Boot from Windows installation disk.
- Proceed to advance startup options and launch Command Prompt.
bootrec /RebuildBcd. (you have to type
y once, in most cases)
- Reactivate appropriate partition if necessary.
Restore initial bootloader
- Copy first 446 bytes from another disk; e.g.
sudo dd if=/dev/sdc of=/dev/sda bs=446 count=1