Solid State Hard Drive connected to Raspberry Pi

Add Solid State Hard Drive to Raspberry Pi

by Lewis Loflin

USB to SATA hard drive converters have been around for years. When combined with a solid state hard drive we have a fast USB drive for Raspberry Pi. I use this as a backup for my Raspberry Pi.

Here I will take a different approach. Normally one alters /etc/fstab to setup drives. This is very risky and will wreck your system if done wrong. I'll bypass that risk.

I programmed a Python control box to mount/unmount the drive under manual control. The drive will be opened with Thunar or PCmanFM but I use Rox-filer.

Python USB drive control box.

Above is my Python control box. It merely does with mouse click what we do from a terminal. I formatted my SSD as FAT32 just like any thumb drive.

This is for Raspberry Pi.

Plug in a USB thumb drive and type the following in terminal:

 ~ $ sudo mkdir /mnt/sda1

This creates a directory sda1 in /mnt. Now we will map the drive to /mnt/sda1:

 ~ $ sudo mount /dev/sda1 /mnt/sda1 -rw ; rox-filer /mnt/sdb1

The drive is seen as /dev/sda1 which is mapped into /mnt/sda1. Open /mnt/sda1 and you will see the contents of the drive when rox-filer opens. You will be logged in as root and have read-write privileges. You can use pcmanfm for rox-filer.

Close your file manager and type the following:

 ~ $ sudo umount /mnt/sda1

Now /mnt/sda1 is an empty directory.

The control box is written in python3 and python3-tk. The complete sample code is

Web site Copyright Lewis Loflin, All rights reserved.
If using this material on another site, please provide a link back to my site.