Last updated: August 2025

Hard Drives

Drives

Note: This article series covers configuring Debian 12 for hosting multiple domains and web sites on a single dedicated server. As such, some strategies may be inappropriate for your environment. Sockets for example are appropriate for communication between services hosted on the same machine but not suited to a set up with distributed services (where you'd use ports). Please consult the overview for more information.

Now we're ready to set up your drives. My dedicated.com server came with a 1TB hard drive and a 256Gb SSD.

My operating system is on the 1TB hard drive. SSD drives are very fast but they have limited writes per sector, these days they come with management software that spreads those writes out to make them last a bit longer.

My strategy is to have read intensive services (like web sites) use the SSD and write focused ones (like databases) use the HD. In my case, I'll just be setting up my SSD and mounting it somewhere the operating system can see it.

The device ID that linux allocates is decided by the order it detects the devices in, which can change. The point of the linux ID is to keep the device name short to type and you don't want to rely on the OS allocating the same ID between boots, so we'll use it here for initial configuration but refer to it by its hardware ID later. List your disks:

sudo fdisk -l

I can see that the empty disk is currently /dev/sdb

Add the primary partition. Remember if you make any changes using fdisk, you have to commit your changes (using w) before they take effect:

sudo fdisk /dev/sdb

Interactive mode:
	n for new partition
	1 (primary), defaults for start and end sectors
	
	w to write changes
Format it, I like ext4:

sudo mkfs.ext4 /dev/sdb

Now mount it to make sure it works:

sudo mkdir /mnt/d1
sudo mount /dev/sdb /mnt/d1


I like to loosen the permissions so anyone can write to it, you might disapprove of that if you don't want other users having access:

sudo chmod 777 /mnt/d1

You want to get the hardware ID to make sure there's no confusion about mounting the correct drive to the correct place on boot:

sudo blkid

It's the UUID string that blkid returns that you want to make a note of.

Add it to fstab (file system table) to make sure that the operating system mounts it on boot. Obviously, that's my setting below, replace the UUID and use your preferred mounting options. /mnt is the recommended place to mount non-removable drive devices on Linux.

Also note I removed the quotes from the UUID, you probably don't need to but I checked my other servers and they all have the UUID defined without quotes, I'm probably being silly but just to make sure!:

sudo nano /etc/fstab

UUID=faff14f4-8e95-4637-af66-f4dd35423ff7    /mnt/d1    ext4    defaults    0    1
Follow the same procedure for each drive, obviously changing the mount points for each one and then bounce your server to make sure it works as expected!



2025