Skip to content

Latest commit

 

History

History
95 lines (75 loc) · 1.42 KB

mount-2tb-disk.md

File metadata and controls

95 lines (75 loc) · 1.42 KB

How to create a partition above 2TB in linux

Requirements

Install parted:

apt-get install -y parted

Identify your hard drive

Find your drive names:

lsblk

Run fdisk for selected drive for info:

fdisk -l /dev/<your harddrive name here>

# Example:
fdisk -l /dev/sdb

Creating the partition table

Run parted: parted /dev/<your harddrive name here>

parted /dev/sdb

Create the GPT partition table

To create a GPT partition table:

mklabel gpt

Set the unit to GB

unit GB

Create the partition

mkpart primary <from GB> <to GB>

# Example:
mkpart primary 0.0GB 4000.8GB

View the partition table

To view the partition table:

print

Quit parted:

quit

Create the filesystem

mkfs.ext4 /dev/<your drivename and partition number here>

# Example:
mkfs.ext4 /dev/sdb1

Add the partition to fstab and mounting it

Create new directory for mount point:

mkdir /<your mount dir>

# Example
mkdir /store

Open fstab file:

vim /etc/fstab

Add the following line at the bottom:

/dev/<your drivename and partition number>               /store                  <your filesystem>    defaults        0 0

# Example:
/dev/sdb1              /store                  ext4    defaults        0 0

Mount the partition

mount /<your mount dir>

# Example:
mount /store