logical partition to a primary one
How do I convert a logical (extended) partitition to a primary one, without loosing all my data ?
I not to get Windows running again. fdisk -l DEVICE BOOT Id System /dev/hd1 * f Win95 Ext'd (LBA) /dev/hd2 82 Linux Swap /dev/hd3 83 Linux /dev/hd5 7 HPFS/NTFS /dev/hd6 7 HPFS/NTFS /dev/hd7 7 HPFS/NTFS |
Are you wanting the disk space back for Windows? If so, you will lose all information on the Linux partitions.
# How do I uninstall Linux completely and keep/use Windows only? How to Remove Linux and Install Windows 2000 How to Remove Linux and Install Windows XP You can remove lilo from the mbr with /sbin/lilo -u You can remove grub or lilo from the mbr by booting with a Windows 98 boot floppy (at the prompt, type fdisk /mbr), or by using the Windows XP Recovery Console or the Windows 2000 Recovery Console |
fancypiper: the trouble is that britcoms9 has windows installed on a logical partition and hence cannot boot it (I'm curious as to how windows got to be on a logical partition in the first place, but that's another story). What he needs, if possible, is to convert a logical partition to a primary one.
|
I don't know of any way to do that. I would think that would be impossible as the logical partitions are part of the extended partition.
Back up your important data, zero out the drive and re-partition and re-install is the only way I am aware of. Someone didn't follow the standard advise of putting windows on the first primary partition of a drive. :( # Partitioning Linux Partition HOWTO Rute - Partitions, File Systems, Formatting, Mounting |
Quote:
One can use parted or its GUIs (qtparted or gparted) to resize, shrink, and move partitions. Unfortunately, unlike Partition Magic, neither qtparted nor gparted off the option to convert a partition. Also, at this time parted can't change the start point of some partitions (reiserfs, ntfs, etc.) As an example, here's the problem I had: (it's important to use the -u option as sectors are far more accurate than cylinders.) Code:
sudo fdisk -l -u /dev/sda To do this, I first have to either shrink sda2 slightly or shrink and move the start point of sda3 slightly. One needs to do this as the start point of the extended partition cannot be the same as the start point of a logical partition inside. While no information is written at the start of an extended partition, we still need a small buffer. I chose to shrink sda3 by 10MB and move the start point. This resulted in the following: Code:
Device Boot Start End Blocks Id System I'll now open up fdisk (fdisk -u /dev/sda) and delete all partitions 2 through 6. This is safe because I'm only deleting the record of where the partition is located and not the data contained in the partition. As long as I use the exact same start and stop points when I create new partitions, all the data will still be there. Here's my new partition map: Code:
Device Boot Start End Blocks Id System REMEMBER: when using fdisk, no changes are made until you issue the w command to write the changes. If you think you made a mistake, press Ctrl+C or use q to quit without saving the changes. When creating logical partition 5 (what used to be called sda3). You'll notice there's now some space between the the start of the Extended partition and the first logical partition (what used to be /dev/sda3). There's also some space between the new sda5 and sda6 (which used to be sda5) that was previously taken up by the extended partition. We can recover this space later by running gparted again. After resizing and moving what's now sda5 (and was origionally sda3) in gparted, I was left with: Code:
Device Boot Start End Blocks Id System For your problem, you would have wanted to do something similar. You have an extended partition that fills the entire drive. What you need is for the extended partition to stop at the end of partition partition 3 so that your 3 NTFS partitions are primary instead of logical. Use fdisk -u -l to find the start and stop points of all of your partitions. Open 'fdisk -u /dev/hda' and delete all of your partitions. Now, create an extended partition that starts where the old hda1 did, but ends where the old hd3 did. Now create locical partitions with for hd2 and hd3 with the same start and end points as before. Finally, create primary partitions for hda5, hda6, and hda7 using the same start and stop as you previously had. Try mounting your new partitions. If it doesn't work, simply open 'fdisk -u' again, delete all of your partitions, and recreate them exactly as 'fdisk -u -l' showed you earlier. This will at least restore you to where you were at the start. Remember to always have a printout of 'fdisk -l -u' save somewhere before you start messing with partitions. |
All times are GMT -5. The time now is 06:47 AM. |