Mounting an encrypted zfs GELI partition - zpool?

quakerdoomer

Member

Reaction score: 1
Messages: 69

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

Member

Reaction score: 54
Messages: 82

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

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

See Thread 66603.
 
OP
OP
Q

quakerdoomer

Member

Reaction score: 1
Messages: 69

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

Son of Beastie

Reaction score: 1,726
Messages: 3,546

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.
 
OP
OP
Q

quakerdoomer

Member

Reaction score: 1
Messages: 69

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.
 

roccobaroccoSC

Well-Known Member

Reaction score: 96
Messages: 426

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
 
Top