Categories
 
Editorials
   
IT Articles
   
   
     
     
   
Management Articles
   
     
     
   
Spirituality
   
   
General Articles
     
Career Articles
     
Biography
   
Book Review
   
Health
     
 
Partitioning Hard-drive for Linux Installation
     
   

Mr. Jitendra Nasriwala
Lecturer

 

What is Partition?
A partition is a contiguous set of blocks on a drive that are treated as an independent disk. Using partition a single hard drive can be divided into many logical drives.

Why Partition?
There are number of reason to have multiple partitions on hard drive few of them are as below:
  • To achieve higher security of data in case of failure (either through system failure, power failure or user error) probably you would loose data on single partition not in all; this is most important reason for partitioning.
  • Data can be grouped and separated so that it can be managed. It increases disk space efficiency.
  • Reduce time require to perform file system check at the time of boot-up as well as manually by fsck command (i.e. if I know my /usr partition had problems then I can fix it by first unmount it from the file system, then perform file system check and after repairing again mount it to the file system. No need to boot system in maintenance mode).
  • You can also mount file system as read-only so that data on that partition cannot be changed by anyone, even not by root.
  • This can be useful for higher security of data.
  • You can also limit the growth of data on varying partition. So that system hang-up can be avoided.
  •  

    Partitioning Hard Drive
    Installing Linux on single partition or one root partition including data partition and a swap partition, still it is possible to get perfectly functioning system. But multiple partitioning would advantage more; you would like to install Linux with multiple partitions. Let us see mount points and file system information, which gives better idea of how to define partitions and it’s size for your own needs:

    /boot
    This is where your kernel images stored. This partition would allow booting and then loading of whatever drivers are required to read the other file systems. The size of this partition can be as small as a couple of MB; the partition type should be Linux native.

    / (root)
    The root file system is represented by /. It is the top of the directory tree, and contains Linux and everything that you install with Linux. It store things like temporary files, the Linux kernel and boot image, important binary files (things that are needed before Linux can mount the /usr partition). You must create a partition for the root directory. Type of file system for / partition is Linux native.

    The size of your root partition will vary depending on what you install or plan to install. Check your distribution's documentation, and reserve enough space for a maximum installation, plus space for temporary data and installation of new software. If you plan to try out lots of software, leave more space.

    /home
    This is the place where all the user-specific files, in other words your data, are stored. On a multi-user system, user’s directory stored under /home. Partition type should be Linux native.

    It is not necessary to create a separate partition for /home. If you do not create it, it will reside on the root partition like everything else. Advantage of creating a separate /home partition is that if system requires reinstalling Operating system, or you'll just want to reinstall with different options, or try a different Linux distribution, having /home on a separate partition makes it very easy to wipe out and reinstall Linux without losing any of user's data.

    swap
    You need one partition that will be used as Linux swap space. This is space on your hard drive that can be used as virtual memory. Virtual memory allows your computer to run large programs and perform complex tasks even if it does not have enough physical RAM to do the job. More than one swap partition can exist on a drive. If you have more than one physical hard drive in your system, you can create multiple swap partitions. This can improve the performance of swapping by taking advantage of parallel disk access. Type of this partition must be Linux swap.
    Now, you may have question that what will be the size of swap partition? If you are beginner then choose size of swap is double the amount of physical RAM installed in your system. If your system is high graphics system or multi user system with lot’s of users and process or it is processing multimedia then it is recommended that you should go with more size may be in 2 GB or more.

    /usr
    This should be the largest partition, because most of the binary files required by Linux, as well as any locally installed software, web pages, Squid proxy cache, Samba share services, some locally-installed software log files, etc. are stored here.
    If this partition is created with more space than, it is not required to give more space to /(root) partition. The partition type should be left as the default of 83 (Linux native).

    /var
    This file system contains spool directories such as those for mail and printing. In addition, it contains the error log directory. If your machine is a server and develops a chronic error, those messages can fill the partition. Server computers ought to have /var in a different partition than /.
    Size of this partition is depending on server requirement.

    /tmp
    Some programs write temporary data files here. Usually, they are quite small. However, if you run computationally intensive jobs, like science or engineering applications, hundreds of megabytes could be require for time to time. In this case, keep /tmp in a different partition than /.
    So now you are ready to install Linux in your system. Choose partition according to your needs. If you still having any doubts then I prefer that partition your hard drive into main four partition /(root), /usr, /home and swap.