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

Revision #1
Created Sun, May 12, 2019 8:38 AM by Chairat (Par)
Updated Fri, Feb 5, 2021 1:54 PM by Chairat (Par)