Partitioning Windows and Linux Servers
Posted by Nick Fredrich on 30 December 2014 03:16 AM
To partition a hard disk drive (HDD) is to divide a single physical disk into multiple logical storage units so that a different file system can be implemented in each partition. Though there are different kinds available, the two partition schemes usually used in x86-compatible systems are the Master Boot Record (MBR) and GUID Partition Table (GPT).
The MBR is the most widely used partitioning scheme in x86 machines. Current computing needs however are finding it limiting as its maximum addressable storage space in a disk is only 2TB. The GPT scheme is in the process of superseding MBR in newer computers. We are seeing this transition as GPT co-exists with MBR to provide some backward compatibility to older systems.
When GPT is implemented in a machine together with MBR, the HDD must be initialized using the GPT scheme if its capacity is over 2TB; if capacity is lower, either MBR or GPT can be used.
Note: Windows systems cannot boot from GPT partitions if the system is being booted with legacy BIOS code. Only EFI systems can be booted from GPT partitions.
Another limitation of the MBR scheme is the number of partitions that you can create in it. In MBR, you can choose to create either of the two options: option 1 - four (4) primary partitions, option 2 - three (3) primary partitions and one (1) extended partition with MBR table in a single drive, which can be further divided into logical partitions. In comparison, the GPT scheme by default has a table with 128 entries for partitions. This table can then be extended further as needed.
Remember to align all partitions based on physical drive block size to get the best performance out of your disk drive. The starting address of a partition should be divided by physical block size without a remainder. Most HDDs have a physical block size of 4KB while solid-state drives (SSD) usually have 128KB (some Samsung devices are even known to have 1.5MB block sizes). This means that your first partition should usually start at 1MB address for SSD (1x1024x1024, divides without a remainder on 4KB, 128KB, 256KB, and 512KB drives) and 4KB address for HDD (4x1024). You can also opt to select a higher appropriate value—6MB, for example, is probably the safest variant for Samsung SSDs.
We recommend using at least three (3) partitions for servers running Windows:
It is also a good practice to have a recovery partition of at least 2GB size, giving room for the inclusion of the Windows recovery image (install.wim) and enough free space that can let it be captured by backup utilities.
Do monitor the RAM/disk space consumed thus far, especially if you have a swap file (system pagefile) on a drive C: (usually stored there by default) with an undefined size. You could either move this system file to drive D: or put a hard limit to its size by doing the following steps:
Linux supports various types of partition schemes—from plain file system partition schemes to ones that are especially designed for Linux like software RAID and Logical Volume Management (LVM).
LVM is more flexible than usual partition schemes because of the following reasons:
Note that Red Hat Enterprise Linux (RHEL) and CentOS prior to version 7 cannot use GPT partitioning for system boot drives because the default bootloader (Grub legacy) does not support GPT.
We recommend two (2) partitions for servers running Linux:
You can skip creating separate partitions for /var and /home, but you need to create a file system for your root partition with a certain percentage of space reserved only for the root user (ext4 is created with 5% file system space by default; -m option for mkfs).
You can create partitions when installing the system for the first time. You can also do manual partitioning via consoles and GUI utilities like fdisk, cfdisk, parted, gparted, and gdisk.