How to use SSD for hosting on RPi?

How to use SSD for hosting on RPi?

Raspberry Pi 4 comes with improved faster USB 3.0 interface. So if you use SSD disks with Raspberry Pi 4 you will see significant improvement in the speed. The performance test shows at least 3 to 4 time faster for the apps when using SSD disk on the faster USB port with Raspberry Pi. So this will be very useful if you are using your raspberry Pi as a file server or if you are using it for web hosting. Also SSD disks are more stable compare to memory cards or USB drives. So you can be more confident on the data you keep there.

How to mount USB drives to specific Path automatically?

If you want to use the SSD disk in your Raspberry Pi you want to mount the device to a specific path all the time even if the device is restarted so that your services will be running without manual intervention.

First you need to find the device id by using the following command

blkid

You will see output as shown below.

Find device id using blkid

Find your device using the mounted point such as dev/sd*. If you have many connected devices you can use the label to find the exact device. If you cannot find the device you can use lsblk command for finding device using capacity.

Devices listed using lsblk command

Copy the UUID from the blkid command. Use the following command to edit file system table file.

sudo nano /etc/fstab

In the file add a line as shown below.

UUID=6def6748-a385-423b-ae17-e7435f472014 /media/SSD ext4 defaults,nofail 0 0

Here UUID is the UUID you found in previous step. next input is a path where you want to mount the disk and the next one is the partition. If you use the disk with windows system also time to time then you might use FAT or NTFS partition. In that case you need to mention that partition such as shown below.

UUID=6def6748-a385-423b-ae17-e7435f472014 /media/SSD ntfs defaults,nofail 0 0

Once you have saved the file, please restart the raspberry Pi and you should see your device at your mount point you mentioned.

If you have got some questions or error please feel free to comment then I can answer them.

A full stack developer learning a developing web applications since my university time for more than 20 years now and Pega Certified Lead System Architect (since 2013) with nearly 16 years experience in Pega.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top