Partitioning Disks in Linux

By | December 26, 2020
  1. lsblk – List all disks & partitions attached (Can change after reboot)
  2. sudoparted /dev/sda mklabel gpt – Initializes the disk with a GPT partition [Destructive!]
  3. sudo parted -a opt /dev/sda mkpart primary ext4 0% 100% – Creates a new partition
  4. mkfs.ext4 -L datapartition /dev/sda1 – Format the partition as Ext4
    Note: Partitions have a number appended to the end of the disk name