Today is the day to reinstall my raspberry pi which acts as:
forked-daapd server for my flac collection
network bridge for my upstairs room
This particular pi has a "Segmentation Fault" when issuing certain commands like "sudo su" or "apt" commands. My guess is that the SD Card is corrupted, I know this from previous problems I had with this raspberry pi.
So I made backups of all important stuff like config files etc.. Let's see how it goes!
Reinstall the basic Pi
- Download the Raspbian image from Raspberry Pi website downloadpage.
- Burn the downloaded zip file to the SD Card. I use ApplePiBaker for this, good shit for baking your pi images :)
- Copy an empty file named "ssh" to the root of the SD card. This is done so we do not need an external monitor for configuring the pi.
- Use NMAP to find the new PI on your network:
- Update the pi
sudo apt-get updateand
sudo apt-get dist-upgrade
Step 1 - Restore Networking
- Restore ip configuration for wifi and local ether
- Restore the raspberry bridge function
- Restore the DHCP configuration
First step is to edit the hostfile
/etc/hosts to set the pi's hostname, in this case "teladrop"
Step two - edit the /etc/dhcpcd.conf and add:
# 20180614 added for bridge function by Egbert - see https://pimylifeup.com/raspberry-pi-wifi-bridge/
Next I configured the wireless interface through
I copied back settings from the backup of /etc/dnsmasq.conf into that file on the new pi:
interface=eth0 # Use interface eth0
listen-address=192.168.220.1 # Specify the address to listen on
bind-interfaces # Bind to the interface
server=10.0.1.7 # Use Google DNS
domain-needed # Don't forward short names
bogus-priv # Drop the non-routed address spaces.
dhcp-range=192.168.220.50,192.168.220.150,12h # IP range and lease time
I read up via Easy Raspberry Pi Bridge to get the bridge working again. I really wouldn't know that all by head..
Put the pi back into its place and connected the pendrives, the external harddrive, and the ethernetcable to my PowerMac. Booted up and networking is running fine!
Step 2 - restore Samba configuration
Step 1 - restore fstab settings:
I checked the external disks UID's with
sudo blkid to make sure they are correct, they are..
I installed samba and needed disk stuff:
sudo apt-get install samba samba-common-bin
sudo apt-get install ntfs-3g
I copied over the settings from my backup of /etc/samba/smb.conf file to the new pi
Create the Pi samba user:
sudo smbpasswd -a pi
Created the share directories in /Volumes
Made the pi user owner of this directory
sudo chown -R pi:pi /Volumes
That worked out nicely. Now up to
Step 3 - Reinstall and configure Forked-daapd
First, install avahi-daemon:
sudo apt-get install avahi-daemon
Next add the source for forked-daapd to the
deb http://www.gyfgafguf.dk/raspbian/forked-daapd/ stretch contrib
sudo apt-get update
sudo apt-install forked-daapd
I then copied back the
/etc/forked-daapd.conf file from my backup and forked-daapd and rebooted the system.
Step 4 - Reinstall ProFTPD server
I use an FTP server for my On Song workflow. The reason for that is that I don't want to use Dropbox or another commercial file sharing solution. I like FTP a lot because it is so simple.
First install ProFTPD
sudo apt-get install proftpd
Create the FTP User
So I made the FTP user with the /bin/false shell and stuff according to the instructions here: HOWTO: Create a FTP server with user access.
I copied over the /etc/proftpd/proftpd.conf file from my backup and restarted proftpd
sudo service proftpd restart. It's running just fine!
Step 5 - Reinstall Backup my Pi script
I use this to backup my Pi's SD Card. First install gitL
sudo apt-get install git.
Next clone the repository:
git clone https://github.com/lzkelley/bkup_rpimage.git
Now i can run an initial backup so next time I have to reinstall this pi I can simply restore the image created by this script:
sudo sh bkup_rpimage.sh start -c /Volumes/TELADROP-PENDRIVE/teladrop_backup/rpi_backup.img
I will use this image as the default rescue image for this Pi.
Things to do better next time
- Make a backup of the pi user crontab file
- Create a definitive backup of data files
- Backup webserver directories