Article overview

Help article

How do I create a new partition in Ubuntu/Debian/Gentoo Linux?

Before you can utilize new disk space a new partition needs to be created. In this FAQ we will present a six step explanation to guide you through the process of creating a partition for your BladeVPS. Note: If not mentioned, a command is always followed by an enter.

1.First make sure that you are logged in as root, if your are not then use the command "su -". To create a partition, login as root on your VPS. Use the following command to initiate the creation of a partition "fdisk /dev/vda". Give the command "p". You will now see your current partitions. Partitions 1, 2, 3 and 4 are your primary partitions. Pick a number from the primary partitions that is not shown in the table (most of the times it is 3 or 4). Write it down or memorize it, you will need it for the following steps. Press "n" to continue with the process.

2. Now press "p". You must specify the partition number. Choose a partition number that is not yet taken. You will know which partitions these are from the previous step. Please document or memorize the partition number, you will need it later on. If you are asked to submit a first cylinder choose the default by pressing enter. The same applies for the last cylinder. Now write the partition by giving the command "w"

3. “Reboot” your VPS and run the following command "mke2fs -j /dev/vdaX". Replace the x with the partition number from the previous step.

4. After the partition is formatted you will need to create a new so-called mount point. Create a new directory with the following command "mkdir /mynewpartition" you can use any name you want for "mynewpartition”. Please memorize or write down the partition name. You will need it in the coming steps.

5. Now copy “/etc/fstab” by using the command "cp /etc/fstab /etc/fstab.bak". The partition is now ready to be added to /etc/fstab. Use the following command "echo '/dev/vdaX /mynewpartition ext3 defaults 1 1' >> /etc/fstab".

6. Now use this command to mount the partition and your Harddisk Upgrade upgrade is completed: "mount /mynewpartition".

Do you have a good idea?

Give us your idea! If it's popular we'll add it to the wishlist!

Has this article been helpful?

Create an account or log in to leave a rating.

Comments

Create an account or log in to be able to leave a comment.

Are you stuck?

Ask one of our specialists to assist you

Contact us