Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Apr 2024 11:12:22 -0400
From:      mike tancsa <mike@sentex.net>
To:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: zfs boot error on mirrored drive (solved)
Message-ID:  <77e01882-58c6-4100-81b4-7f387cc94196@sentex.net>
In-Reply-To: <82761f2b-475f-43ab-b045-95c60c330db7@sentex.net>
References:  <82761f2b-475f-43ab-b045-95c60c330db7@sentex.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/18/2024 9:37 AM, mike tancsa wrote:
> I have a strange bootup issue on a test box that I just updated from 
> 11, to 12 and now RELENG13.
>
> Its a simple mirror. But if I boot up with ada0, I get an error and 
> cannot boot further. Where as if I boot up with ada1, I get some 
> errors and then proceeds to boot normally.
>
> For one thing, I dont get where zbackup1 is coming from. The pool I 
> boot from is zroot ?!? Where would that reference be stored ? I think 
> ada0 was part of another pool long ago (zbackup1).
>

OK problem solved.  Reboot works on either drive and no errors or 
warnings at the start.

# dd if=/dev/zero of=/dev/ada0p1 bs=1 status=progress

# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

and zdb looks good.

# zdb -l /dev/ada0
failed to unpack label 0
failed to unpack label 1
------------------------------------
LABEL 2
------------------------------------
     version: 5000
     name: 'zroot'
     state: 0
     txg: 61127964
     pool_guid: 9708037437097115416
     errata: 0
     hostname: 'nanobsd2.sentex.ca'
     top_guid: 17259639802746798684
     guid: 18413289395104510392
     vdev_children: 1
     vdev_tree:
         type: 'mirror'
         id: 0
         guid: 17259639802746798684
         metaslab_array: 34
         metaslab_shift: 34
         ashift: 12
         asize: 1978918240256
         is_log: 0
         create_txg: 4
         children[0]:
             type: 'disk'
             id: 0
             guid: 18413289395104510392
             path: '/dev/ada0p3'
             phys_path: 
'id1,enc@n3061686369656d30/type@0/slot@1/elmdesc@Slot_00/p3'
             whole_disk: 1
             DTL: 110
             create_txg: 4
         children[1]:
             type: 'disk'
             id: 1
             guid: 9245256067651064428
             path: '/dev/ada1p3'
             phys_path: 
'id1,enc@n3061686369656d30/type@0/slot@2/elmdesc@Slot_01/p3'
             whole_disk: 1
             DTL: 4403
             create_txg: 4
     features_for_read:
         com.delphix:hole_birth
         com.delphix:embedded_data
     labels = 2 3




0(nanobsd2)# zpool import
no pools available to import
0(nanobsd2)#



>
> Here is the error when booting from disk 0
>
> BIOS drive C: is disk0
> BIOS drive D: is disk1
> zio_read error: 5
> zio_read error: 5
> ZFS: i/o error - all block copies unavailable
> ZFS: can't read MOS of pool zbackup1
> ZFS: can't find pool by guid
>
> Can't find /boot/zfsloader
>
> Can't find /boot/loader
>
> Can't find /boot/kernel/kernel
>
> FreeBSD/x86 boot
> Default: /boot/kernel/kernel
> boot:
>
>
> Here are the messages when booting from disk 1
>
> Loading /boot/d| disk1
> zio_read error: 5
> zio_read error: 5
> ZFS: i/o error - all block copies unavailable
> ZFS: can't read MOS of pool zbackup1
> BIOS 615kB/3363840kB available memory
>
> FreeBSD/x86 bootstrap loader, Revision 1.1
>
> and it continues on from there and boots
>
> After I did the zpool upgrade zroot, I did
>
> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
>
>
>   pool: zroot
>  state: ONLINE
>   scan: resilvered 195G in 01:04:31 with 0 errors on Mon May 25 
> 16:08:21 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
>
> Whats odd is that zbackup1 is not the name of the pool.  Where is that 
> coming from ?  The pool I boot from is zroot on this box
>
> Loading /boot/defaults/loader.conf Loading /boot/loader.conf.local
> Loading /boot/d| disk1
> zio_read error: 5
> zio_read error: 5
> ZFS: i/o error - all block copies unavailable
> ZFS: can't read MOS of pool zbackup1
> BIOS 615kB/3363840kB available memory
>
> 1(nanobsd2)# gpart list ada0
> Geom name: ada0
> modified: false
> state: OK
> fwheads: 16
> fwsectors: 63
> last: 3907029127
> first: 40
> entries: 128
> scheme: GPT
> Providers:
> 1. Name: ada0p1
>    Mediasize: 524288 (512K)
>    Sectorsize: 512
>    Stripesize: 0
>    Stripeoffset: 20480
>    Mode: r0w0e0
>    efimedia: HD(1,GPT,55d32563-9eba-11ea-87ad-0007430611a8,0x28,0x400)
>    rawuuid: 55d32563-9eba-11ea-87ad-0007430611a8
>    rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
>    label: (null)
>    length: 524288
>    offset: 20480
>    type: freebsd-boot
>    index: 1
>    end: 1063
>    start: 40
> 2. Name: ada0p2
>    Mediasize: 21474836480 (20G)
>    Sectorsize: 512
>    Stripesize: 0
>    Stripeoffset: 1048576
>    Mode: r1w1e0
>    efimedia: 
> HD(2,GPT,55d3938d-9eba-11ea-87ad-0007430611a8,0x800,0x2800000)
>    rawuuid: 55d3938d-9eba-11ea-87ad-0007430611a8
>    rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
>    label: (null)
>    length: 21474836480
>    offset: 1048576
>    type: freebsd-swap
>    index: 2
>    end: 41945087
>    start: 2048
> 3. Name: ada0p3
>    Mediasize: 1978922958848 (1.8T)
>    Sectorsize: 512
>    Stripesize: 0
>    Stripeoffset: 21475885056
>    Mode: r1w1e1
>    efimedia: 
> HD(3,GPT,563d7775-9eba-11ea-87ad-0007430611a8,0x2800800,0xe6608000)
>    rawuuid: 563d7775-9eba-11ea-87ad-0007430611a8
>    rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
>    label: (null)
>    length: 1978922958848
>    offset: 21475885056
>    type: freebsd-zfs
>    index: 3
>    end: 3907028991
>    start: 41945088
> Consumers:
> 1. Name: ada0
>    Mediasize: 2000398934016 (1.8T)
>    Sectorsize: 512
>    Mode: r2w2e3
>
> 0(nanobsd2)# gpart list ada1
> Geom name: ada1
> modified: false
> state: OK
> fwheads: 16
> fwsectors: 63
> last: 3907029134
> first: 34
> entries: 128
> scheme: GPT
> Providers:
> 1. Name: ada1p1
>    Mediasize: 524288 (512K)
>    Sectorsize: 512
>    Stripesize: 0
>    Stripeoffset: 20480
>    Mode: r0w0e0
>    efimedia: HD(1,GPT,25a0d50e-4207-11e6-8ebd-003048d6ef12,0x28,0x400)
>    rawuuid: 25a0d50e-4207-11e6-8ebd-003048d6ef12
>    rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
>    label: gptboot1
>    length: 524288
>    offset: 20480
>    type: freebsd-boot
>    index: 1
>    end: 1063
>    start: 40
> 2. Name: ada1p2
>    Mediasize: 21474836480 (20G)
>    Sectorsize: 512
>    Stripesize: 0
>    Stripeoffset: 1048576
>    Mode: r1w1e0
>    efimedia: 
> HD(2,GPT,25b0e143-4207-11e6-8ebd-003048d6ef12,0x800,0x2800000)
>    rawuuid: 25b0e143-4207-11e6-8ebd-003048d6ef12
>    rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
>    label: swap1
>    length: 21474836480
>    offset: 1048576
>    type: freebsd-swap
>    index: 2
>    end: 41945087
>    start: 2048
> 3. Name: ada1p3
>    Mediasize: 1978922958848 (1.8T)
>    Sectorsize: 512
>    Stripesize: 0
>    Stripeoffset: 21475885056
>    Mode: r1w1e1
>    efimedia: 
> HD(3,GPT,25c584a8-4207-11e6-8ebd-003048d6ef12,0x2800800,0xe6608000)
>    rawuuid: 25c584a8-4207-11e6-8ebd-003048d6ef12
>    rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
>    label: zfs1
>    length: 1978922958848
>    offset: 21475885056
>    type: freebsd-zfs
>    index: 3
>    end: 3907028991
>    start: 41945088
> Consumers:
> 1. Name: ada1
>    Mediasize: 2000398934016 (1.8T)
>    Sectorsize: 512
>    Mode: r2w2e3
>
>
> It looks like if I do just a
>
> 0(nanobsd2)# zpool import
>    pool: zbackup1
>      id: 5819795054093255811
>   state: UNAVAIL
> status: The pool was last accessed by another system.
>  action: The pool cannot be imported due to damaged devices or data.
>    see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-EY
>  config:
>
>         zbackup1                  UNAVAIL  insufficient replicas
>           raidz2-2                UNAVAIL  insufficient replicas
>             da5                   UNAVAIL  cannot open
>             mfisyspd8             UNAVAIL  cannot open
>             mfisyspd7             UNAVAIL  cannot open
>             mfisyspd6             UNAVAIL  cannot open
>             ada0                  UNAVAIL  cannot open
>             17460231907795801757  UNAVAIL  cannot open
> 0(nanobsd2)#
>
> it thinks ada0 is/was part of an old pool.  How do I get rid of that 
> reference ?
>
>     ---Mike
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?77e01882-58c6-4100-81b4-7f387cc94196>