Create Partition
To create a partition on a volume, do the following:
View the attached disks using the following command:
fdisk -lFind the disk that you want to create a partition on.
Create a new partition using the following command:
sudo mkfs.ext4 /dev/sdcNote: Replace
/dev/sdcwith the name of the disk you want to create a partition on.Create a new mount point using the following command:
sudo mkdir /mnt/dataNote: Replace
/mnt/datawith the name of the mount point you want to create.Mount the new partition using the following command:
sudo mount /dev/sdc /mnt/dataNote: Replace
/dev/sdcwith the name of the disk you want to create a partition on.Verify that the partition was created by running the following command:
lsblk -o NAME,PATH,SIZE,FSAVAIL,FSUSE%,MOUNTPOINTEdit the
/etc/fstabfile to mount the new partition automatically on boot:- Open the
/etc/fstabfile 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 2Note: Replace
/dev/sdcwith 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.
- Open the