Skip to main content

Create Partition

To create a partition on a volume, do the following:

  1. View the attached disks using the following command:

    fdisk -l
  2. Find the disk that you want to create a partition on.

  3. Create a new partition using the following command:

    sudo mkfs.ext4 /dev/sdc

    Note: Replace /dev/sdc with the name of the disk you want to create a partition on.

  4. Create a new mount point using the following command:

    sudo mkdir /mnt/data

    Note: Replace /mnt/data with the name of the mount point you want to create.

  5. Mount the new partition using the following command:

    sudo mount /dev/sdc /mnt/data

    Note: Replace /dev/sdc with the name of the disk you want to create a partition on.

  6. Verify that the partition was created by running the following command:

    lsblk -o NAME,PATH,SIZE,FSAVAIL,FSUSE%,MOUNTPOINT
  7. Edit the /etc/fstab file to mount the new partition automatically on boot:

    • Open the /etc/fstab file using nano.
    sudo nano /etc/fstab
    • Add the following line to the bottom of the file:
    /dev/sdc /mnt/data ext4 defaults,noatime,nofail 0 2

    Note: Replace /dev/sdc with the name of the disk you want to create a partition on.

    • Save the changes with Ctrl+O and then return
    • Exit nano with Ctrl+X.