This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Check all raid arrays for errors. | |
# | |
# Inspiration: | |
# https://wiki.archlinux.org/index.php/RAID#RAID_Maintenance | |
# | |
echo "Are we superuser?" | |
[[ $EUID -eq 0 ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# The boot partition cannot be RAIDed on an rPi. We can periodically sync it, and if the primary card | |
# fails, we are then able to just swap the the cards around. | |
# | |
FIRST_SD_CARD=/dev/mmcblk0 | |
FIRST_BOOT_PARTITION=${FIRST_SD_CARD}p1 | |
#FIRST_ROOT_PARTITION=${FIRST_SD_CARD}p2 | |
#FIRST_APP_PARTITION=${FIRST_SD_CARD}p3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Goal: | |
# madadm needs some periodic maintenance scripts - each one is documented in the script. | |
# | |
echo "Are we superuser?" | |
[[ $EUID -eq 0 ]] | |
echo "OK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Goal: | |
# Configure two partitions to work as RAID1. | |
# | |
# Prerequisites: | |
# 1. Run both 05-configure_root_raid_pass*. | |
# 2. Set the following variables: | |
# | |
FIRST_SD_CARD=/dev/mmcblk0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Goal: | |
# Configure two partitions (one already done) to work as RAID1. | |
# | |
# Inspiration: | |
# http://blog.drewwithers.com/2013/11/raspberry-pi-usb-raid1-root-partition.html | |
# https://wiki.archlinux.org/index.php/Convert_a_single_drive_system_to_RAID | |
# | |
# Prerequisites: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Goal: | |
# Configure two partitions (one currently in use) to work as RAID1. | |
# | |
# Inspiration: | |
# http://blog.drewwithers.com/2013/11/raspberry-pi-usb-raid1-root-partition.html | |
# https://wiki.archlinux.org/index.php/Convert_a_single_drive_system_to_RAID | |
# | |
# Prerequisites: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Goal: | |
# Configure initramfs to be able to use md (multi-disk) arrays. | |
# | |
# Inspiration: | |
# http://blog.drewwithers.com/2013/11/raspberry-pi-usb-raid1-root-partition.html | |
# | |
# Notes: | |
# The initramfs is tied to the current version of the kernel. Upgrading the kernel without upgrading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Goal: | |
# Tune the root filesystem. | |
# | |
# Notes: | |
# Not needed if building the RAID system. | |
# | |
# Prerequisites: | |
# 1. Run 01-write_image_to_card. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Goal: | |
# Prepare empty space on the card to be used as /app partition. | |
# | |
# Notes: | |
# After this script, first time the Raspberry is powered on, you will see an error: | |
# "Could not expand filesystem, please try raspi-config or rc_gui." | |
# This error can be safely ignored, or it can be turned off using the sed command from line 132 in | |
# file: $ROOT_PARTITION/usr/lib/raspi-config/init_resize.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Goal: | |
# Burn the Raspbian OS image to an SD card. | |
# | |
# Prerequisites: | |
# 1. Download image from https://www.raspberrypi.org/downloads/raspbian/. | |
# 2. Unzip the image. | |
# 3. Set the following variables: | |
# |