Choosing partition types for swap and root and choosing device for bootloader installation

I am trying to install Ubuntu 12.04 via manual partitioning because I want to remove an existing Windows 7 operating system but keep all my other partitions with their contents intact. My questions are:

  1. What Partition Types should I choose for the swap area and the root? (Mind you, I am not asking about File System.) One excellent answer on manual partitioning advises Primary for swap and Logical for root, but I want to recheck because there seem to be divergent tips on this in the various discussions I have been able to check.

  2. For "Device for bootloader installation" should I choose the entire HDD (which is given as the default choice) or the particular partition where Ubuntu is to be installed?


Solution 1:

For root and swap you can choose logical or primary your choice but remember you can only have 4 primary partitions on the hard disk after that no more partitions(logical or primary) will be created(i mean you cannot create partitions after that). If you want to create partitions you should convert one primary to extended(or logical) partition and split that into several partitions.

so if you are out of primary partitions then its recommended to install both in logical, if not you can install them on primary partitions(if you don't have any use of primary partitions in future like installing windows again)

I hope that helps

Solution 2:

First, why Ubuntu 12.04? Version 14.04 is available now, and includes a number of improvements.

Second, the answer to your question depends greatly on your boot mode, which you haven't specified. You can identify your Windows boot mode by examining the partition table type -- if your boot disk uses the Master Boot Record (MBR), your computer is booting in BIOS mode; but if it uses the GUID Partition Table (GPT), it's booting in EFI mode. See here for more on identifying your boot mode. Once you've identified the boot mode, your question can be answered:

BIOS-mode Booting

Most PCs sold prior to Windows 8's release booted in BIOS mode, but some Windows 7 PCs sold after mid-2011 used EFI mode by default, and even a few older computers can be configured to use EFI.

If you're booting in BIOS mode, you'll be limited by MBR's restrictions, which begin with a 4-primary-partition limit. This limit can be gotten around by creating a special type of primary partition, known as an extended partition, which serves as a placeholder for an arbitrary number of logical partitions. Linux doesn't care much about the distinction between primary and logical partitions; you can use either type as you see fit, within the MBR's limits. Those limits become important because many PCs shipped originally with four primary partitions, making it impossible to create new partitions, even after resizing an existing partition. If you run into this problem, you must either delete a partition that's of little value (typically one holding manufacturer-specific tools) or convert one from primary to logical form. The latter task can be done with my FixParts program, which is part of the gdisk package in Ubuntu. Don't convert the Windows boot partition from primary to logical, though; that will render it unbootable!

Another meaning of "partition type" is a type code, which for MBR is a 1-byte (0-255, or 0x00-0xFF hexadecimal) value that identifies the intended use of a partition. The Ubuntu installer will set the type code appropriately if you create a partition using the Ubuntu installer. If you use some other tool, give the Linux swap space a type code of 0x82 and all Ubuntu system and data partitions a type code of 0x83. There are other type codes for uses like Linux LVM (0x8E), NTFS (0x07), etc.

Note also that you should NEVER use the standard Windows partitioning tools to create partitions. These tools will convert the disk from MBR to Microsoft's proprietary Logical Device Manager (LDM) format if you create a layout with more than four partitions. You can't install Ubuntu directly to an LDM disk, so if you make this mistake, you'll have to convert back with the help of third-party tools.

EFI-mode booting

If you're booting in EFI mode, you'll use GPT, which supports up to 128 partitions by default (and this value can be raised, if necessary). GPT doesn't distinguish between primary, extended, and logical partitions, although some partitioning tools still prompt for primary vs. logical status when you create partitions on GPT disk. (These tools then ignore what you say, since it's meaningless.)

GPT also supports partition type codes, but instead of a single byte, GPT uses a 16-byte Globally Unique Identifier (GUID), which is awkward to display or enter. Thus, partitioning tools generally set the GUID automatically based on your stated use for the partition or use some sort of code. Tools based on libparted (including parted, GParted, and the Ubuntu installer) do the former, so you shouldn't have to explicitly set a type code. If you use GPT fdisk (gdisk, sgdisk, or cgdisk), you'd set a type code of 8200 for Linux swap, 8300 for a Linux filesystem, 8E00 for Linux LVM, 0700 for NTFS, and so on.