# No GELI on my bread - Cannot mount /dev/md0.eli



## quakerdoomer (Oct 5, 2009)

I am unable to

```
mount /dev/md0.eli
```

Here is what I have done :

```
dd if=/dev/urandom of=geli.vol bs=1M count=1024

DIGITAL-TRAITOR# mdconfig -a -t vnode -f geli.vol -u 0
DIGITAL-TRAITOR# dd if=/dev/urandom of=geli.key bs=56 count=1
1+0 records in
1+0 records out
56 bytes transferred in 0.000068 secs (824144 bytes/sec)
DIGITAL-TRAITOR# ls -l da*
-rw-r--r--  1 root  wheel          56 Oct  5 12:59 geli.key
-rw-r--r--  1 root  wheel  1073741824 Oct  5 12:57 geli.vol


DIGITAL-TRAITOR# geli init -s 4096 -e Blowfish -l 448 -K geli.key  /dev/md0
Enter new passphrase:

DIGITAL-TRAITOR# geli init -s 4096 -e Blowfish -l 448 -K geli.key /dev/md0
Enter new passphrase:
Reenter new passphrase:

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

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

DIGITAL-TRAITOR#

DIGITAL-TRAITOR# pwd
/root
DIGITAL-TRAITOR# geli attach -d -k geli.key /dev/md0
Enter passphrase:
dgeli: Wrong key for md0.
DIGITAL-TRAITOR# geli attach -d -k geli.key /dev/md0
Enter passphrase:
###########################################
## Perform the below command only once after creation ##
DIGITAL-TRAITOR# newfs -U /dev/md0.eli
/dev/md0.eli: 1024.0MB (2097144 sectors) block size 16384, fragment size 4096
 using 4 cylinder groups of 256.00MB, 16384 blks, 16384 inodes.
 with soft updates
super-block backups (for fsck -b #) at:
 160, 524448, 1048736, 1573024
###########################################
DIGITAL-TRAITOR#
DIGITAL-TRAITOR#  mount /dev/md0.eli /mnt
mount: /dev/md0.eli : No such file or directory
```

What's wrong in the above ?
x(


----------



## SirDice (Oct 5, 2009)

Wrong password?


----------



## quakerdoomer (Oct 5, 2009)

I did enter a wrong password once and it said :

```
dgeli: Wrong key for md0.
```

After that I entered it correctly and it didn't indicate any error, as we can see above.


----------



## SirDice (Oct 5, 2009)

Try attaching without the -d switch.


----------



## quakerdoomer (Oct 5, 2009)

It worked ! APACHEED _I don't know if anybody got this Poor Joke_
I can mount and dismount, attach and detatch my drives.
Thanks


----------



## khuman (Aug 15, 2019)

I have the same issue.
Creating memory disk and attach encrypted file success:

```
# mdconfig -l -v
md0     vnode    5120M  /1/crypted.disk
# geli status
   Name  Status  Components
md0.eli  ACTIVE  md0
```


```
Aug 15 20:33:15 kernel: GEOM_ELI: Device md0.eli created.
Aug 15 20:33:15 kernel: GEOM_ELI: Encryption: AES-XTS 128
Aug 15 20:33:15 kernel: GEOM_ELI:     Crypto: software
```
 But when I try to mount /dev/md0.eli device I've got:


```
# mount /dev/md0.eli /mnt
mount: /dev/md0.eli: No such file or directory
#
```


```
FreeBSD 12.0-STABLE FreeBSD 12.0-STABLE #0 r346594M: Wed Apr 24 09:50:11 EEST 2019     root@localhost:/usr/obj/usr/src/i386.i386/sys/GENERIC  i386
```
This encrypted very important for me.
Any ideas?


----------



## NapoleonWils0n (Aug 15, 2019)

khuman said:


> I have the same issue.
> Creating memory disk and attach encrypted file success:
> 
> ```
> ...


Hi *khuman*

I wrote a guide on how to create encrypted geli containers on the Forum

Heres my notes about the steps on creating a encrypted gei container on github
and i also wrote a script called ossuary to automate mounting and unmounting the geli container


----------



## khuman (Aug 15, 2019)

NapoleonWils0n said:


> Hi *khuman*
> 
> I wrote a guide on how to create encrypted geli containers on the Forum
> 
> ...


You made great job. Interesting script and HowTo.
I used this algorithm already many years. And today happened this inexplicable situation. And I can't find solution for fixing. No warning or error information in stdout or log


----------



## getopt (Aug 15, 2019)

When having problems first have a look what you have with `ls -l /dev/md*`. If you have tried several times mdconfig without the -u option you might have something other than md0.
From what you posted above I do not see any `geli attach [-d] /dev/md<unit>`.
After that and having entered your passphrase you can `mount /dev/md<unit>.eli`.


----------



## Tracker (Dec 17, 2022)

Was this issue resolved?

I'm getting a similar error (no such file or directory error) trying to mount a GELI encrypted drive after doing this successfully:
`geli attach /dev/driveXpY
Enter passphrase:`
GELI status.command shows it to be active with '.eli' extension 
However it won't mount



`mount /dev/driveXpY.eli /mnt/
mount: /dev/driveXpY.eli no such file or directory`


----------



## Alain De Vos (Dec 17, 2022)

A small script to test geli on zfs, maybe you find it usefull,
cat test_geli 

```
#!/usr/local/bin/zsh -v
kldload geom_eli.ko
zfs create -V 5G ZT/private
zfs set volmode=full ZT/private
dd if=/dev/random of=mykey bs=64 count=1
/bin/ls /dev/zvol/ZT/private
geli init -s 4096 -K ./mykey /dev/zvol/ZT/private 
/bin/ls /dev/zvol/ZT/private
geli attach -k ./mykey /dev/zvol/ZT/private 
zpool create gelipool /dev/zvol/ZT/private.eli 
zpool export gelipool
geli detach /dev/zvol/ZT/private.eli 
zfs destroy ZT/private
```


----------



## Alain De Vos (Dec 17, 2022)

A small script to test geli on ufs,
cat test_geli_ufs 

```
#!/usr/local/bin/zsh -v
kldload geom_eli.ko
dd if=/dev/zero of=./private bs=1G count=5
mdconfig -u md10 -a -t vnode ./private
dd if=/dev/random of=mykey bs=64 count=1
geli init -s 4096 -K ./mykey /dev/md10 
geli attach -k ./mykey /dev/md10
newfs -O 2 -U -j /dev/md10.eli
mkdir /mnt/md10
mount /dev/md10.eli /mnt/md10
touch /mnt/md10/test
umount /mnt/md10
geli detach /dev/md10.eli
mdconfig -du md10
rm ./private
```


----------



## Tracker (Dec 17, 2022)

Alain De Vos said:


> A small script to test geli on ufs,
> cat test_geli_ufs
> 
> ```
> ...


Thanks. So basically I'm on a live cd - Freebsd 13.1- RELEASE. Guessing that comes with zfs loaded modules? 'Zfs list' command says "no datasets available"

When I try to do kldload geom_eli.ko it says the module is already loaded. Not sure why it won't mount the drive specially after 'geli attach' seems to work normally


----------



## Alain De Vos (Dec 17, 2022)

Is this working fine ?

```
mkdir /mnt/md10
```


----------



## Tracker (Dec 17, 2022)

Alain De Vos said:


> Is this working fine ?
> 
> ```
> mkdir /mnt/md10
> ```


Yes. Earlier it was in read only mode. I ran "mount -u -w /" for things to be writeable ( saw in one of the forum posts).
 Ls shows md10 as a directory under /mnt


----------

