As at April 2nd, 2018 there is an issue with the raspberrypi-kernel/stable 1.20180328-1 armhf release of the kernel. Unsure what the issue but the kubernetes master would system would "kernel panic" and restart.
So as a temporary work around I pinned the upgrades that are prefixed raspberrypi.
I created a file called raspberry and added to the /etc/apt/preferences.d directory with the following contents.
cd /etc/apt/preferences.d && sudo nano raspberry
Package: raspberrypi*
Pin: release *
Pin-Priority: -5
save and rerun the apt upgrade process which will exclude the kernel updates.
sudo apt update && sudo apt list --upgradable && sudo apt dist-upgrade -y
https://cloud.google.com/compute/docs/troubleshooting/known-issues#keyexpired
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
and you'll see that the files starting with raspberrypi are exluded from the upgrade candidate list.
Reduce writes to the SD Card and increase IO performance by mapping the /tmp and /var/log directories to RAM. Note you will lose the contents of these directories on reboot.
echo "tmpfs /tmp tmpfs defaults,noatime 0 0" | sudo tee -a /etc/fstab && \
echo "tmpfs /var/log tmpfs defaults,noatime,size=16m 0 0" | sudo tee -a /etc/fstab
If using Raspberry Pi Lite (Headless) you can reduce the memory split between the GPU and the rest of the system down to 16mb.
echo "gpu_mem=16" | sudo tee -a /boot/config.txt
Scans network for active IP Addresses
$ sudo apt install nmap
$ nmap -sn 192.168.2.0/24
$ sudo apt install bmon
$ bmon
See Welcome to Fabric for more information.
Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.
It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.
from fabric.api import *
env.hosts = [
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]'
]
env.password = 'raspberry'
@parallel
def cmd(command):
sudo(command)
to execute ensure fabfile.py in path or current directory
$ fab cmd:"sudo reboot"
Acknowledgements: This notes are a summary of Attach USB storage to your Raspberry Pi. Read Alex's article for a full explanation.
It may be necessary to 'unmount' the storage if it auto loaded in the context of your session
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 118G 0 disk
└─sda1 8:1 0 118G 0 part
mmcblk0 179:0 0 29.8G 0 disk
├─mmcblk0p1 179:1 0 41.8M 0 part /boot
└─mmcblk0p2 179:2 0 29.8G 0 part /
The 'sda' disk is the external storage device.
$ sudo fdisk /dev/sda
Use the following commands
- o - wipe existing partitions
- n - create new partition and take all the defaults
- w - write the changes
- q - to quit
$ sudo fdisk -l /dev/sda
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 247463935 247461888 118G 83 Linux
$ sudo mkfs.ext4 -L SSDRIVE1 /dev/sda1
$ sudo mkdir /mnt/ssdrive1
$ sudo nano /etc/fstab
Add the following line.
LABEL=SSDRIVE1 /mnt/ssdrive1 ext4 defaults,noatime,rw,nofail 0 1
Note: I wanted all users to have full permissions on the drive so it's also marked with the 'rw' property.
The tmpfs lines move temp and log directories to ram to reduce wear on the SD Card.
proc /proc proc defaults 0 0
PARTUUID=ccccbc57-01 /boot vfat defaults 0 2
PARTUUID=ccccbc57-02 / ext4 defaults,noatime 0 1
LABEL=SSDRIVE1 /mnt/ssdrive2 ext4 defaults,noatime,rw,nofail 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
tmpfs /tmp tmpfs defaults,noatime 0 0
tmpfs /var/log tmpfs defaults,noatime,size=16m 0 0
Reboot your Raspberry Pi.
sudo reboot
From the File Manager review the permissions of your SSD storage. From the permissions tab of the mount point '/mnt/ssdrive1' then 'anyone' should have all permissions'.
Alternatively from command line.
$ ls -l
The permission set should be as follows.
drwxrwxrwx 4 root root 4096 Apr 6 21:55 ssdrive1
If not then set the permissions.
sudo chmod -R 777 /mnt/ssdrive1/
See an explanation of file permissions
Notes
- Use 'pv' to provide backup progress information.
- pv -s 32G signifies that the SD Card is 32GB and is used to estimate the copy time.
$ sudo apt install pv -y
$ sudo dd if=/dev/mmcblk0 | pv -s 32G | dd of=~/rpi3plus.img
$ sudo apt install pv -y
$ sudo dd if=~/rpi3plus.img | pv -s 32G | dd of=/dev/mmcblk0
sudo dd if=k8smaster.img | pv -s 16G | dd bs=1M of=/dev/mmcblk0
sudo dd if=~/media/data/RaspberryPiBacku/k8smaster.img | pv -s 32G | dd of=/dev/mmcblk0
Test performance of a variety of microSD cards on Raspberry Pi