How to add more disk space to yunohost server?

My YunoHost server

Hardware: VPS bought online
YunoHost version: (stable)
**I have access to my server :**through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If yes, please explain:

Description of my issue

I am trying to back up my server, and I am running out of space. I unable to back up my server.

How do I add an additional hard disk on my VPS, I can purchase a storage volume for a few dollars extra, but how can I configure my server to use the new storage volume? Do I need to mount it somewhere and then add it to the fstab?

Can somebody please give me a bit of advice on how to add extra storage to my Yunohost server?

Hi !

Just to be sure, your VPS hoster only allows you to add new volumes, but not to extend the size of your current VPS volume ?

Yunohost currently doesn’t allow to modify the partitioning through the webadmin. You will need to connect via SSH and use the CLI (command line interface).

When you’ll be connected via SSH, could you show me the output of this command, please ?

1 Like

Hi Sohka, thanks for the reply, I am not sure, I’ll check with them today and post back later, I am sure I can most likely do as you suggest. Let me ask them and I’ll get back to this thread once I find out.

In order to SSH into my server, I need to open port 22, correct? I’ll check the lsblk command also.

By default, in yunohost, port 22 is always open and you can connect to your Yunohost with ssh admin@yourdomain.tld with your admin password.

lsblk show you your disk and your partitions like this on my VPS :

sda      8:0    0 38.2G  0 disk 
└─sda1   8:1    0 38.2G  0 part /
sr0     11:0    1 1024M  0 rom  

df -h show your disk usage and space left


Hi @sherrant,

You might find the documentation on external storage useful too once you have your command line prompt ready.

1 Like

Ok, sorry I took so long. I had port 22 connection refused errors, until I rebooted my laptop. It took me a day to figure it out, lol.

I spoke to my vps hosting, I can increase the size of my vps which doubles the cost, or I can add a storage volume.

Here is what they recommended:

"For VMs with local storage, the storage size cannot be increased independently of the VM plan. The simplest way to get more storage is to upgrade to a larger plan, by selecting your VM and pressing Resize.

If that solution is not cost-effective for you, you will need to store your VM data on a volume.
One option is to attach a volume to your existing VM. It will be like a new disk that you can mount at some mount point on your VM (like /mnt/data/).

Resize takes the least of your time and gives more RAM/CPU but ends up costing the most.

The other two options cost the same amount ($0.03/mo for each GB of additional space).
Attaching a volume to your existing VM could be convenient if you already store your “uprgades/backups” in some directory, like /home/backups/. Then I think you’d just need to:
$ mkfs.ext4 /dev/vdb
$ mkdir /mnt/tmp
$ mount /dev/vdb /mnt/tmp
$ rsync -av /home/backups/ /mnt/tmp/
$ umount /mnt/tmp
$ rm -rf /home/backups/*
$ mount /dev/vdb /home/backups/
If that makes sense. This ensures most of your disk is still fast, and only the backups is on volume which may be slower.

Storing entire VM on volume may cause slower disk operations but is also simple to manage, you don’t need to mount the volume at one mountpoint.

I guess the second option seems to make most sense for “upgrades/backups” which can be all put in one directory on the second disk."

Here is output for my VPS with a couple commands, about the disks:


vda 254:0 0 35G 0 disk
└─vda1 254:1 0 35G 0 part /
vdb 254:16 0 1G 0 disk [SWAP]


/dev/vda1: UUID=“5eb24923-6e18-43ac-83c4-5361b408938a” TYPE=“ext4”
/dev/vdb: UUID=“da7ea926-d212-4048-a005-497cd03cc8c0” TYPE=“swap”

Fdisk -l

Disk /dev/vda: 35 GiB, 37580963840 bytes, 73400320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 73400286 73398239 35G 83 Linux

Disk /dev/vdb: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

df -h

Filesystem Size Used Avail Use% Mounted on
udev 2.0G 0 2.0G 0% /dev
tmpfs 396M 43M 354M 11% /run
/dev/vda1 35G 24G 9.5G 72% /
tmpfs 2.0G 80K 2.0G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 396M 0 396M 0% /run/user/1007

What do you suggest as the best path forward considering the suggestions from my hosting? To me, from a cost perspective, it seems adding a storage volume for backups, would be best. What do you guys & gals think?

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