Auto start encrypted array, Pizero Help


Recommended Posts

As per the title, as of the latest unraid version 6.12, what's the best way to auto start an encrypted array?

 

I never used to mind entering the passphrase, however I have since installed OPNsense, therefore I need the system to auto boot if it ever goes down & automatically start the OPNsense VM.

 

My thinking is to have a Pi Zero (lan adapted) hidden somewhere is the house attached to the network, if the unraid server goes down then it automatically pulls the keyfile and starts the array, therefore in the unfortunate instance of the server being stolen, it would not find the pi/keyfile and therefore not start the array leaving the data encrypted.

 

If anyone is doing this, instructions would be great please.

Edited by DaFr0n
Link to comment
Posted (edited)

Ok so far I have done the below:

 

  • Headless Raspbian install on Pizero connected via LAN
  • Installed vsftpd
  • Saved a keyfile on the Pizero
  • SSH directly into Pi from unraid console to generate keypair
  • Tested the wget from the Pizero to unraid, trial and error but I got the transfer to work successfully, though its only ftp, everything else SFTP, curl, threw errors:
    • wget --user=USER --password='PASSWORD' ftp://192.168.4.28/keyfile -O /root/keyfile

  • Amended the go file:

    • #!/bin/bash

       

      # get keyfile

      wget --user=USER --password='PASSWORD' ftp://192.168.4.28/keyfile -O /root/keyfile

       

      # Start the Management Utility

      /usr/local/sbin/emhttp &

 

  • This is where I'm struggling, if I put the wget to the bottom of the go file, then it boots but it wont auto start however the keyfile is there in 'MAIN' , assume its auto starting before it fully pulls the keyfile. If I put the wget as per the above, before /usr/local/sbin/emhttp &, then it wont show the webgui or fully boot.

 

Any ideas?

Edited by DaFr0n
Added step 4
Link to comment
  • DaFr0n changed the title to Auto start encrypted array, Pizero Help
Posted (edited)

**UPDATE**

 

Looks like the Pizero hasnt yet got its static IP during boot, therefore before OPNsense is running I need to use host instead of the IP:

The file does transfer to unraid, however the server wont start, inspecting the transferred file in nano its actually blank.

If I do a wget with the system already up and running it pulls fine, therefore why is the keyfile coming over blank during boot?

 

***UPDATE***

 

Scratch the file transferring I had -O which was creating a blank log file. 

I also tried --tries=0 but it doesn't make a difference. 

 

I'm at a loss

Edited by DaFr0n
Added further update
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.