Create Partition
To create a partition on a volume, do the following:
View the attached disks using the following command:
fdisk -l
Find the disk that you want to create a partition on.
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.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.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.Verify that the partition was created by running the following command:
lsblk -o NAME,PATH,SIZE,FSAVAIL,FSUSE%,MOUNTPOINT
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.
- Open the