Unix & external disk

Mount new external disk

List all disk

sudo fdisk -l
1

Reset format external disk

sudo mkfs.ext4 /dev/sda
1

Mount disk

mkdir /mnt/disk
sudo mount -t ext4 /dev/sda /mnt/disk
1
2

Mount Automation

sudo blkid
/dev/sda1: LABEL="ESP" UUID="5420-BA66" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="2bc590d1-36c7-420d-be5e-f09a30163dac"
/dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="e68c743f-7277-4988-9129-1072b07debc7"
/dev/sda3: LABEL="Windows" UUID="3042221C4221E6F6" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="a2f40963-de4d-4b21-bd6f-2964fed7831d"
/dev/sda4: LABEL="Recovery" UUID="027C22D47C22C271" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="2b784058-36fa-4f8b-910e-9276d046ba36"
/dev/sda5: LABEL="Linux" UUID="E844E71A44E6EA70" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="f8ba9d88-87d0-4c7d-8711-a933a3ffac8f"
/dev/sda6: UUID="5be178be-a46f-4dc3-bf7c-1cec3f315b79" TYPE="ext4" PARTUUID="41245776-8b18-4422-b44b-692edf708c41"
1
2
3
4
5
6
7

The output from the blkid command above can be used to identify the hard drive when adding entries to /etc/fstab.

Next you need to edit the /etc/fstab file. The lines in this file are organized as follows:

UUID={YOUR-UID}    {/path/to/mount/point}               {file-system-type}    defaults,errors=remount-ro 0       1
1

Unmount external disk

sudo umount /dev/sda
1
Last Updated: 1/17/2020, 10:52:32 AM