[Bug 270340] zpool import does not return

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 19 Mar 2023 21:45:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270340

Graham Perrin <grahamperrin@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-qa
                 CC|                            |grahamperrin@freebsd.org

--- Comment #6 from Graham Perrin <grahamperrin@freebsd.org> ---
% (In reply to Peter Much from comment #0)

If you create a directory for altroot, and import with option -R, then are
symptoms reproducible?

Knowing more about the hardware (disks and connectivity) might help. 


> After some work done (including modification to the pools), …

Can you describe the modifications?

In particular: does any mount point for a file system within an importing pool
conflict with an existing mount point for an already imported pool?

Thanks. 

----

Below, not reproducible with 13.2-RC3 with a pool on a mobile hard disk drive
on USB: 

root@fuji:~ # freebsd-version -kru ; uname -aKU
13.2-RC3
13.2-RC3
13.2-RC3
FreeBSD fuji 13.2-RC3 FreeBSD 13.2-RC3 releng/13.2-n254599-d9bf9d73203f GENERIC
amd64 1302001 1302001
root@fuji:~ # tail -f -n 0 /var/log/messages
Mar 19 21:31:29 fuji kernel: usb_msc_auto_quirk: UQ_MSC_NO_GETMAXLUN set for
USB mass storage device StoreJet Transcend StoreJet Transcend (0x174c:0x5106)
Mar 19 21:31:29 fuji kernel: ugen3.2: <StoreJet Transcend StoreJet Transcend>
at usbus3
Mar 19 21:31:29 fuji kernel: umass1 on uhub7
Mar 19 21:31:29 fuji kernel: umass1: <StoreJet Transcend StoreJet Transcend,
class 0/0, rev 2.10/80.00, addr 2> on usbus3
Mar 19 21:31:29 fuji kernel: umass1:  SCSI over Bulk-Only; quirks = 0x0100
Mar 19 21:31:29 fuji kernel: umass1:6:1: Attached to scbus6
Mar 19 21:31:29 fuji kernel: da1 at umass-sim1 bus 1 scbus6 target 0 lun 0
Mar 19 21:31:29 fuji kernel: da1: <StoreJet Transcend 0> Fixed Direct Access
SPC-4 SCSI device
Mar 19 21:31:29 fuji kernel: da1: Serial Number X3E1SAKRS
Mar 19 21:31:29 fuji kernel: da1: 40.000MB/s transfers
Mar 19 21:31:29 fuji kernel: da1: 476940MB (976773168 512 byte sectors)
Mar 19 21:31:29 fuji kernel: da1: quirks=0x2<NO_6_BYTE>
^C
root@fuji:~ # lsblk
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL
MOUNT
ada0             0:127 149G GPT                                               -
-
  ada0p1         0:129 512K freebsd-boot                           gpt/gptboot0
-
  <FREE>         -:-   492K -                                                 -
-
  ada0p2         0:131  16G freebsd-swap                              gpt/swap0
SWAP
  ada0p2.eli     0:119  16G freebsd-swap                                      -
SWAP
  ada0p3         0:133 133G freebsd-zfs                                gpt/zfs0
<ZFS>
  ada0p3.eli     0:140 133G zfs                                               -
-
  <FREE>         -:-   836K -                                                 -
-
da1              1:178 466G GPT                                               -
-
  da1p1          1:179 260M efi                                    gpt/efiboot0
-
  da1p2          1:180 512K freebsd-boot                           gpt/gptboot0
-
  <FREE>         -:-   492K -                                                 -
-
  da1p3          1:181 2.0G freebsd-swap                              gpt/swap0
-
  da1p4          1:182 464G freebsd-zfs                                gpt/zfs0
<ZFS>
  <FREE>         -:-   4.0K -                                                 -
-
root@fuji:~ # zpool import 
   pool: zroot
     id: 5859441744642421996
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        zroot       ONLINE
          gpt/zfs0  ONLINE
root@fuji:~ # mkdir /tmp/altroot
root@fuji:~ # zpool import -R /tmp/altroot zroot
cannot import 'zroot': pool was previously in use from another system.
Last accessed by <unknown> (hostid=0) at Sun Mar 19 21:28:24 2023
The pool can be imported, use 'zpool import -f' to import the pool.
root@fuji:~ # zpool import -R /tmp/altroot -f zroot
root@fuji:~ # zpool status -v
  pool: fuji
 state: ONLINE
status: One or more devices has been taken offline by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using 'zpool online' or replace the device with
        'zpool replace'.
  scan: scrub repaired 0B in 00:21:03 with 0 errors on Thu Aug 11 03:03:11 2022
config:

        NAME                STATE     READ WRITE CKSUM
        fuji                ONLINE       0     0     0
          ada0p3.eli        ONLINE       0     0     0
        cache
          label/cache-fuji  OFFLINE      0     0     0

errors: No known data errors

  pool: zroot
 state: ONLINE
  scan: scrub repaired 0B in 00:10:37 with 0 errors on Sat Mar 18 10:05:17 2023
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          gpt/zfs0  ONLINE       0     0     0

errors: No known data errors
root@fuji:~ # zpool export zroot
root@fuji:~ # exit
logout
Connection to 192.168.1.5 closed.

-- 
You are receiving this mail because:
You are the assignee for the bug.