Running your own cloud with Seafile on the Raspberry Pi* is a great cost-effective way to store, manage and share your data with full control. The joy can be quickly clouded when the storage capacity of the SD card* is reached. It is obvious to use an external hard drive*. I recommend a hard drive with its own power supply.

A few lines of code are enough and your storage capacity has already been greatly increased.

First, we connect the hard drive to the Pi and identify it in the terminal with:

sudo blkid -o list -w /dev/null

You should get the following output (or similar):

device fs_type label mount point UUID
-----------------------------------------------------------------------------------------------------------------------
/dev/mmcblk0p1 vfat boot /boot 5203-DB74
/dev/mmcblk0p2 ext4 rootfs / 2ab3f8e1-7dc6-43f5-b0db-dd5759d51d4e
/dev/mmcblk0 (in use)                       
/dev/sda1 ext4 /mnt/cloud a219dccf-fe75-4423-8b85-ea913fe039a5

We are interested /dev/sda1 (mmcblk* is the memory card). We now format the hard drive (ATTENTION: all data will be lost!) and create the right file format directly:

sudo mkfs.ext4 /dev/sda

Then we create a mountpoint (path to the hard drive). In the example above, you can see that I have already mounted this under /mnt/cloud.

sudo mkdir /mnt/cloud #the Mountpoint you can choose freely

Now we instruct the Pi to connect the hard drive automatically when restarting. To do this, we open the fstab and insert the line at the end.

sudo nano /etc/fstab
/dev/sda1 /mnt/cloud ext4 rw 0 0

The hard drive can now be connected correctly to:

sudo mount -a

Now we create a folder on the hard drive and assign write rights for seafile:

sudo mkdir /mnt/cloud/seafile
sudo chown -R seafile:seafile /mnt/cloud/seafile

Finally, we stop Seafile, switch to the user seafile, move the data and create a symbolic link. Then start Seafile.

sudo systemctl stop seafile seahub
sudo su seafile
Cd
mv seafile-data/ /mnt/cloud/seafile
ln -s /media/usb-platte/seafile/seafile-data/ /home/seafile/seafile-data
exit
sudo systemctl start seafile seahub

From now on, all files are located on the external hard drive*.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.