How to Mount a New Hard Drive on Ubuntu

Display all connected hard drives.

sudo fdisk -l

Manage drive partition.

sudo fdisk /dev/sdc
  • Choose i to display current partitions.
  • Choose n to create a new partition with type 83 (Linux).
  • Choose w to save changes and quit.

Create a mount point.

sudo mkdir /data

Edit /etc/fstab.

sudo vim /etc/fstab

And append the following line:

/dev/sdc1    /data    ext4    defaults    0    0

Create file system.

sudo mkfs.ext4 /dev/sdc1

Mount partition.

sudo mount /data