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
to monitor the network traffic one can use the tool vnstat
- install vnstat
- setup database for interface: vnstat -u -i eth0
- start/enable service
- usage: update database: vnstat -u
- 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
you need to edit the file: /etc/motd
as well as the sshd config:
/etc/ssh/sshd_config: Change the setting PrintLastLog to “no”, this will disable the “Last login” message.
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
spindown_time = 180
write_cache = on
Note: The spindown_time value is multiplied by 5 and you have the total time in seconds. So a value of 120 yields 10 minutes (120*5=600).
the power managment (should the drive even be spun down) is set via the “advanced power managment” (-B) flag.
From ArchWiki: Set the Advanced Power Management feature. Possible values are between 1 and 255, low values mean more aggressive power management and higher values mean better performance. Values from 1 to 127 permit spin-down, whereas values from 128 to 254 do not. A value of 255 completely disables the feature.
$ sudo hdparm -B 127 /dev/sda
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).
sudo apt install deluged deluge-console
sudo pkill deluged
config -s allow_remote True
sudo pkill deluged
Start deluge daemon at bootup (follow this guide: link):
- remove script from /etc/init.d/deluge…
- create systemctl unit
- enable unit file
the ntpserver is just a waist of memory for a raspi and its enough to synchro the time every couple hours.
- right time zone:
$ sudo dpkg-reconfigure tzdata
- deinstall ntp server:
$ sudo apt-get purge ntp
- install ntpdate:
$ sudo apt install ntpdate
- 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