Partitioning the HDD storage on Debian based OS

1. SSH into your server

Start by connecting to your server via SSH. If you've used SSH keys, please take a look at the following article: How to SSH into your server using SSH keysarrow-up-right

2. Find the HDD disk

Next up, you'll have to find the HDD disk. You can do this by executing the following command:

lsblk

And you'll be presented with an output similar to the one below:

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda      8:0    0   14G  0 disk 
|-sda1   8:1    0    1M  0 part 
|-sda2   8:2    0  122M  0 part /boot/efi
`-sda3   8:3    0 13.9G  0 part /
sdb      8:16   0  368K  1 disk 
sdc      8:32   0    2T  0 disk 
sr0     11:0    1 1024M  0 rom 

Within that output, looks at the capacities of the drives to determine which disk the your HDD one. In our case, it's a 2TB one, which is the sdc one. Please either remember this, or note this down somewhere.

3. Format the drive

Next up, you'll have to format the drive to the ext4 format with the following command:

circle-info

Change sdX to the name of the drive above

4. Mount the drive

Afterward, please make a new directory, where you'll mount your disk:

Then mount that formatted drive there:

Then verify that it's mounted via:

The output of that command should have a line similar to the following:

5. Permanently mounting the HDD drive

Start by getting the UUID of the drive from the following command:

Which will output something like the following:

Please copy everything that is inside the quotation marks after UUID=.

Then you'll need to edit fstab:

And within, on a new line at the bottom add the following:

And your drive now will be permanently mounted.

Last updated