# 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 keys](https://docs.crunchbits.com/system-administration/ssh-keys/how-to-ssh-into-your-server-using-ssh-keys)

### 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.&#x20;

### 3. Format the drive

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

{% hint style="info" %}
Change sdX to the name of the drive above
{% endhint %}

```
mkfs.ext4 /dev/sdX
```

### 4. Mount the drive

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

```
mkdir /hdd
```

Then mount that formatted drive there:

```
mount /dev/sdX /hdd
```

Then verify that it's mounted via:

```
df -h
```

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

```
/dev/sdc        2.0T  2.1M  1.9T   1% /hdd
```

### 5. Permanently mounting the HDD drive

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

```
blkid /dev/sdX
```

Which will output something like the following:

```
/dev/sdc: UUID="cfd6a952-a58d-4527-ba59-1b6b6b8b6192" BLOCK_SIZE="4096" TYPE="ext4"
```

Please copy everything that is inside the quotation marks after `UUID=`.&#x20;

Then you'll need to edit fstab:

```
nano /etc/fstab
```

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

```
UUID=your-uuid-here /hdd ext4 defaults 0 2
```

And your drive now will be permanently mounted.&#x20;
