Chat with us, powered by LiveChat
Create a new partitionon on linux server

Create a new partitionon on linux server

To Create a new partition on Linux server we have to use following steps steps.

Login to your linix server with root user and Using #fdisk -l  command you can list the number of partitions already created on your linux server.

#fdisk -l

It will give you following details

Disk /dev/sda: 499.5 GB, 499558383616 bytes
255 heads, 63 sectors/track, 60734 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         653     5245191   83  Linux
/dev/sda2             654        3713    24579450   82  Linux swap / Solaris
/dev/sda3            3714        6324    20972857+  83  Linux
/dev/sda4            6325       60734   437048325    5  Extended
/dev/sda5            6325        8935    20972826   83  Linux

If you want to create 1000MB partition which is mounted on /new directory then proceed with following steps

#fdisk /dev/sda

type n for new partiton and specify the cylender size as as +1000M then type p to view new parttion then type w for save

then run the following command


Now you need to format the the newly created partition

#mke2fs -j /dev/sdaX

The X is the partition number which you have created

Now create the dirctory where you want to point the newly created partition

#mkdir -p /new

then with following command you can point the new parttion to the directory.

#mount -t ext3 /dev/sdaX /new

To keep these settings permanant you need to add the entry in fstab.

#vi /etc/fstab

/dev/sdaX /new ext3 defaults 0 0

save and quite the fstab file.

You can verify the setting by rebooting your server . Please check the new partition with command

#fdisk -l


Leave your comment

Pin It on Pinterest

Share This