# Mounting an encrypted zfs GELI partition - zpool?



## quakerdoomer (Mar 23, 2019)

Using a live media, I have taken a dd image of my main encrypted zfs GELI FreeBSD partition (not the entire disk) and of the encrypted key file as well.
The dd image and the encrypted file are on an external disk now.
Now I started FreeBSD normally, I did mdconfig and did a geli attach of the dd image file. I fed it the password and it created the .eli  inside /dev

My question is what next? I want to mount this md1.eli onto /mnt


----------



## swegen (Mar 23, 2019)

You can list the available pools in the system:
`zpool import`

and import your pool:
`zpool import -R /mnt poolname`

See Thread 66603.


----------



## quakerdoomer (Mar 23, 2019)

I was waiting for someone to suggest me 'zpool import'. The thing is that 'zpool import'  displays no output
If I try 'zpool import zroot' , it  says
".. pool with that name is already created.."

zpool list says:
bootpool and zroot (Both of the current OS disk I assume)

I also did 'strings /dev/md1.eli | more' and I could see a lot of my decrypted data.
A plain mount doesn't work because the partition wasn't UFS.


----------



## ShelLuser (Mar 23, 2019)

quakerdoomer said:


> I was waiting for someone to suggest me 'zpool import'. The thing is that 'zpool import'  displays no output


Then why not mention that right away? Otherwise you're only wasting people's time with this.

Alas, see zpool(8), you might be able to get better results using -aN, though you'd probably need to perform some tasks manually.

However, what I would do first is boot using some kind of rescue media (install CD or whatever) and then try to access the ZFS image from there. This will rule out any issues with pools which have the same name. Better yet: if this works then you can also easily rename the pool if you'd like.


----------



## quakerdoomer (Mar 23, 2019)

ShelLuser said:


> Then why not mention that right away? Otherwise you're only wasting people's time with this.


I did not because sometimes there's more than just one solution. Also I wasn't sure about the flow of commands using zpool.

I have tried a live media. Recent FreeBSD live releases have a pool labelled zroot already mounted.
How do I rename the pool of this backup image without mounting it?
Please refrain from replying if you consider it as a waste of time. Thank you.


----------



## D-FENS (Mar 23, 2019)

When importing the pool you can give an additional parameter with a new name.
Also, as the name is taken, you can import the pool by id instead of name. `zpool import` will show you the ids also:

`zpool import 11809215114195894163 zroot2`


----------



## D-FENS (Mar 23, 2019)

https://docs.oracle.com/cd/E19253-01/819-5461/gazuf/
		



> If the pool name conflicts with an existing pool name, you can import the pool under a different name. For example:
> 
> 
> 
> ...


----------

