
Attaching an external storage with over 2TB in size
Usually, we can prepare and attach external storage using fdisk
and then a permanent entry in fstab
. However, when the disk size exceeds 2TB, fdisk will have issues in dealing with this device. You need to install 'parted'
in order to prepare the disk. Once parted is installed, launch and use the instructions below to prepare your disk.
- The ‘x’ in /dev/sd
x
and ‘xx’ in /dev/sdxx
should be replaced with the suitable device links for your disk. - You can find it out by monitoring
tail -f /var/log/messages
in Raspbian OS. - Using
0 0
inmkpart
command will let you choose all the space available and I selected to use ext4 for the filesystem. - You will replace
.ext4
with the suitable extension you select in# mkfs.ext4 /dev/sdxx
command. - Mount command should be used with ‘xx’ in /dev/sd
xx
for the suitable device and/folder
is the path you want to mount this drive to.
parted /dev/sdx
.
.
(parted) mklabel gpt
.
.
(parted) unit TB
.
.
(parted) mkpart primary 0 0
.
.
(parted) quit
.
.
mkfs.ext4 /dev/sdxx
.
.
mount /dev/sdxx /folder
Now that the disk is ready, all you need to is add mount /dev/sdxx /folder
to fstab
so that it automatically mounts on reboots.