Add a disk on DigitalOcean ($10 a month)
A DigitalOcean Volume is an extra disk for the server: 100 GB costs $10 a month. The steps move the uploaded files (and the backup copy of them) onto it, then raise the limit. Do them when few people are using SchoolStack: the site is off for a few minutes.
In the DigitalOcean website:
- Open your Droplet, choose Volumes ▸ Add Volume.
- Size 100 GB; name it
schoolfiles; choose Automatically Format & Mount and Ext4; choose Create Volume.
In the Droplet's Console (paste one line at a time and press Enter; wait for each to finish):
- Check the new disk is there (it shows about 98G):
df -h /mnt/schoolfiles - Stop SchoolStack and its nightly backup:
systemctl stop schoolstack schoolstack-backup.timer - Make two folders on the new disk (the first belongs to SchoolStack):
install -d -o schoolstack -g schoolstack -m 750 /mnt/schoolfiles/files && mkdir -p /mnt/schoolfiles/backup-files /var/backups/schoolstack/files - Copy the uploaded files onto it (this can take a few minutes):
cp -a /var/lib/schoolstack/files/. /mnt/schoolfiles/files/ - Copy the backup of the files onto it:
cp -a /var/backups/schoolstack/files/. /mnt/schoolfiles/backup-files/ - Keep the old folders aside for now, and make empty ones in their place:
mv /var/lib/schoolstack/files /var/lib/schoolstack/files-old && mv /var/backups/schoolstack/files /var/backups/schoolstack/files-old install -d -o schoolstack -g schoolstack -m 750 /var/lib/schoolstack/files && mkdir /var/backups/schoolstack/files- Tell the server to use the new disk for both folders, now and after every restart:
echo '/mnt/schoolfiles/files /var/lib/schoolstack/files none bind,nofail,x-systemd.requires-mounts-for=/mnt/schoolfiles 0 0' >> /etc/fstab echo '/mnt/schoolfiles/backup-files /var/backups/schoolstack/files none bind,nofail,x-systemd.requires-mounts-for=/mnt/schoolfiles 0 0' >> /etc/fstabsystemctl daemon-reload && mount -a- Check both folders are on the new disk (both lines show about 98G):
df -h /var/lib/schoolstack/files /var/backups/schoolstack/files - Raise the limit to 40 GB (the backup copy needs the same again):
sed -i '/^SCHOOLSTACK_FLAGS=/ s/$/ --files-quota-mb 40000/' /etc/schoolstack/schoolstack.env - Check it:
grep FLAGS /etc/schoolstack/schoolstack.envshows--files-quota-mb 40000at the end of the line. If it shows nothing, pasteecho 'SCHOOLSTACK_FLAGS=--files-quota-mb 40000' >> /etc/schoolstack/schoolstack.env - Start SchoolStack and its backup again:
systemctl start schoolstack schoolstack-backup.timer - Check it is running:
systemctl status schoolstacksays active (running). Open SchoolStack: the notice on Classes is gone, and lesson files still open.
A week later, when everything works, delete the old copies to free the server's own disk:
rm -rf /var/lib/schoolstack/files-old /var/backups/schoolstack/files-old
If you ever run the installer (deploy/install.sh) again, paste step 12 again: the installer
writes its own options. Updates (schoolstack-update) keep the limit.
Example: The warning says 96%. On Saturday morning the owner adds a 100 GB volume named
schoolfiles, pastes the steps one at a time, and sees the notice gone. Teachers can upload
again.
Related: When SchoolStack warns you · Where the data lives