Monday, May 5, 2008

Guide to adding a new partition or drive to an existing system

Suppose you are required to create a 10 GB partition on you running Linux, you have got two options namely.

  • Create a partition from the unpartitioned space on your machine or
  • Add a new drive.
If you are opting for the latter then it is a simple thing of plugging in the new drive, letting the system detect it, using a partitioning tool to create the requisite partition, formating the newly created partition and finally mounting it. But if it is the former namely, creating a partition from unpartitioned space, then the task gets a bit trickier.

Joey Prestia explains the exact steps needed to add a new partition to an existing system. The task can be broken down into the following steps :
  1. Determine what partitions need to be created and where.
  2. Create the partitions (I use 'fdisk' here but any Linux disk partitioning tool should work)
  3. Re-read the partition table either with 'partprobe' or by a reboot
  4. Make a filesystem on the partition, label it, and create the necessary mount points
  5. Add the appropriate entries to '/etc/fstab' so the partitions are mounted upon reboot
Check out Joey's notes to know the exact commands used to accomplish the above task.

No comments: