Skip to content

Format disk | Partition

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

Partition your disc

Bash
fdisk /dev/xvdc

Options:

Text Only
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
Bash
sudo mkfs.ext4 /dev/xvdc1

Mount

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

Old way...

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

Example

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