openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.56k stars 1.74k forks source link

zpool import complains about missing log device, suggests -m, then imports with the missing device anyways #4168

Closed darkpixel closed 5 years ago

darkpixel commented 8 years ago

Running a zpool import shows my log device is 'missing' and suggests I can import the pool by passing the -m flag.

When I pass the -m flag, the pool (including the 'missing' log device) is imported and works fine.

This annoyingly breaks puppet automation we have set up for deploying new machines. ;)

I can reproduce on 5/5 machines by rebooting, then trying to import the pool.

root@usghrsdnas01:~# zpool import
   pool: tank
     id: 10527079880840648587
  state: UNAVAIL
 status: One or more devices are missing from the system.
 action: The pool cannot be imported. Attach the missing
    devices and try again.
   see: http://zfsonlinux.org/msg/ZFS-8000-6X
 config:

    tank                                           UNAVAIL  missing device
      raidz2-0                                     ONLINE
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW30DSY46Z  ONLINE
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37LUH7C6  ONLINE
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNR6H8  ONLINE
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNR9VY  ONLINE
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNRHEH  ONLINE
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNRPDL  ONLINE
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNRSKH  ONLINE

    Additional devices are known to be part of this pool, though their
    exact configuration cannot be determined.
root@usghrsdnas01:~# zpool import tank
The devices below are missing, use '-m' to import the pool anyway:
        ata-SanDisk_SD6SB1M064G1022I_152041401417 [log]

cannot import 'tank': one or more devices is currently unavailable
root@usghrsdnas01:~# zpool import tank -m
zpool status
root@usghrsdnas01:~# zpool status
  pool: backup-pool
 state: ONLINE
  scan: scrub repaired 0 in 0h0m with 0 errors on Thu Dec 31 10:04:38 2015
config:

    NAME                               STATE     READ WRITE CKSUM
    backup-pool                        ONLINE       0     0     0
      ata-ST2000DM001-1ER164_W4Z20QW6  ONLINE       0     0     0

errors: No known data errors

  pool: tank
 state: ONLINE
  scan: none requested
config:

    NAME                                           STATE     READ WRITE CKSUM
    tank                                           ONLINE       0     0     0
      raidz2-0                                     ONLINE       0     0     0
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW30DSY46Z  ONLINE       0     0     0
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37LUH7C6  ONLINE       0     0     0
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNR6H8  ONLINE       0     0     0
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNR9VY  ONLINE       0     0     0
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNRHEH  ONLINE       0     0     0
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNRPDL  ONLINE       0     0     0
        ata-WDC_WD1003FBYZ-010FB0_WD-WCAW37NNRSKH  ONLINE       0     0     0
    logs
      ata-SanDisk_SD6SB1M064G1022I_152041401417    ONLINE       0     0     0

errors: No known data errors
root@usghrsdnas01:~# dpkg -l | grep -i zfs
ii  debian-zfs                       7~jessie                              amd64        Native ZFS filesystem metapackage for Debian.
ii  libzfs2                          0.6.5.2-2                             amd64        Native ZFS filesystem library for Linux
ii  libzpool2                        0.6.5.2-2                             amd64        Native ZFS pool library for Linux
ii  zfs-dkms                         0.6.5.2-2                             all          Native ZFS filesystem kernel modules for Linux
ii  zfsonlinux                       6                                     all          archive.zfsonlinux.org trust package
ii  zfsutils                         0.6.5.2-2                             amd64        command-line tools to manage ZFS filesystems
root@usghrsdnas01:~# dpkg -l | egrep 'zfs|spl'
ii  acpi                             1.7-1                                 amd64        displays information on ACPI devices
ii  debian-zfs                       7~jessie                              amd64        Native ZFS filesystem metapackage for Debian.
ii  ethtool                          1:3.16-1                              amd64        display or change Ethernet device settings
ii  facter                           2.2.0-1                               all          collect and display facts about the system
ii  iftop                            1.0~pre4-2                            amd64        displays bandwidth usage information on an network interface
ii  libbrlapi0.6:amd64               5.2~20141018-5                        amd64        braille display access via BRLTTY - shared library
ii  librrd4                          1.4.8-1.2                             amd64        time-series data storage and display system (runtime library)
ii  librrds-perl                     1.4.8-1.2                             amd64        time-series data storage and display system (Perl interface, shared)
ii  libtext-charwidth-perl           0.04-7+b3                             amd64        get display widths of characters on the terminal
ii  libxdmcp6:amd64                  1:1.1.1-1+b1                          amd64        X11 Display Manager Control Protocol library
ii  libzfs2                          0.6.5.2-2                             amd64        Native ZFS filesystem library for Linux
ii  rrdtool                          1.4.8-1.2                             amd64        time-series data storage and display system (programs)
ii  spl                              0.6.5-1                               amd64        Solaris Porting Layer user-space utilities for Linux
ii  spl-dkms                         0.6.5-1                               all          Solaris Porting Layer kernel modules for Linux
ii  virt-viewer                      1.0-1                                 amd64        Displaying the graphical console of a virtual machine
ii  whiptail                         0.52.17-1+b1                          amd64        Displays user-friendly dialog boxes from shell scripts
ii  zfs-dkms                         0.6.5.2-2                             all          Native ZFS filesystem kernel modules for Linux
ii  zfsonlinux                       6                                     all          archive.zfsonlinux.org trust package
ii  zfsutils                         0.6.5.2-2                             amd64        command-line tools to manage ZFS filesystems
root@usghrsdnas01:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.2 (jessie)
Release:    8.2
Codename:   jessie
root@usghrsdnas01:~# uname -a
Linux usghrsdnas01 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u1 (2015-12-14) x86_64 GNU/Linux
root@usghrsdnas01:~#
carsten-AEI commented 8 years ago

Quick comment on this one (I see the same on Debian Jessie with zfs 0.6.5.6-3, but potentially due to another cause):

The systemd service /lib/systemd/system/zfs-import-scan.service fails importing all zpool, i.e. command /sbin/zpool import -d /dev/disk/by-id -aN fails with:

The devices below are missing, use '-m' to import the pool anyway:
            nvme0n1p1 [log]

cannot import 'boinc': one or more devices is currently unavailable

The culprit here seems to be -d /dev/disk/by-id which presumably fails as the nvme is not listed in there and thus the zpool was created with the /dev/nvme0n1p1 device.

behlendorf commented 8 years ago

@darkpixel so the issue here seems to be that your zfs cache file knows about the log device but it wasn't able to locate it at the expected path. As @carsten-AEI mentioned this sort of thing is more likely early on in the boot when all the devices may not yet have had links created.

The probing logic is being improved with the proposed patches in #4523. I'd be very interested to hear if apply those patches to master resolves this issue.

mailinglists35 commented 8 years ago

so the issue here seems to be that your zfs cache file knows about the log device but it wasn't able to locate it at the expected path

@behlendorf I have a different case where the slog is absent not because of missing from expected path but really absent, so the proposed patches do not apply.

the pool shows as UNAVAIL on 'zpool import' but does import successfully with 'zpool import poolname -m'.

Can the 'zpool import' message be changed from UNAVAIL to the result of 'zpool import -m poolname' aka can 'zpool import' check that the pool can really be imported with 'zpool import -m' and adjust the message accordingly?

seeing the 'UNAVAIL' result is pretty misleading when in fact everything works just fine by importing without the slog device. when the user sees "The pool cannot be imported" and the url http://zfsonlinux.org/msg/ZFS-8000-6X says the same, it creates a hopeless feeling and discourages user to further attempt to online the pool.

devonbessemer commented 7 years ago

I'm seeing the same issue running 0.6.5.9 on Debian Jessie.

$ sudo zpool import pool
The devices below are missing, use '-m' to import the pool anyway:
            mirror-1 [log]
              ata-Samsung_SSD_850_EVO_250GB_S21NNXAGA26164Y-part2
              ata-SanDisk_SDSSDA120G_170213463203-part2

It imports fine with -m but shows this message and refuses to import the pool at anytime without -m so I don't see this problem being related to probing at boot.

This problem exists regardless of whether I use disk id, uuid, or device name and I have tried without the mirror with just one device with the same luck. Something with the log device regardless of its name.

darkpixel commented 7 years ago

Sorry @behlendorf, I didn't see your reply for some reason. I recently changed jobs and don't have access to ZFS test systems anymore. Someone else with the issue will have to test or we can close the issue. :)

miguelangelcastellanos commented 6 years ago

I have the same issue on Centos 7.2, Using ZFS 0.7.3

My slog device (second partition on SSD drive) is present however the zpool import doesn't work without the "-m" flag.

This becomes critical if your SLOG have pending data to commit, because it won 't be possible to apply the SLOG to the main pool disks.

Thanks a lot.

Miguel

mcr-ksh commented 6 years ago

same issue here:

root@hcrs002:~# zpool import tier2 The devices below are missing, use '-m' to import the pool anyway: /tier1/tier2_log [log]

cannot import 'tier2': one or more devices is currently unavailable root@hcrs002:~# ls -al /tier1/tier2_log -rw-r--r-- 1 root root 536870912 Jan 13 04:02 /tier1/tier2_log

device/file is present.