Got my RockPro64 today.
NOTE: Updated with step 7. Now it survives a reboot!
First experiment: RAID1 on SATA via BTRFS, with boot on SD card
Result: easy! Not hard once you know what you're doing!
Steps:
And that's it!
If you want to use mdraid, it's going to be a little bit more work. You'll have to modify the nand-sata-install script, because it wants to format a partition. You'll have to remove that formatting part from the script and make it use a pre-formatted partition.
NOTE: Updated with step 7. Now it survives a reboot!
First experiment: RAID1 on SATA via BTRFS, with boot on SD card
Result: easy! Not hard once you know what you're doing!
Steps:
- Image an SD card with Armbian and boot up
- SSH in to it, login as root, and follow the prompts to create a user account
- Re-login via the user account (no strictly necessary, but I like a little protection from messing up the system as root)
- Partition the disks
- sudo fdisk /dev/sda
- create a partition table
- create a new partition to fill the disk
- repeat for /dev/sdb
- sudo fdisk /dev/sda
- sudo nand-sata-install
- Select the option "Boot from SD - system on SATA..."
- Choose the partition /dev/sda1
- Choose the filesystem btrfs
- Allow it to complete and then reboot the system
- Select the option "Boot from SD - system on SATA..."
- Now that your root directory is on /dev/sda1, time to make it a RAID1
- sudo btrfs device add /dev/sdb1 / #adds /dev/sdb1 to the filesystem
- sudo btrfs balance start -dconvert=raid1 -mconvert=raid1 / #converts the two-drive filesystem to RAID1
- sudo btrfs device add /dev/sdb1 / #adds /dev/sdb1 to the filesystem
- VERY IMPORTANT: DO THIS BEFORE REBOOTING!!!
- As root (or with sudo), create a file "/etc/initramfs-tools/scripts/local-top/btrfs" with the following contents:
Code:#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
. /scripts/functions
# Begin real processing below this line
if [ ! -x /bin/btrfs ]; then
log_warning_msg "/bin/btrfs does not exist or is not executable"
fi
/bin/btrfs device scan - Make the file executable: "sudo chmod a+x /etc/initramfs-tools/scripts/local-top/btrfs"
- Rebuild the initramfs image: "sudo update-initramfs -u"
- As root (or with sudo), create a file "/etc/initramfs-tools/scripts/local-top/btrfs" with the following contents:
- Reboot
And that's it!
If you want to use mdraid, it's going to be a little bit more work. You'll have to modify the nand-sata-install script, because it wants to format a partition. You'll have to remove that formatting part from the script and make it use a pre-formatted partition.