Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 2020 19:10:31 +0300
From:      Mamontov Roman <mr.xanto@gmail.com>
To:        freebsd-stable@freebsd.org
Subject:   How prevent GEOM providers to use adaX labels?
Message-ID:  <558957699.20200828191031@gmail.com>

next in thread | raw e-mail | index | archive | help
Hello.

I have two disk with next partitions:

#gpart show
=>         40  11721045088  ada0  GPT  (5.5T)
           40         1024     1  freebsd-boot  (512K)
         1064     16777216     2  freebsd-swap  (8.0G)
     16778280  11704266848     3  freebsd-zfs  (5.5T)

=>         40  11721045088  ada1  GPT  (5.5T)
           40         1024     1  freebsd-boot  (512K)
         1064     16777216     2  freebsd-swap  (8.0G)
     16778280  11704266848     3  freebsd-zfs  (5.5T)

Then these partitions are combined on GEOM and ZFS mirrors:

#gmirror status
       Name    Status  Components
mirror/swap  COMPLETE  ada0p2 (ACTIVE)
                       ada1p2 (ACTIVE)

#zpool status
  pool: zroot
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
  scan: resilvered 841G in 0 days 01:26:32 with 0 errors on Sat Jan 11 18:41:40 2020
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            ada0p3  ONLINE       0     0     0
            ada1p3  ONLINE       0     0     0

errors: No known data errors

I try to change using adaX labels to diskid labels on both mirrors:
first I disabled load gmirror via boot/loader.conf and etc/fstab, then
i boot from live-cd and import/export zfs pool:
...
#zpool import -d /dev/diskid -o altroot=/tmp/zroot zroot
#zpool export
#reboot

After reboot to normal mode I see, that zpool change their adaX labels
to diskid labels:

#zpool status
  pool: zroot
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
  scan: resilvered 841G in 0 days 01:26:32 with 0 errors on Sat Jan 11 18:41:40 2020
config:

        NAME                        STATE     READ WRITE CKSUM
        zroot                       ONLINE       0     0     0
          mirror-0                  ONLINE       0     0     0
            diskid/DISK-SERIAL1p3  ONLINE       0     0     0
            diskid/DISK-SERIAL2p3  ONLINE       0     0     0

errors: No known data errors


Then I've destroying gmirror and re-created it with diskid labels:

#gmirror destroy swap
#gmirror label -v -b round-robin swap diskid/DISK-SERIAL1p2
#gmirror insert swap diskid/DISK-SERIAL2p2

#gmirror status
       Name    Status  Components
mirror/swap  COMPLETE  diskid/DISK-SERIAL1p2 (ACTIVE)
                       diskid/DISK-SERIAL2p2 (ACTIVE)

But  after  I've re-enabled gmirror in boot/loader.conf and /etc/fstab
and rebooted, I've see adaX labels on both mirrors:

 #gmirror status
       Name    Status  Components
mirror/swap  COMPLETE  ada0p2 (ACTIVE)
                       ada1p2 (ACTIVE)

 #zpool status
  pool: zroot
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
  scan: resilvered 841G in 0 days 01:26:32 with 0 errors on Sat Jan 11 18:41:40 2020
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            ada0p3  ONLINE       0     0     0
            ada1p3  ONLINE       0     0     0

errors: No known data errors

It  look's like gmirror loaded before zfs and use search gmirror on adaX
first instead diskid labels.

Is there a way to prevent gmirror use adaX labels?

#uname -rv
12.1-STABLE FreeBSD 12.1-STABLE r361496 GENERIC

#sysctl kern.geom.label
kern.geom.label.disk_ident.enable: 1
kern.geom.label.gptid.enable: 1
kern.geom.label.gpt.enable: 1
kern.geom.label.ufs.enable: 1
kern.geom.label.ufsid.enable: 1
kern.geom.label.reiserfs.enable: 1
kern.geom.label.ntfs.enable: 1
kern.geom.label.msdosfs.enable: 1
kern.geom.label.iso9660.enable: 1
kern.geom.label.flashmap.enable: 1
kern.geom.label.ext2fs.enable: 1
kern.geom.label.debug: 0




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?558957699.20200828191031>