NAS Error: "no space left on device"
Network Attached Storage (NAS) devices and Linux devices use a unique directory called /tmp
during a backup with Magnus Box. It is not persistent storage (uses device's RAM, capped at ~50% usage), and it will be cleared after every reboot. More information can be found on this Wikipedia article.
During the backup process, Magnus Box will create a number of different files as it de-duplicates data and saves metadata. Once the backup completes, these files will be deleted. However, if Magnus Box is unable to create these files during a backup, the job will stall and fail to complete. To remedy the "Couldn't save data chunk: Write: no more space left on device" error, the temporary directory location can be changed.
Note: This workflow will need to be repeated after every update of Magnus Box. A more permanent solution may be offered in the future.
Changing via SSH
To change the temporary directory via SSH, log in to the NAS via Windows Command Prompt or Mac's Terminal app. Then,
- Create a new temporary folder with the following command:
mkdir /var/tmp/backup-tmp
- Navigate to
/opt/<branded-backup-name>/
(replacing "<branded-backup-name>" with the name of your backup software without spaces) - Edit the
backup-daemon-start.sh
script with either nano or vim- Ex.
sudo nano backup-daemon-start.sh
- Ex.
- Add the following to the top of the file after
#!/bin/bash
:export TMPDIR=/var/tmp/backup-tmp
- Save the file
The top of the file should now resemble this:
#!/bin/bash export TMPDIR=/var/tmp/backup-tmp set +eu if test $UID -eq 0 ; then # Workaround for missing /root var in Synology DSM /rc.d/ scripts if test -z $HOME ; then ...
Now, restart the NAS device and initiate a manual backup to confirm the issue was resolved.
Changing via Backup Command
If SSH access is not available, a command can be added to the applicable backup to create and specify the new temporary directory. Note: this command should only be run once! After running the command, remove it from the Commands section.
Add the following command to the backup job, initiate a backup (to run the command), and then remove it from the backup job. Restart the NAS, and start a manual backup to confirm that issue was resolved.
mkdir /var/tmp/backup-tmp/ && sed 's/#!\/bin\/bash/#!\/bin\/bash\nexport TMPDIR=\/var\/tmp\/backup-tmp\//1' /opt/<branded-backup-name>/backup-daemon-start.sh | tee /opt/<branded-backup-name>/backup-daemon-start.sh
Make sure to replace both instances of "<branded-backup-name>" with the name of the your branded application, excluding spaces. For Magnus Box branded partners, this would be: "MagnusBox" Below is an example of the command used on our development network where the branded backup name is "MagnusBoxDevOps":
If there are any issues, or if you have any questions, please email support@magnusbox.com.