raspi: mount usb drives on bootup

to auto mount usb drives on bootup one can simply add some lines to the /etc/fstab file:

UUID=e0a4c8da-67d1-423d-939c-4dc8249079f0 /mnt/small btrfs rw,defaults,nofail 0 0

you need to change the following:

  • the UUID you can find out through: ls -l /dev/disk/by-uuid/
  • change the mount point
  • change the file system
  • pay attention: the nofail option will mount the drive only if it is plugged in

raspi: log network traffic (vnstat)

to monitor the network traffic one can use the tool vnstat

  1. install vnstat
  2. setup database for interface: vnstat -u -i eth0
  3. start/enable service
  4. usage: update database: vnstat -u
  5. usage: query database: vnstat -q

troubleshooting: when systemctl status shows that database couldnt be created, just do this:

sudo chown -R vnstat:vnstat /var/lib/vnstat

source: wiki.archlinux.org

raspi: automatically spin external hdd down

the raspberry pi cannot spin external hard drives down. the program hdparm worked perfectly for me.

i followed this guide (htpcguides.com). just some slight little twitch i found on some other website: the device path in the /etc/hdparm.conf file should rather be the one from /dev/disk/by-uuid/… as the raspi might mount the external drive to different /dev/sdX paths. furthermore, the drive shouldnt be spun down more than need be. dont choose any spindown times lower than 15min.

 

$ cat /etc/hdparm.conf
/dev/disk/by-uuid/ffd9b0a1-931f-4795-85ba-28c58719a938 {
	spindown_time = 180
	write_cache = on
}

raspi: install torrent server

the raspberry pi is a perfect device for a 24/7 torrent server. one can install the torrent server: deluge.

i followed this guide (howtogeek.com) to install the deluge server, accessible via deluge-console and deluge thin-client (remote).

in short:

sudo apt install deluged deluge-console
deluged
sudo pkill deluged
nano ~/.config/deluge/auth
deluged
deluge-console: {
config -s allow_remote True
config allow_remote
exit }
sudo pkill deluged
deluged

Start deluge daemon at bootup (follow this guide: link):

  1. remove script from /etc/init.d/deluge…
  2. create systemctl unit
  3. enable unit file

raspi: time via ntp

the ntpserver is just a waist of memory for a raspi and its enough to synchro the time every couple hours.

follow this:

  1. right time zone:
    $ sudo dpkg-reconfigure tzdata
      
  2. deinstall ntp server:
    $ sudo apt-get purge ntp
      
  3. install ntpdate:
    $ sudo apt install ntpdate
      
  4. add cron entry:
    $ sudo crontab -e
    @reboot ntpdate -s 0.de.pool.ntp.org
    0 */6 * * * ntpdate -s 0.de.pool.ntp.org
      

source: from german pageĀ aufschnur.de