0

I followed this guide to turn my raspberry pi into my backup server. It has a 16 GB SD Card in it and Raspbian (based on Debian buster) installed. When I try to update with sudo apt upgrade, it returns the error:

Error writing to output file - write (28: No space left on device) [IP: 93.93.135.141 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

Which indicates to me, that the SD Card is full even tough it has pretty much only the system on it.

Here is the output of sudo du -hs /*:

646G    /backupdrive
9.3M    /bin
52M /boot
0   /dev
3.4M    /etc
780K    /home
348M    /lib
16K /lost+found
4.0K    /media
4.0K    /mnt
41M /opt
du: cannot access '/proc/5385/task/5385/fd/3': No such file or directory
du: cannot access '/proc/5385/task/5385/fdinfo/3': No such file or directory
du: cannot access '/proc/5385/fd/3': No such file or directory
du: cannot access '/proc/5385/fdinfo/3': No such file or directory
0   /proc
24K /root
6.2M    /run
8.8M    /sbin
4.0K    /srv
0   /sys
32K /tmp
625M    /usr
167M    /var

Here is the output of lsblk:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 931.5G  0 disk 
|-sda1        8:1    0 931.5G  0 part /backupdrive
`-sda2        8:2    0   512B  0 part 
mmcblk0     179:0    0  14.9G  0 disk 
|-mmcblk0p1 179:1    0   256M  0 part /boot
`-mmcblk0p2 179:2    0  14.6G  0 part /

It seems to me, that the external hdd (sda) is mounted on /, but some of the data is still stored on the normal SD Card. Does anyone have an idea on why this is?

**Edit: **

Output of: df /

Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/root       15023184 14381088         0 100% /
AdminBee
  • 22,803
  • 2
    No, the external drive is sda and sda1 (it's main partition) is mounted to /backupdrive. Internal flash is named mmcblk0 and mmcblk0p2 (second partition) on sd is mounted as /. Can you please [edit] your question with the output of df /. 16gb seems a lot to fill so easily. I'm wondering if you missed the step where you resize / at first boot. – Philip Couling Aug 13 '20 at 22:09
  • @PhilipCouling thanks, I just did – KarlMax Aug 14 '20 at 12:04
  • @PhilipCouling do you have any idea after reading the output of df / ? – KarlMax Aug 17 '20 at 20:08
  • Surprisingly you have used all 16GB of your SD card. You'll need to work out what with and try to free some space (delete files or uninstall software). Or you need to buy a bigger SD card. You can use du -h --max-depth=1 /some/directory/path to find how big directories are and which sub-directories are taking all the space. – Philip Couling Aug 17 '20 at 20:28
  • @PhilipCouling that is excactly the thing, it uses the sd card for some reason for /backudrive. Thats why it is full. You can see that in the output of sudo du -hs /* in the question above – KarlMax Aug 19 '20 at 18:39

1 Answers1

0

@PhilipCouling that is excactly the thing, it uses the sd card for some reason for /backudrive. That's why it is full. You can see that in the output of sudo du -hs /* in the question above

If that's genuinly the case then you should unmount /backupdrive and clear down any files left in there after unmounting. /backupdrive has 646GiB so clearly something is left on your big HD not the SD card.

You probobally don't want to destroy your backup in the process so don't delete everything in /backupdrive that's stored on SD without copying it across to your big hard drive first. You can mount your big backup HDD to /mnt and then use this answer to copy-merge from your SD card (still in /backupdrive) to you backup HDD (now /mnt).

When your done, just umount /mnt and mount the HDD back to /backupdrive.


There will be an obvious follow up question: How this happened? It's quite likely that the backup job ran somehow while the backup HDD was unmounted.

If this happens again, and you're certain the backup drive was mounted correctly at all times, then checkout this problem, referenced in different ways:

This bug was fixed (see here), but since it happened once, it's worth mentioning as I hit this bug with similar symptoms to those in your question.