Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Fedora 18 system installed on my hard disk, but upon installation I created 4 partitions for boot, swap, root and home, and now I want to install Windows on some unallocated space (I need it, don't judge me :D) but I'm limited to 4 primary partitions. Is there anyway I can change one of them do logical, or something else to empty one partition?

I can free up to 300 GB, which can hold all 4 partitions easily, in the extended partition that holds only home, if it is possible moving.

fdisk -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000668e4

Device    Boot      Start     End       Blocks   Id  System
/dev/sda1 *         133120    1026047   446464    83 Linux
/dev/sda2           1157120   8202239   3522560   82 Linux swap / Solaris
/dev/sda3           8333312   113059839 52363264  83 Linux
/dev/sda4           113190912 894853119 390831104 5  Estendida
/dev/sda5           113324032 894722047 390699008 83 Linux

Of course, without excluding existing partitions/files.

share|improve this question
/home is on an extended partition? If so you can create new partitions within it. The 4 partition limit only applies to primary partitions. Could you post the output of fdisk -l /dev/sda? – terdon May 16 '13 at 9:31
@terdon updated – ranisalt May 17 '13 at 15:08
up vote 1 down vote accepted

Yes, it's possible. My FixParts program will do the job, with some caveats. Most notably, you need at least one unallocated sector immediately preceding each to-be-logical partition. If such a gap doesn't exist, you can shrink the preceding partition by a small amount using GParted before using FixParts. Some Windows tools can also do the job, but I don't know offhand if any of them can handle Linux partitions.

Another option, if you're using a recent computer that supports EFI, is to convert the disk from MBR to GPT form, install Windows in EFI mode, and convert Linux to boot in EFI mode. This is likely to take more effort than the first approach, though. If you care to try it, gdisk can do the MBR-to-GPT conversion.

share|improve this answer
So I'm doing it, I'm creating 64MB between every partition: 64MB | /boot | 64MB | swap | 64MB | / | 64MB | extended { 64MB | /home | 64MB } | (and here is some 30 GB I left for Windows). What do I do after? – ranisalt May 17 '13 at 6:00
64MiB is way more free space than you need. You just need one sector (512 bytes), although most partitioning tools won't give you an option that small. In any event, after creating the free space you need to run FixParts. Its documentation describes the details, particularly in the "Adjusting Your Partitions" section. – Rod Smith May 18 '13 at 15:23
Your FixParts was very helpful, although I preferred to format everything and prevent further problems. Now, Fedora automatically partitioned itself in /boot and one extended partition with /swap, / and /home. – ranisalt May 29 '13 at 23:45

Actually you're fine. Based on the fdisk data you posted, sda4 is an extended partition that contains just one logical partition (sda5). You should be able to shrink sda5 and create an arbitrary number of new logical partitions next to it.

I recommend booting into a GParted Live session and using gparted to shrink sda5 and create your new partitions in the unocuppied space.

share|improve this answer
I actually want to have more PRIMARY, not logical, because Windows requires me one more and I'm limited to 4 only. But I can't change swap to logical because root (sda3) could not be primary then. I want to move it to the end of the disk, is it possible? Like, to have Boot, Root, the extended with Home, Swap and then Windows? – ranisalt May 17 '13 at 21:50
@ranisalt are you sure Windows requires primary partitions? WinXP and earlier used to need to be installed in the first primary partition. I believe that changed with 7 and is certainly no longer the case for 8. You should be able to just create a new logical partition and install windows there. See, for example, here or here. – terdon May 19 '13 at 14:06
I wasn't able to install Windows out of a primary partition, I don't actually know how. I opted to format and reinstall everything as it would create less problems. – ranisalt May 29 '13 at 23:50

Personal experience tells me, "No". I suggest backing up all data you do not want to lose and start over -- this time installing that other OS on a single primary partition the size desired first. Then create a 15-20GB primary for / , a swap, and an extended partition of the rest of the drive you want to use for any other mount points desired.

share|improve this answer
Well, I don't worry if I lose some data, I prefer not to have to reinstall everything again, it would take much more time than to recover data. It's more a spare computer. – ranisalt May 17 '13 at 2:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .