ZFS Can't rename a ZFS pool because it was previously in use from another system...

At the beginning I had two zpools named zroot. I have renamed one to zroot3,so now I have 3 zpools,1) zroot 2) zroot2 3) zroot3 ,but zroot and zroot3 can't live together. I should disable one of the disks from the BIOS. It seems that I could swap the cache files,but I'm not sure that I want to do that.
 
If you RENAMED one of two zroot to zroot3, and another to zroot2, shouldn't renamed ones has no longer the pool name zroot? Have you created third zroot later?
 
It may be broken... or are you sure that you have a pool on that partition?

I mean, you have not posted the output of zdb -l /dev/da5p4 here.

Nothing is broken. If from the BIOS I disable disk ada0,I can boot FreeBSD on da5. If I disable disk da5,I can boot FreeBSD on ada0. When I'm using FreeBSD on ada0,I don't see at all zpool. When I'm using FreeBSD on da5,I don't see at all zpool3.
 
Nothing is broken. If from the BIOS I disable disk ada0,I can boot FreeBSD on da5. If I disable disk da5,I can boot FreeBSD on ada0. When I'm using FreeBSD on ada0,I don't see at all zpool. When I'm using FreeBSD on da5,I don't see at all zpool3.
Can you post the outputs of:
  1. zdb -l /dev/ada0p4
  2. zdb -l /dev/da1p4
  3. zdb -l /dev/da5p4
 
Have you sanely exported zroot3 at least once, after renaming?
If not, possibly, its old name "zroot" is somehow still cached and avoiding for another zroot.
 
I can't export zroot or zroot3. Why ? because zroot does not recognize root3 and viceversa and I can't export zroot or zroot3 when they are running. If I boot FreeBSD using FreeBSD installed on a ufs2 file system I can't export zroot or zroot3 because they haven't been even imported.
 
I can't export zroot or zroot3. Why ? because zroot does not recognize root3 and viceversa and I can't export zroot or zroot3 when they are running. If I boot FreeBSD using FreeBSD installed on a ufs2 file system I can't export zroot or zroot3 because they haven't been even imported.
Please show us the output of all these commands:

  1. zdb -l /dev/ada0p4
  2. zdb -l /dev/da1p4
  3. zdb -l /dev/da5p4
 
Code:
root@marietto:/usr/home/marietto/Desktop # zdb -l /dev/ada0p4
------------------------------------
LABEL 0  
------------------------------------
    version: 5000
    name: 'zroot3'
    state: 0
    txg: 355209
    pool_guid: 7607196024616605116
    errata: 0
    hostname: 'marietto'
    top_guid: 8357560681389834947
    guid: 8357560681389834947
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 8357560681389834947
        path: '/dev/gpt/zfs0'
        phys_path: 'id1,enc@n3061686369656d30/type@0/slot@2/elmdesc@Slot_01/p4'
        whole_disk: 1
        metaslab_array: 256
        metaslab_shift: 32
        ashift: 12
        asize: 497681956864
        is_log: 0
        create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
    labels = 0 1 2 3

Code:
root@marietto:/usr/home/marietto/Desktop # zdb -l /dev/da8p4
------------------------------------
LABEL 0  
------------------------------------
    version: 5000
    name: 'zroot3'
    state: 0
    txg: 108394
    pool_guid: 7607196024616605116
    errata: 0
    hostname: ''
    top_guid: 8357560681389834947
    guid: 8357560681389834947
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 8357560681389834947
        path: '/dev/diskid/DISK-2015020204055Ep4'
        phys_path: 'id1,enc@n3061686369656d30/type@0/slot@2/elmdesc@Slot_01/p4'
        whole_disk: 1
        metaslab_array: 256
        metaslab_shift: 32
        ashift: 12
        asize: 497681956864
        is_log: 0
        create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
    labels = 0 1 2 3

Code:
root@marietto:/usr/home/marietto/Desktop # zdb -l /dev/da2p4
------------------------------------
LABEL 0  
------------------------------------
    version: 5000
    name: 'zroot2'
    state: 0
    txg: 2270196
    pool_guid: 17629264177669490151
    errata: 0
    hostid: 2866736267
    hostname: 'marietto'
    top_guid: 9893295991557613629
    guid: 9893295991557613629
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 9893295991557613629
        path: '/dev/gptid/4f4c8af2-2ec0-11ed-8ff9-e0d55ee21f22'
        whole_disk: 1
        metaslab_array: 256
        metaslab_shift: 33
        ashift: 12
        asize: 997778259968
        is_log: 0
        DTL: 216
        create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
    labels = 0 1 2 3
 
Both /dev/ada0p4 an /dev/da8p4 have the pool name zroot3, while /dev/da2p4 has the pool name zroot2. There's no pool named"zroot" anymore.
Both of previous zroot were renamed to zroot3, having the same pool_guid.
See "name:" lines and "pool_guid:" lines of each output.
 
Both /dev/ada0p4 an /dev/da8p4 have the pool name zroot3, while /dev/da2p4 has the pool name zroot2. There's no pool named"zroot" anymore.
Both of previous zroot were renamed to zroot3, having the same pool_guid.
See "name:" lines and "pool_guid:" lines of each output.
Yes, and the same GUID sound like a carbon copy of an original pool. One cannot expect to import two pools with the same GUID. The name probably is not that important (I am not sure).

zpool reguid <pool>

There is zpool-reguid(8)
 
Wait. /dev/ada0p4 is OK. But /dev/da8p4 and /dev/da2p4? According to #9 in this thread, you had /dev/ada0, /dev/da1 and /dev/da5, each has p4 as ZFS. And what Argentum requested at #36 was based on #9.
Do geom providers changed for da* after #9?
 
ada0 is a SATA disk ; its label does not change. da5 (before) and da8 (now) is the same USB disk. It's an USB disk ; the USB enumeration changes easily. The disks with the same zpool name and IDs are "CT500MX500SSD4" and "TOSHIBA External USB 3.0" :

Code:
1. Name: ada0
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e4
descr: CT500MX500SSD4
   lunid: 500a0751e20b2ae5
   ident: 1924E20B2AE5
   rotationrate: 0
   fwsectors: 63
   fwheads: 16
Geom name: da8
Providers:

=>       40  976773095  ada0  GPT  (466G)
         40     532480     1  efi  (260M)
     532520       1024     2  freebsd-boot  (512K)
     533544        984        - free -  (492K)
     534528    4194304     3  freebsd-swap  (2.0G)
    4728832  972044288     4  freebsd-zfs  (464G)
  976773120         15        - free -  (7.5K)

1. Name: da8
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
descr: TOSHIBA External USB 3.0
   lunid: 5000000000000001
   ident: 2015020204055E
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

=>        40  3907029095  da8  GPT  (1.8T)
          40      532480    1  efi  (260M)
      532520        1024    2  freebsd-boot  (512K)
      533544         984       - free -  (492K)
      534528     4194304    3  freebsd-swap  (2.0G)
     4728832   972044288    4  freebsd-zfs  (464G)
   976773120  2930255872    5  ms-basic-data  (1.4T)
  3907028992         143       - free -  (72K)
 
Wouldn't it needed one of two zroot3 to be detached physically?
Without it, I suspect both could be reguid'ed at the same time.

exactly. I'm forced to detach one of those 2 disks...but I would like to keep both connected...
 
You say to do :

# zpool reguid <pool>

ok,but what's the value of <pool> ? Can I change the zpool name while FreeBSD is running there ?
 
So, detach one of those disks, then run # zpool reguid <pool> on the other one. Yeah, that can be time-consuming, and you gotta keep track of what you removed/kept.

Well, you can run zpool list to figure out the name of the zpool you want to use.

Try reading the zpool(8) manpage for hints.
 
Assuming what can be disconnect is USB ones only.
(Means, I'm assuming you cannot disconnect /dev/ada0 but can disconnect the USB drive containing zroot3.)

If you can boot from zroot2, boot from there with USB drive containing zroot3 disconnected, then, import zroot3 (on /dev/ada0p4) with -R option specifying alternate root (for example, /mnt) and reguid zroot3.

if you cannot, boot from, for example, installation image (live system) on USB memstick. All others should be the same as boot-from-zroot2 example.

You should be better renaming zroot3 which is reguid'ed not to conflict by name with zroot3 on USB drive. After that, USB drive containing zroot3 can be attached again.
 
You say to do :

# zpool reguid <pool>

ok,but what's the value of <pool> ? Can I change the zpool name while FreeBSD is running there ?
One of the zroot3-s does not have hostname: 'marietto' because it is not imported (this might not be important at all). It cannot be imported because it has the same GUID as your already imported zroot3. Reguid this and you will have 2 different guids on these pools. See what happens.

Reguid the pool you have imported, in your case zpool reguid zroot3 This is instant. Now the other pool shall have the original GUID and your working pool will have a new GUID. See with zdb

[some time later]

Also forgot to m mention that zpool import lists only pools available for import. After you have reguided the first zroot3, you should see the other listed for import with the same name. Now you can import it with a new name. (at least I hope so)
 
Da Linux :

Code:
root@Z390-AORUS-PRO-DEST:/home/ziomario/Scrivania# zpool import
   pool: zroot2
     id: 17629264177669490151
  state: ONLINE
status: The pool was last accessed by another system.
 action: The pool can be imported using its name or numeric identifier and
        the '-f' flag.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-EY
 config:

        zroot2      ONLINE
          sdg       ONLINE

   pool: zroot3
     id: 7607196024616605116
  state: ONLINE
status: Some supported features are not enabled on the pool.
        (Note that they may be intentionally disabled if the
        'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
 config:

        zroot3      ONLINE
          sdh       ONLINE

root@Z390-AORUS-PRO-DEST:/home/ziomario/Scrivania# zpool reguid zroot3
cannot open 'zroot3': no such pool

root@Z390-AORUS-PRO-DEST:/mnt/zroot3# zpool import -f -R /mnt/zroot3 zroot3
root@Z390-AORUS-PRO-DEST:/mnt/zroot3# zpool reguid zroot3
OK.

Now,I would also change the name of this zpool,let's say from zpool3 to zpool1. What's the proper command to issue ?
 
Back
Top