Install OS on RAID1 thanks to dual SATA board?
#6
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:
  1. Image an SD card with Armbian and boot up
  2. SSH in to it, login as root, and follow the prompts to create a user account
  3. Re-login via the user account (no strictly necessary, but I like a little protection from messing up the system as root)
  4. Partition the disks
    1. sudo fdisk /dev/sda
    2. create a partition table
    3. create a new partition to fill the disk
    4. repeat for /dev/sdb
  5. sudo nand-sata-install
    1. Select the option "Boot from SD - system on SATA..."
    2. Choose the partition /dev/sda1
    3. Choose the filesystem btrfs
    4. Allow it to complete and then reboot the system
  6. Now that your root directory is on /dev/sda1, time to make it a RAID1
    1. sudo btrfs device add /dev/sdb1 / #adds /dev/sdb1 to the filesystem
    2. sudo btrfs balance start -dconvert=raid1 -mconvert=raid1 / #converts the two-drive filesystem to RAID1
  7. VERY IMPORTANT: DO THIS BEFORE REBOOTING!!!
    1. 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
    2. Make the file executable: "sudo chmod a+x /etc/initramfs-tools/scripts/local-top/btrfs"
    3. Rebuild the initramfs image: "sudo update-initramfs -u"
  8. 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.


Messages In This Thread
RE: Install OS on RAID1 thanks to dual SATA board? - by markb1 - 05-09-2019, 04:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  linux-headers and quartz64-post-install package conflicts Berzerkleyfan 2 642 12-01-2023, 05:17 AM
Last Post: Berzerkleyfan
  Star64: SATA Der Geist der Maschine 1 989 07-26-2023, 12:35 PM
Last Post: Gladox114
  PBP Debian 11 GRUB install error zlth 2 1,901 11-18-2022, 07:42 AM
Last Post: zlth
  SOQUARTZ Compute module W does not fit Raspberry Pi CM4 dev board ihab 0 1,544 10-06-2022, 08:46 PM
Last Post: ihab
  wrong launguage install chadace 1 4,027 06-08-2020, 08:31 PM
Last Post: chadace
  How to boot from the SD card and install to eMMC? ravanh 2 6,449 03-18-2020, 09:42 AM
Last Post: tophneal
  Rock64 suitable for headless TVHeadend install? elsmandino 3 6,449 06-26-2018, 11:37 AM
Last Post: Luke
  Here Is another mini-how-to to install Raspbian:DESKTOP/ETHERNET/HDMI speedro86 4 8,164 04-15-2018, 07:37 AM
Last Post: bunkerWHz
  My first Single Board! jjh221 4 6,761 04-09-2018, 06:52 PM
Last Post: jjh221
  sopine cluster board install Smurfbot 1 4,389 03-31-2018, 04:09 AM
Last Post: pfeerick

Forum Jump:


Users browsing this thread: 1 Guest(s)