parted Cheat Sheet
Ensure parted is installed
sudo apt update
sudo apt install parted
Create a GPT partition table
sudo parted /dev/sda -- mklabel gpt
sudo parted /dev/nvme1n1 --mklabel gpt
Create a new partition
sudo parted -a opt /dev/sda --mkpart primary ext4 0% 100%
sudo parted -a opt /dev/nvme1n1 -- mkpart primary ext4 0% 100%
Format the new partition
sudo mkfs.ext4 -L VOLUME_NAME /dev/nvme1n1p1
Create the mount point
sudo mkdir -p /media/user/VOLUME_NAME
Get the UUID of the partition
sudo blkid /dev/nvme1n1p1
The output will appear such as:
/dev/nvme1n1p1: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" TYPE="ext4" PARTLABEL="VOLUME_NAME"
Edit the /etc/fstab
file for automatic mounting
sudo vim /etc/fstab
Add the following at the end of the file:
UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /media/reece/VOLUME_LABEL ext4 defaults 0 2
Test the configuration
sudo mount -a
Validate the mount
df -h