Not the sudo RaspberryPi, also knows as the CuBox, nor the Linux/Raspbian is making the most problems of my server, but very often it’s the hardware.
This time it was the hard disk. A Toshiba one, working since almost 3 years now, quite ok, only troubled by the other hardware problem I faced so far with the server, the USB hub.
Now the server was down. Normally this was not a big deal so far, just make a
fsck -y /dev/sda1
and everything was OK after some reboots.
This time it was different. The file system check could not recover, although the disk was still readable. So I bought a new one, formatted it, copied the data from the old disk preserving the file attributes/permissions.
mkfs -t ext4 /dev/sdc1 mount /dev/sdc1 /mnt cp -pr /media /mnt
Finally it turned out that finding the bad blocks of the old hard disk helped to recover that as well:
fsck -y -c /dev/sda1
Then I made a snapshot of the new system with
tar -zcvpf /mnt/backups/fullbackup.tar.gz --directory=/ --exclude=mnt .
Let’s see how long it lasts now…