My HDD broke down

So… for the last couple of weeks my system on the notebook was “hanging” from time to time. as i use linux i am not used to that behavour so i investigated with gnome-disks and got confirmation…

Ignore the assessment and look at the various errors: IDs 1, 5 and 7 are the most telling.

I ordered a new HDD (actually the same i used already) – A Seagate Firecuda with 1TB.

As i am a student, my funds are low and they are available for about 50€ and are reasonably fast with linux, because the system and most used programms fit into the ssd-cache.

Well… the hdd came and… had readerrors right away. shit.

so… i sent it back and bought an ssd from intenso. as i said: funds are low so i could only afford 500GB. the obvious problem: i couldnt just copy the hdd but had to shrink the partitions on the old one.

The TL/DR from this point:

  • i tried to shrink the partition and succeeded BUT probably broke the btrfs root-tree
  • i lost 53kb of data because of the disk-error (unrecoverable read error)
    • i have backups so thats not a problem
  • the copied hdd WOULD NOT START
  • i wasnt able to fix the btrfs root-tree

-> Using btrfs was probably a mistake.

I decided to install a new system as i was annoyed with lubuntu anyway because of the update-notifications and the overall bloatiness of the system.

in my view i had to witness lubuntu changing from a lightweight system for older or smaller devices to an design-alternative to normal ubuntu.

so: what system to use?!

Doing a Backup to a Remote-Server with Borgbackup

As i am paranoid, i wanted to do a backup of my server – as implicated in the wordpress-setup howtos i have some instances of wp on the server, as well as some files and gameserver.

Naturally i want to have a backup. The catch: I dont have local space, so i have to do it remote.

I know borgbackup for some years now, and so i used it. (https://borgbackup.readthedocs.io/en/stable/quickstart.html#)

It is mainly straight-forward, assuming that you can connect via ssh.

To do my backup i used the following commands which i try to explain down below:

First i had to create a new folder on my backup-destination-server, in this case $backupfolder. After that i used:

borg init –encryption=repokey myuser@mydestinationserver:/path/to/my/hdd/for/backups/$backupfolder

sudo borg create –stats –compression zstd,22 –progress myuser@mydestinationserver:/path/to/my/hdd/for/backups/$backupfolder::archivename /home/ /var/www/ /etc/apache2/

The init is needed to create the repo on the remote sever. You can use any location you want, but MAKE SURE you have enough empty space there. You will be asked for a repository-password that you shouldnt forget if you want to restore the data in the future.

Next i started the backup. the compression is set to high to use less bandwidth. The –stats will be shown after borgbackup has finished, while –progress is updated in realtime.

The archivename is just a name for the archive in the repository. they can be re-used or you can let them rot forever on your server. Mine was “june”, for example – because its june. My next backup will be in july – and the name will be “july”. Next year the archive will be overwritten.

The three folders at the and are my local folders that are being backed up.

Thats it!