Skip to content

Format disk | Partition

  • Check disk name
sudo lsblk -f
sudo fdisk -l

Partition your disc

fdisk /dev/xvdc

Options:

n – Create partition
p – print partition table
d – delete a partition
q – exit without saving the changes
w – write the changes and exit.

Simple example:

n > p > enter > enter > w

Format

  • check you new partition lsblk -f
sudo mkfs.ext4 /dev/xvdc1

Mount

  • create folder
sudo mkdir /storage
sudo mount /dev/xvdc1 /storage/
  • add to fstab

Old way...

/dev/xvdc1  /storage    ext4    defaults     0   0
  • use UUID
sudo blkid
sudo nano /etc/fstab

Example

UUID=2681fb49-1314-4449-869d-7a2dc524fde0 /storage        ext4    0 0