# 8.0-RC3 vs. geli (Problem finding encrypted partitions)



## siffre (Nov 16, 2009)

I have bumped into some truble when upgrading my primary computer from 7.2-RELEASE to 8.0-RC3. I'm running full disk encryption (exept for /boot, obviously) using geli. One encrypted device containing several partitions.

I'll illustrate the problem wih some output.

With the harddrive plugged into a different computer running 7.2R it all works fine:

```
[B]a701# uname -a[/B]
FreeBSD a701 7.2-RELEASE-p4 FreeBSD 7.2-RELEASE-p4 #0: Fri Oct  2 12:21:39 UTC 2009  root@i386-builder.daemonology.net:/usr/obj/usr/src/sys GENERIC  i386
[B]a701# geli attach da1s1b[/B]
Enter passphrase:
[B]a701# dmesg[/B]
...
GEOM_ELI: Device da1s1b.eli created.
GEOM_ELI: Encryption: AES-CBC 256
GEOM_ELI:     Crypto: software
GEOM_LABEL: Label for provider da1s1b.elia is ufsid/4873c61699a06345.
GEOM_LABEL: Label for provider da1s1b.elid is ufsid/4873c61ff022a68c.
GEOM_LABEL: Label for provider da1s1b.elie is ufsid/4873c6255c17f6a1.
GEOM_LABEL: Label for provider da1s1b.elif is ufsid/4873c62de26a02b4.
GEOM_LABEL: Label for provider da1s1b.elig is ufsid/4873c63f7b3c12a2.
[B]a701# ls /dev/da1s1b*[/B]
/dev/da1s1b             /dev/da1s1b.elib        /dev/da1s1b.elie
/dev/da1s1b.eli         /dev/da1s1b.elic        /dev/da1s1b.elif
/dev/da1s1b.elia        /dev/da1s1b.elid        /dev/da1s1b.elig
```
Please notice all the pretty partitions. Just waiting to be mounted.

But with the same harddrive connected to a computer running 8.0-RC3, something goes bad:
	
	



```
[B]ct# uname -a[/B]
FreeBSD ct 8.0-RC3 FreeBSD 8.0-RC3 #0: Tue Nov 10 07:50:36 UTC 2009 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
[B]ct# geli attach da0s1b[/B]
Enter passphrase:
[B]ct# dmesg[/B]
...
GEOM_ELI: Device da0s1b.eli created.
GEOM_ELI: Encryption: AES-CBC 256
GEOM_ELI:     Crypto: software
[B]ct# ls /dev/da0s1b*[/B]
/dev/da0s1b     /dev/da0s1b.eli
```
And that's it. The partitions inside the geli device are not found.

Having a look at the label (still at 8.0-RC3), they are there, and decryption works. So why are they not found? 

```
[B]ct# bsdlabel da0s1b.eli[/B]
# /dev/da0s1b.eli:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   964608       16    4.2BSD     2048 16384 60296
  b:   819200   964624      swap
  c: 624732768        0    unused        0     0         # "raw" part, don't edit
  d:  1683456  1783824    4.2BSD     2048 16384 28552
  e:   880640  3467280    4.2BSD     2048 16384 55048
  f: 16384000  4347920    4.2BSD     2048 16384 28552
  g: 604000848 20731920    4.2BSD     2048 16384 28552
```

This means I'm very stuck after the first reboot in the upgrade process, since my root filesystem is inaccessible. 

Does anybody have any suggestions to what might be causing this?


----------



## graudeejs (Nov 17, 2009)

hmm, that's weird, I have full HDD encryption as well.
I use key only to decrypt, and I have no problems


```
FreeBSD killasmurf86.pc 8.0-RC3 FreeBSD 8.0-RC3 #0: Fri Nov 13 16:14:51 EET 2009
killasmurf86@killasmurf86.pc:/usr/obj/usr/src/sys/ANTIGENERIC  i386
```


----------



## jb_fvwm2 (Nov 17, 2009)

Loading geom_bsd.ko, geom_mbr.ko, and geom_label.ko,
one or more of those fixed /dev detection (more 
devices found) on _8 stable.
(here anyway.)
 If you can load them 
before the boot ((boot> ) or something, or loader.conf,)
a chance it would help... not certain but...


----------



## siffre (Nov 17, 2009)

Thanks, geom_bsd fixed it. Almost to good. I got tons of partitions now.

On 8.0-RC3:
	
	



```
[B]ct# ls /dev/da0s1b*[/B]
/dev/da0s1b		/dev/da0s1b.elica	/dev/da0s1b.elid
/dev/da0s1b.eli		/dev/da0s1b.elicb	/dev/da0s1b.elie
/dev/da0s1b.elia	/dev/da0s1b.elicd	/dev/da0s1b.elie
/dev/da0s1b.elia	/dev/da0s1b.elice	/dev/da0s1b.elif
/dev/da0s1b.elib	/dev/da0s1b.elicf	/dev/da0s1b.elif
/dev/da0s1b.elib	/dev/da0s1b.elicg	/dev/da0s1b.elig
/dev/da0s1b.elic	/dev/da0s1b.elid	/dev/da0s1b.elig
```

With the harddrive back in the machine where it belongs, it worked fine to boot (with geom_bsd), but I was asked for a passphrase for ad4s1cb. I have no such partition. :\ 

```
[B]asus% ls /dev/ad4*[/B]
/dev/ad4		/dev/ad4s1b.elic	/dev/ad4s1b.elie
/dev/ad4s1		/dev/ad4s1b.elica	/dev/ad4s1b.elif
/dev/ad4s1a		/dev/ad4s1b.elicb	/dev/ad4s1b.elig
/dev/ad4s1b		/dev/ad4s1b.elicd	/dev/ad4s1c
/dev/ad4s1b.eli		/dev/ad4s1b.elice	/dev/ad4s1ca
/dev/ad4s1b.elia	/dev/ad4s1b.elicf	/dev/ad4s1cb
/dev/ad4s1b.elib	/dev/ad4s1b.elicg
/dev/ad4s1b.elib.eli	/dev/ad4s1b.elid
[B]asus% bsdlabel ad4s1[/B]
# /dev/ad4s1:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   409600       16    4.2BSD     2048 16384 25608 
  b: 624732769   409616    4.2BSD        0     0     0 
  c: 625142385        0    unused        0     0         # "raw" part, don't edit
[B]asus% bsdlabel ad4s1b.eli[/B]
# /dev/ad4s1b.eli:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   964608       16    4.2BSD     2048 16384 60296 
  b:   819200   964624      swap                    
  c: 624732768        0    unused        0     0         # "raw" part, don't edit
  d:  1683456  1783824    4.2BSD     2048 16384 28552 
  e:   880640  3467280    4.2BSD     2048 16384 55048 
  f: 16384000  4347920    4.2BSD     2048 16384 28552 
  g: 604000848 20731920    4.2BSD     2048 16384 28552
```
So geom_bsd seems to find the other partitions again on the 'c'-partition. How to fix that? :e

But I'm back on track with the upgrade, currently rebuilding all ports.


----------

