• 26Mar

    Hello,

    If you want ot create new partition on linux server and mount it to specific directory then you have to follow the following steps

    login to your linux server with root user

    First of all verify which partition type and how many partitions available on your linux server.

    You can get it with

    #fdisk -l

    suppose you are having partition type as /dev/sda

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

    fdisk /dev/sda

    here you have to type n new partition

    specify cylender size if you understand it otherwise leave it and enter the partition size as +1000M

    type p to view new parttion then type w for save

    here your have to run command

    #partprobe

    Now format the new created partition with command

    mke2fs -j /dev/sdaX

    here X is the new partition number , you have to change it as per your new partition.

    now you have mount the partition on /data directory so create directory /data

    #mkdir -p /data

    mount /dev/sdaX /data

    You have to entered the entry of new partition in /etc/fstab

    #vi /etc/fstab

    entered the following line.

    /dev/sdaX /data ext3 defaults 1 2

    save this file and reboot your machine to verify the changes.

    Posted by Tuks @ 1:38 am

    Tags:

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.