Is it possible to install applications on a external USB hard disk?

My YunoHost server

Hardware: Raspberry Pi at home
YunoHost version: 11.0.10
I have access to my server : direct access via keyboard
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I’m considering installing yunohost on my rasperry pi 4 because it looks amazing and it will make my life and my switch to self hosted applications much easier!

I’m currently installing all my software/applications and I’m storing all the media files on a external hard drive connected to my rasperry pi using USB and automatically mounted at boot. I install on the internal SD card just the bare minimum and I use more or less 8Gb of space

Before installing yunohost I’m trying to understand if a 16Gb SD card will be enough. I want to install at least 10 applications and I’m not sure if it is possible to install them on the external hard disk or if I will need to buy a bigger SD card.

Before formatting and reinstalling I prefer to double check with you.

Thanks in advance!

I don’t know if it’s possible during install (I don’t think so without editing app script), but afterwards I believe it should work by moving the /var/www/app_folder (and any other one if they create it for instance in /opt) to your external drive and creating a symbolic link on its previous location, with same rights and owner than the original folder.

What I have done

  • Keep the ‘boot’ partition on a basic SD card
  • Move the ‘root’ partition on an external SSD disk, 240 Gb.
  • Use another 2 Tb disk for multimedia and backups (idle 90% of time)

Interesting solution because it reduce the stress on the 2Tb disk.
Did you find a way to do it during the first installation or did you configure it after?

Unfortunately I’m not a IT expert and I think my skills are not enough to do something like that without a step by step howto.

Unfortunately the Yunohost image for Raspberry Pi does not implement that.

Move your system to SSD

  • do the regular setup on the sd-card
  • extract the card
  • with your laptop copy the root partition from sd-card to SSD. You can use the command line dd or simply the graphical tol gnome-disk (backup and restore a partition).
  • expand the partition to the disk size using something like resize2fs /dev/sda1
  • edit the /boot/cmdline.txt en tell where the new root is

Add a backup disk

  • Edit /etc/fstab to permanently mount the partition(s) on your HDD
  • For example, add some external storage in Nextcloud
  • Use a scheduled backup tool or script to backup on SSD and copy backups on HDD. I keep 7 days backup on SSD and 21 days backup on HDD.

This is not a fully documented tutorials. I have no time for writing more details now but this give you hints, and maybe someone can correct/complete it.

Be aware that will eventually be the first part to crash, or rather in an unexpected timing.
So I would advice you to make good, (tested ?) regular backups of that /boot folder, just in case.

Clearly, that’s a good idea, while a bit expensive.

The ‘boot’ partition is very small. The image of the partition is small and easy to store. I understand this partition is only accessed in read-only at startup. I already had a HDD failure (on ‘root’) but not yet on boot. Anyway I have a spare SD-card.

Not more expensive than a Synology or any other option for sharing 2Tb multimedia at home.

Anyway with the actual Yunohost image for Raspberry, this requires a few manuel steps for configuring this.

You should read this tutorial, it explain exactly what you are searching for


Yes, that’s really not a big deal to backup, and it does not change very often.
But as it’s on an SD card it’s quite important to backup it (I had several big crashed in the past because of that… :sweat_smile: - while both HDD and SSD are still alive).

Sure, but not as cheap as having only one drive for the whole system.

How are your performances?

For the raspberry pi 4 I don’t know, but older versions share the same controller for ethernet and USB, which is a bottleneck. I’m not sure you have a gain with your 240Gb SSD, althought this is probably easier to manage / backup with separate drives.

On a Pi3 I have no performance gain I guess. And the Ethernet speed is not magic anyway. The main goal was to avoid a mechanical HDD turning 24/7. Because I already loose a disk.

Like you say, the drive management is also easier. And also, all backups are duplicated on two physical disks (except for multimedia but those are synchronized with laptops).

My target is not performance, but having a personal/family cloud available 24/7 with low energy consumption. The only public thing on it is a Grav CMS blog, started a few weeks ago.

Even if performance is not the target, on a Raspberry Pi 4 this would give a very nice improvement compared to the very slow speed of an SD card (often <10~20MB/s) + reduced competition for storage access.
I don’t know if one should expect high performance (for my part on an SSD for the whole system I don’t see it that much), but it will give the necessary buff to feel confortable on most apps. For my part it changed a lot the responsiveness of Nextcloud for instance, going from very poor and laggy behavior to a fair speed (but nothing fancy). Backup management is also quitte faster, and app upgrade too as a result.
I went up from around 10MB/s of real writing speed to around 100MB/s (far away from the 500MB/s that a modern SATA SSD can provide) in real life use case. That’s not very fast, it’s (decent) HDD speed class, but it’s an order of magnitude better and enough to go away from the “too limited” zone up to “good enough”.

Hence I would recommend it if you have any storage read/write intensive app or use case.

1 Like

Yes I understand. I’m very satisfied with Yunohost (the software) but on my Pi3 nextcloud and piwigo are so slow… Now I start to think to the future and start a reflexionon a better setup to avoid mess with cables and increase performance.
Basically, I would have;

  • an arm card (low consumption)
  • with SSD for the OS
  • 2 HDD drives for the datas (RAID)
  • in an integrated box if possible
  • cheap
  • able to do the coffea :sweat_smile:

@Dams you are talking about Synology, I wonder if it is possible to do a DIY setup based on a reformed synology NAS… :thinking:

From my past research on that point, if you have to buy the hardware (either a commercial NAS or custom pieces), it will be more expensive and maybe not more confortable than a commercial one. If you have some part of the hardware, sure, you can try something (it isn’t that easy :sweat_smile:).

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.