Raspberry Pi
From Holyheads Wiki
Contents |
Cockbook
My collection of hints, tips and tricks (supporting my memory and maybe also helping others).
External USB drives
- Automount USB-Drives in Raspbian
- One may use USBmount and autofs
- I prefer udevil, see below
- Install ntfs-3g if you need write access to ntfs file systems
- How to increase performance?
- Mount with option 'noatime' or 'relatime'
- Mount without option sync (e.g. keep default async)
- If using ntfs-3g (fuse) file system, try mounting with option 'big_writes', see for example http://obihoernchen.net/wordpress/tag/big_writes/
udevil
- exmaple for manual mounting:
udevil mount /dev/sda1
- auto-mounting via udev-rule, see for example http://lsdlinux.org/wiki/doku.php?id=auto_mounting#using_udev_rule (I just copied the 95-udevil-mount.rules file from an OpenElec installation (http://www.raspberrypi.org/downloads) )
- my build-steps (maybe there's a simpler way, but this worked...):
- download 0.4.3/udevil_0.4.3-1_all.deb from https://github.com/IgnorantGuru/udevil/tree/pkg, e.g. using wget
- extract deb-package via
ar vx udevil_0.4.3-1_all.deb
- extract data archive
tar xzvf data.tar.gz
- change to tar usr/share/devil/src
- untar
tar xvfJ udevil-current.tar.xz
-
cd udevil-0.4.3
-
mv distros/debian
- execute
dpkg-buildpackage
- If all required packages are installed, this results in udevil_0.4.3-1_armhf.deb. If the build fails due to missing packages, install the missing packages, and re-do the dpkg-buildpackage step
- Install via
sudo dpkg -i udevil_0.4.3-1_armhf.deb
Samba server / NAS
- How to install?
- Slow disc performance?
- see 'Slow USB drives' above
- use Raspbian, etc without GUI to get as much CPU power for file-transfer as possible (OpenELEC or RaspBMC constantly use about 10-20% CPU load when idle, use top to check!)
- Configuration and tuning
RRD tool and cron usage
- Reduce number of disk writes (SD card) when using running cron jobs
- Edit
/etc/default/cron
and setEXTRA_OPTS="-L 0"
to disable logging - Edit
/etc/pam.d/cron
and comment the line@include common-session-noninteractive
to avoid entries likepam_unix(cron:session): session closed for user pi
([1]) - http://www.a-netz.de/2013/02/persistent-storage-with-ramdisks/
- Edit
Misc Q&A
- Q: Why does my Pi restart when hotplugging a USB drive?
- Q: Does Raspberry support WOL?
- A: No: the Ethernet chip is connected via USB (http://www.raspberrypi.org/forum/viewtopic.php?f=53&t=39714)
- Q: The new password is to short, or too simple
- A: Try adjusting the PAM settings in
/etc/pam.d/common-password
:- remove the 'obscure' setting for pam_unix.so, and add your desired minimum length (e.g. minlen=2)
password [success=1 default=ignore] pam_unix.so sha512 minlen=2
- !! This is not recommended if your box is connected to the internet or if it contains private data noone should know!!
- But it's nice for testing (if you cannot or do not want to use auto-login.)
- !! This is not recommended if your box is connected to the internet or if it contains private data noone should know!!
- Q: How to configure static IP?
- A: In /etc/network/interfaces:
iface eth0 inet static address 192.168.0.31 netmask 255.255.255.0 gateway 192.168.0.1
- Q: How to read core temperature, etc?
- A: vcgencmd:
vcgencmd measure_temp vcgencmd measure_clock arm
- External USB HDD spin down
- hdparm does not work with my WD Elements (SG_IO: bad host status: 0x7)
- hd-idle works:
hd-idle -a sda -i 600
- for details, see for example http://blog.is-a-geek.org/festplatten-in-den-standby-modus-versetzen-unter-ubuntu-desktopserver-mit-hd-idle (German)
- Q: How to avoid update of a certain package?
- A: Put package on hold ([2] (German)):
echo <paketname> "hold" | dpkg --set-selections
Useful stuff
- wikipedia:Raspcontrol with nginx
Things I want to (or might) try sometime
- Explore overclocking limits of my RaspBerry - currently I'm using medium set via
raspi-config
- NAS/Samba
- try adjusting 'socket options' in (/etc/samba/smb.conf) to increase NAS performance: some websites recommend to disable the 'socket options', some recommend to set:
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
- adjust memory split - smaller GPU memory for server
- ext4 vs ntfs for storage drive
- nfs [3] vs samba
- Temperature Sensor DS1820
- http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/temperature/
- https://www.raspiprojekt.de/anleitungen/schaltungen/9-1wire-mit-temperatursensor-ds18b20.html?showall=&start=1 (German)
- http://kopfkino.irosaurus.com/tutorial-ds18s20-temperatur-sensor-an-einem-raspberry-pi/ (German)
- http://raspberrywebserver.com/cgiscripting/rpi-temperature-logger/
- Adjust swap file (size, location -> (ext4) HDD - too slow?): http://manpages.ubuntu.com/manpages/hardy/man8/dphys-swapfile.8.html
- bfq IO scheduler BFQ to increase throughput
Some links
Project sites
Blogs, forums, etc
- http://www.raspberrypi.org/phpBB3/
- Stm Labs Forum / Raspbmc
- Wel!s Blog (German)
- Raspberry Pi Blog of Jan Karres (German)
Misc
Manuals