Primary partition and logical partition in linux

What are the differences between primary and logical partition?

What are the major differences? Which is more preferable? Are there any OS specific advantages for one over the other?

5 Answers 5

In the legacy MBR partition scheme, only at most four partitions can be created (they are called «primary» partitions). To bypass this limit, one of the entries is usually made an «extended» partition – instead of files, it contains several «logical» partitions.

In practice, the only difference is that some operating systems (namely Windows) are unable to boot from logical partitions.

A newer partition scheme, GPT, is used on some recent systems, including all Intel Macs – it doesn’t have such small limits, and does not need to use extended/logical partitions.

Note that you don’t need to have 3 primary partitions before you can create an extended partition. or indeed any primary partitions at all.

You can have only 4 primary partitions (3 if you decide to have an extended partition), whereas you can have an arbitrary number of logical partitions. There are no OS-specific advantages other than older versions of Windows must be installed on a primary partition and that the legacy MBR bootloader can only boot from a primary partition.

There are 3 kinds of partitions

And two types of partitioning scheme used now a days

Primary partition, extended partition, and logical partition are much related to MBR disk, because GPT disk only contains primary partition.

On an MBR disk, there can only be 4 primary partitions or 3 primary + 1 extended partition at most.

Читайте также:  Linux vim горячие клавиши

We can install OS and save our data on any of partitions kind (primary/logical), but the only difference is that some operating systems (namely Windows) are unable to boot from logical partitions.

An active partition is based on primary partition. Any one of the 4 primary partitions can be set as active partition. Since there can be 4 primary partitions with 4 different Operating Systems installed, one of the partition that is marked active is used for the initial booting. The active partition contains the boot loader (e.g. ntldr, bootmgr or grub/burg/lilo) to load operating systems from a disk.

BIOS will only recognize the active partition for loading operating system. Other partitions can’t be recognized.

The logical partition can’t be set as active. As here explained.

Источник

Primary or logical partition

I am planning to install Debian and am wondering which partition should be primary and which should be logical. I want to create four partitions:

/boot 300 MB ext2 --> primary or logical? / 30 GB ext4 --> primary or logical? swap 4 GB swap --> primary or logical? /home 100 GB ext4 --> primary or logical? FREE SPACE for a possible other OS 

If I make every partition primary, the partition manager does not allow me to create another partition in FREE SPACE. I guess this is because I can at most make four primary partitions. So should I make one partition primary (which?) and the rest logical, or all logical or.

2 Answers 2

MBR only allows a maximum number of four partitions. Hence you must create at least one extended partition for the logical partitions. In general the extended partition should be placed at the end of the drive.

Читайте также:  Linux отключить графический интерфейс

The real partitioning scheme depends on you. You can create only /boot as primary, or /boot and / (root) as primary, and the rest as logical.

Previous versions of Windows require the system partition to be primary, otherwise it won’t boot. Windows Vista and later versions could be installed to a logical partition without problem, but a primary system partition may still be recommended. So in general creating the first three partitions as primary and the rest as logical is recommended. You may reserve one of the primary ones for Windows and let Linux use the rest.

Lưu Vĩnh Phúc’s answer is basically correct for disks partitioned with the older MBR scheme, although I personally would recommend minimizing the use of primary partitions, since this will give you greater flexibility should you later need primary partitions for some other purpose.

Most new computers, though, use EFI/UEFI firmware, which generally uses the newer GUID Partition Table (GPT) partitioning system. Under GPT, there’s no such thing as primary, extended, or logical partitions; GPT has one partition type (which some tools report as «primary» partitions, although that term is meaningless in the absence of the other types). GPT supports up to 128 partitions by default, although that value can be raised with the right software, if necessary.

If you’re using a computer that was sold in the last two years, you probably have the option of booting it in EFI mode or in the older BIOS (aka CSM or legacy) mode. If you’re dual-booting Linux with Windows, you should be sure to install Linux in the same mode that Windows uses. Computers that ship with Windows 8 almost invariably use EFI-mode booting, so if that’s your situation, you should plan to use EFI-mode booting and GPT. If you’re dual-booting an older computer, it probably uses BIOS-mode booting by default, although you’ll need to check your computer to be sure. If you’re setting up a Linux-only computer, you have your choice. Note also that Linux can use GPT even on a BIOS-based computer, although there are caveats with some BIOSes. Also, Windows requires MBR partitioning when booting in BIOS mode, so if you’re dual-booting with Windows in BIOS mode, you must use MBR.

  • BIOS-mode dual boot with Windows: Use MBR
  • BIOS-mode Linux-only setup: Use MBR or GPT, as you see fit (but MBR is the safer and more traditional choice)
  • EFI-mode Linux-only setup: Use GPT
  • EFI-mode dual boot with Windows: Use GPT
Читайте также:  Kali linux полный гайд

Источник

Оцените статью
Adblock
detector