The design of the hard drive and the formation of the partitions of the file system varies from server to server. It mainly depends upon how much hard disk space is available and which applications would be installed on the server. If the server space is low, which should not be the case with commercial servers having critical applications installed on them, we may choose to have less partitions. For example if we have a server having a hard drive with 1GB space available, we may break it down as follows:

/boot –> 50MB

A small file system space in the first partition ensures 1024-cylinder limit.

/ –> 850MB

A large chunk is allocated to the root directory to compensate the application data.

swap –> 100MB

The swap space is also called virtual memory. If the physical memory(RAM) is full, part of the data in physical memory is shifted to the swap space.

The above partitioning is just an example but in commercial system usually a disk space of hundreds of Giga bytes is available removing hard disk constraints. For a large disk space system, we can have more partitions with bundle of space each. Suppose we have a hard disk space of 100GB available, we can partition it as follows:

/boot –> 100MB

We will have to keep the kernel under 1024-cylinder limit otherwise the BIOS will not be able to access the disk beyond the 1024 cylinder. In the Linux operating system, a user can place the boot loader (LILO or GRUB) either into the MBR or in the root partition. This flexibility can cause a failure at boot time since the BIOS must load the boot loader into memory and start it. Since the BIOS cannot access portions of the disk beyond the 1024th cylinder, the boot loader must be within the 1024th cylinder. If the BIOS cannot read all of the boot loader, the boot fails. This is known as the BIOS 1024 cylinder limit.

swap –> 1GB

If the RAM is low, we may consider to increase it further. The rule of thumb is to keep swap space double as compared to the physical memory.

/ –> 500MB

In the first example, all the application data was to be placed in the root directory but here we will have a separate partition of /home to hold that data. So, root space can be kept low but should not be lower than 500MB.

/usr –> 4GB

The /usr partition contains the user data such as binaries, libraries etc. The programs such as telnet, ftp etc are also kept in this directory.

/var –> 2GB

This partition contains the system logs and other data. Since, now we have created it as a separate partition, it will ensure that system doesn’t get affected by the overflow of the size of log file.

/tmp –> 500MB

Allocating separate space for temporary files ensure system functionality in case the temporary files exceed in size.

/home –> 90GB

This partition contains the application data, so it is the largest of all the partitions. In commercial systems, usually this data is kept in disk arrays to ensure its safety.

Adnan Khurshid

Adnan Khurshid, the author of this article, has been working in a telecommunication sector since 2007. He has worked there as a VAS (Value Added Services) engineer and has excelled remarkably in the field. Working in this field has been his passion and he has always made efforts to keep himself up to date. Find more about him on LinkedIn

More Posts

Tags: ,

2 Comments on How to design a hard drive layout (partitioning) on Linux servers

  1. cheap deals to new york says:

    Hi there, I found your blog via Google while looking for a related topic, your web site came up, it looks great.I’ve bookmarked it in my google bookmarks

  2. AlfredChatterton says:

    Excellent site you have got here.. It’s difficult to find high-quality writing like yours these days. I seriously appreciate people like you! Take care!!

Leave a Reply