This post exists mostly to aid myself for when I buy new drives for my home server. It's a quick and easy way to create an ext4 filesystem over the entire drive.
To go through this post, you'll need to know the name of your drive.
```bash
sudo fdisk -l
```
or
```bash
lsblk
```
The drive is most likely one of the larger devices with no partitions set. It'll likely be of the format `/dev/sdX`.
To begin, we'll have to set the label. Here we'll use `gpt`.
```bash
sudo parted /dev/sdX mklabel gpt
```
Then we can create a primary partition formatted with ext4 covering the entire device.
```bash
sudo parted -a opt /dev/sdX mkpart primary ext4 0% 100%
When you're ready to make it permanent, we'll have to edit the `/etc/fstab` file. We should note the drive by its UUID so that it's not dependent on the slot the hard drive sits in. You can find it by running this command
```bash
lsblk -o UUID /dev/sdX1
```
Now you can append your `/etc/fstab` with the following: