Converting Logical Drive to Primary Partition?

Some commercial products are able to accomplish this, such as Paragon Partition Manager Pro.

However, if you've just started, this isn't worth the expense : Just reinstall Win7.


There is actually another possibly faster solution that also works if you are for some reason unable or reluctant to erase the data of the previous installation, and want a free solution (as was my case). As long as you're willing to get your hands dirty, this might save your rear as it saved mine.

  1. Create a live cd/usb/hd of any linux distribution (I used gparted live usb with the Damn Small Linux iso, since it also comes with this handy tool).
  2. Boot into the usb drive and run the terminal.
  3. Run "fdisk -u -l" (without quotation marks) to find the start and stop points of all of your partitions.
  4. Copy the whole table exactly as shown (double check to be sure you haven't made any mistakes, this is crucial).
  5. Open 'fdisk -u /dev/sda' (or try hda if that doesn't work) and delete all of your partitions (this keeps your data safe since you're just deleting the record of where the partition is located and not the data contained in the partition. Also, none of the changes you make will be written until you run the w command. If you think you made a mistake, you can run the q command or press CTRL+C to quit the program.
  6. You now create the partitions you need, using the values saved from step 4. In my case, for example, I needed to create only two primary partitions (one of which contained my operating system: Windows Vista; the other only contained files). The information was as follows:

    Device      Start      End         Blocks      Id   System
    /dev/sda2   63         488375999   244187968   f    W95 Extended (LBA)
    /dev/sda5   126        209712509   104856192   7    HPFS/NTFS 
    /dev/sda6   209712573  488375999   139331713   7    HPFS/NTFS
    

    I needed to get the rid of the extended partition wrapper (sda2) and turn the contained logical partitions into primary ones (sda5 and sda6). Thus, the new start and end for sda5 ended up being 126 and 209712509, respectively; and for sda6 ended up being 209712573 and 488375999 respectively. Yes I lost some sectors but so few that they are negligible.

  7. Choose w to write the changes to disk.
  8. Boot into the windows CD and choose the automatic repair tool which should solve the job in a couple of runs (mine took two passes). In case the tool doesn't repair, then you may have made a mistake, in which case you could erase the partitions again and use the previously saved data from step 4 to create them again and leave it as it was in the beginning.

For a different case and some background, check this post.