Solved [ZFS] Two zpool's named zroot. Pulls data off the old zpool

jjthomas

Active Member

Reaction score: 7
Messages: 112

Code:
(12:51)ROOT@ambient:/root# uname -a
FreeBSD ambient.027esc.net 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

I just installed FreeBSD on a SSD. I also have FreeBSD installed on my 3TB HD. Both zpool's are named, zroot. When I boot to the FreeBSD on the SSD it boot's without any errors, but it is pulling my data from the HD installation. i.e. In the new installation, I do not have a prompt set, I am using the default. But when I su, I get my old fancy prompt, from the old FreeBSD installation.

What I think I need to do is rename my old zpool to zrootold. But how do I do that when it is in use?

TIA

-JJ
 

astyle

Daemon

Reaction score: 482
Messages: 1,117

Pull one drive out, boot the other one, rename it. THEN boot with both drives inside your box.
 
OP
J

jjthomas

Active Member

Reaction score: 7
Messages: 112

You gave me an idea for a search I had not tried. That led me to this thread that explained what I thought and gave me a solution.

What I ended up doing was disconnected the newly installed drive. Booted on my installation USB stick, and executed
Code:
zpool import zroot zold
Then I put the new drive in and booted again. The system pulled up the correct zroot. When I tried to import zold it complained that it was used by another file system
Code:
 zpool import -f zold
got the pool up ad running.

Thank you for helping.

-JJ
 

Argentum

Aspiring Daemon

Reaction score: 289
Messages: 610

What I ended up doing was disconnected the newly installed drive. Booted on my installation USB stick, and executed
Code:
zpool import zroot zold
Then I put the new drive in and booted again. The system pulled up the correct zroot. When I tried to import zold it complained that it was used by another file system
Code:
 zpool import -f zold
got the pool up ad running.
And as a general advice, I am personally always following, is that it a good idea to give ZFS pools a beautiful name when creating first time and not use the default zroot.
 
Top