Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geli not working on rPi #6

Open
hcp123 opened this issue May 14, 2017 · 2 comments
Open

Geli not working on rPi #6

hcp123 opened this issue May 14, 2017 · 2 comments

Comments

@hcp123
Copy link

hcp123 commented May 14, 2017

Hi.
I've tried following your guide, and ended up using the premade image for rPi.
However I'm stuck at initializing the geli system for the external disk. Basically it just does not work.

root@knox:~ # geli init -s 4096 -PK /tmp/knox-geli-key /dev/da0

Metadata backup can be found in /var/backups/da0.eli and
can be restored with the following command:

	# geli restore /var/backups/da0.eli /dev/da0

root@knox:~ # geli attach -pk /tmp/knox-geli-key /dev/da0 
geli: Wrong key for da0.

Same thing with a simple passphrase:

> root@knox:~ # geli init  /dev/da0
> Enter new passphrase: 
> Reenter new passphrase: 
> 
> Metadata backup can be found in /var/backups/da0.eli and
> can be restored with the following command:
> 
> 	# geli restore /var/backups/da0.eli /dev/da0
> 
> root@knox:~ # geli attach  /dev/da0
> Enter passphrase: 
> geli: Wrong key for da0.
> 

I found this thread from 2015 about the issue, but no verified solution, just a suggestion to recompile the eli libraries.
I'll try this, but it will probably take some time.

Any other suggestions? And how did you get it working in your system?

Thanks

@hcp123
Copy link
Author

hcp123 commented May 14, 2017

Answering my own question here.
I followed this thread (forgot the link abow):
http://freebsd.1045724.x6.nabble.com/quot-geli-Wrong-key-quot-unable-to-attach-in-RPi-ARM-environment-td5987915.html
(Short answer, patch here: http://freebsd.1045724.x6.nabble.com/attachment/5990996/0/g_eli_key.c.patch )
Then recompile the eli shared library:
(This is copy/paste from the thread mentioned above, instructions and patch are from Daisuke Aoyama )

How to use this patch on running system:


If you don't have source tree, check out with your kernel version specified by "-r".
# uname -v
FreeBSD 11.0-CURRENT #0 r277169M: Wed Jan 14 22:06:07 JST 2015
[hidden email]:/usr/local/src/crochet-freebsd/work/obj/arm.armv6/usr/src/sys/RPI-B-test22
# svnlite checkout -r 277169 svn://svn.FreeBSD.org/base/head /usr/src

Apply the patch
# cd /usr/src
# patch < /path/to/g_eli_key.c.patch

Build the patched shared library
# cd /usr/src/sbin/geom/class/eli
# make && make install

Now you have patched shared library in /lib/geom/geom_eli.so
geli command use this library.

@hughobrien
Copy link
Owner

hughobrien commented May 14, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants