5

Was going to try SmartOS, partially because I was not satisfied with FreeNAS for my usage. Created new zpool on old cache drive for SmartOS zones. That was all just backstory. The point is that now can't import the old FreeNAS pool on Ubuntu 15.04.

  pool: pool5                                                            
    id: 14850262647910895720                                              
 state: UNAVAIL                                                           
status: The pool was last accessed by another system.                     
action: The pool cannot be imported due to damaged devices or data.       
  see: http://zfsonlinux.org/msg/ZFS-8000-EY                              
config:                                                                   

    pool5                               UNAVAIL  missing device        
      raidz2-0                          ONLINE                         
        ata-WL3000GSA6472_WOL240282406  ONLINE                         
        ata-WL3000GSA6472_WOL240282471  ONLINE                         
        ata-WL3000GSA6472_WOL240282504  ONLINE                         
        ata-WL3000GSA6472_WOL240282506  ONLINE                         
        ata-WL3000GSA6472_WOL240282472  ONLINE                         
    cache                                                              
      ata-ST31500341AS_6VS073SA                                        

  pool: zones                                                             
    id: 513536768382594111                                                
 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: http://zfsonlinux.org/msg/ZFS-8000-EY                              
config:                                                                   

       zones                        ONLINE                                
         ata-ST31500341AS_6VS073SA  ONLINE                                   

I have since destroyed zones.

Tried most of the force options and combinations, similar results:

$ sudo zpool import pool5
cannot import 'pool5': pool may be in use from other system, it was last accessed by freenas.local (hostid: 0x8120288a) on Tue Oct 27 16:24:56 2015
$ sudo zpool import -f pool5
cannot import 'pool5': one or more devices is currently unavailable
$ sudo zpool import -Ff pool5
cannot import 'pool5': one or more devices is currently unavailable
$ sudo zpool import -fm pool5
cannot import 'pool5': one or more devices is currently unavailable
$ sudo zpool import -FfmX pool5
cannot import 'pool5': one or more devices is currently unavailable
$ sudo zpool import -fD pool5
cannot import 'pool5': no such pool available
$ sudo zpool import -nF pool5
cannot import 'pool5': pool may be in use from other system, it was last accessed by freenas.local (hostid: 0x8120288a) on Tue Oct 27 16:24:56 2015
use '-f' to import anyway
$ sudo zpool import -m pool5
cannot import 'pool5': pool may be in use from other system, it was last accessed by freenas.local (hostid: 0x8120288a) on Tue Oct 27 16:24:56 2015
use '-f' to import anyway

$ sudo zdb -e pool5 says:

Configuration for import:
        vdev_children: 2
        version: 5000
        pool_guid: 14850262647910895720
        name: 'pool5'
        state: 0
        hostid: 2166368394
        hostname: 'freenas.local'
        vdev_tree:
            type: 'root'
            id: 0
            guid: 14850262647910895720
            children[0]:
                type: 'raidz'
                id: 0
                guid: 142933150631883837
                nparity: 2
                metaslab_array: 33
                metaslab_shift: 37
                ashift: 12
                asize: 15002891714560
                is_log: 0
                create_txg: 4
                children[0]:
                    type: 'disk'
                    id: 0
                    guid: 79266291072794538
                    whole_disk: 1
                    DTL: 356
                    create_txg: 4
                    path: '/dev/disk/by-id/ata-WL3000GSA6472_WOL240282406-part1'
                children[1]:
                    type: 'disk'
                    id: 1
                    guid: 1087294782673888508
                    whole_disk: 1
                    DTL: 258
                    create_txg: 4
                    path: '/dev/disk/by-id/ata-WL3000GSA6472_WOL240282471-part1'
                children[2]:
                    type: 'disk'
                    id: 2
                    guid: 2219503574895013140
                    whole_disk: 1
                    DTL: 257
                    create_txg: 4
                    path: '/dev/disk/by-id/ata-WL3000GSA6472_WOL240282504-part1'
                children[3]:
                    type: 'disk'
                    id: 3
                    guid: 6460403329296563235
                    whole_disk: 1
                    DTL: 202
                    create_txg: 4
                    path: '/dev/disk/by-id/ata-WL3000GSA6472_WOL240282506-part1'
                children[4]:
                    type: 'disk'
                    id: 4
                    guid: 9844978706073275260
                    whole_disk: 1
                    DTL: 167
                    create_txg: 4
                    path: '/dev/disk/by-id/ata-WL3000GSA6472_WOL240282472-part1'
            children[1]:
                type: 'missing'
                id: 1
                guid: 0
zdb: can't open 'pool5': No such device or address

versions:

libzfs2    0.6.5.3-1~vivid amd64 Native OpenZFS filesystem library for Linux
ubuntu-zfs 9~vivid         amd64 Native ZFS filesystem metapackage for Ubuntu.
zfs-dkms   0.6.5.3-1~vivid amd64 Native OpenZFS filesystem kernel modules for Linux
zfsutils   0.6.5.3-1~vivid amd64 Native OpenZFS management utilities for Linux

Tried importing from devnodes:

~/tmp$ ln -s $(for link in /dev/disk/by-id/ata-WL3000GSA6472_WOL240282406* /dev/disk/by-id/ata-WL3000GSA6472_WOL240282471* /dev/disk/by-id/ata-WL3000GSA6472_WOL240282504* /dev/disk/by-id/ata-WL3000GSA6472_WOL240282506* /dev/disk/by-id/ata-WL3000GSA6472_WOL240282472* ; do readlink -f "${link}" ; done) ./
~/tmp$ ls
sdb  sdb1  sdb9  sdc  sdc1  sdc9  sdd  sdd1  sdd9  sde  sde1  sde9  sdf  sdf1  sdf9
~/tmp$ sudo zpool import -d ./ pool5
cannot import 'pool5': pool may be in use from other system, it was last accessed by freenas.local (hostid: 0x8120288a) on Tue Oct 27 16:24:56 2015
use '-f' to import anyway
~/tmp$ sudo zpool import -fd ./ pool5
cannot import 'pool5': one or more devices is currently unavailable

and the weird part (what is ada1? oh. probably a freebsd devnode):

$ sudo zpool import -d tmp
   pool: pool5
     id: 14850262647910895720
  state: UNAVAIL
 status: The pool was last accessed by another system.
 action: The pool cannot be imported due to damaged devices or data.
   see: http://zfsonlinux.org/msg/ZFS-8000-EY
 config:

        pool5        UNAVAIL  missing device
          raidz2-0   ONLINE
            sde      ONLINE
            sdc      ONLINE
            sdd      ONLINE
            sdb      ONLINE
            sdf      ONLINE
        cache
          ada1

Can I maybe reinitialize the cache device so it can find it again? How much information does a cache device store about it's pool? Would it work to just make another zpool and add it as a cache to it? zdb doesn't seem to have a guid listed for it - will it just take a free cache drive? Can I make a cache drive and symlink it to ada1 and have it pick it up?

7
  • That's unusual, it should import without a cache device. Does the output of zdb show anything useful? – qasdfdsaq Nov 5 '15 at 14:36
  • When you say that you "tried all the force options and combinations", please be more specific. Can you include a copy and paste of the commands that you did try and their exact respective output in your question? Also, please state which exact version you are running; just "SmartOS" and "ZFS" isn't nearly specific enough. I can't recreate the situation immediately because I have no spare block device to use as a cache device, but it looks to me like zdb is also getting confused by the situation. – user Nov 6 '15 at 17:58
  • Well, now we are getting somewhere. Since zpool import -nF says that the pool cannot be imported because it is "in use" (meaning it has not been exported) and to use -f, which is a very different error from that given by most other combinations you have tried, it seems likely that zpool import -fF could work. Note that using -F without -n may cause data loss; see the man page for details. If you can live with potentially losing a small amount of data (specifically recent transaction groups), you may want to give that a try. @-ping me in a comment and let me know how if that works. – user Nov 6 '15 at 19:02
  • is -fF different from -Ff @MichaelKjörling ? – user148509 Nov 6 '15 at 19:14
  • Oops. No, it shouldn't be. Sorry, I looked through your list twice but somehow totally missed that one. Okay, back to the drawing board then... – user Nov 6 '15 at 19:15
1

What version of ZFS on Linux? Importing with a missing cache device is a 'newer' feature (not that new anymore, but ZoL was quite a bit behind in the past)

Also, if you do not need it, try destroying the 'zones' pool, so that the cache device in your 'pool5' is not locked. You might be in the strange situation because the device is not actually missing, it is just unusable because it is locked by the other pool.

Other things to try: zpool import -m pool5 (should only be required for a missing log device, not a missing cache device)

zpool import -nF pool5

0

I don't know for sure, but after our little back-and-forth in the question comments, I think the problem might be that the device exists, but isn't a cache device any longer, and that this is somehow confusing the ZFS toolchain to the point of being unable to import the pool normally.

If this is the root cause of your problems, then you might very well be able to get around the problem by importing from a different directory.

To do this, create a temporary directory, and recreate the necessary device symlinks in it. For example:

# mkdir /tmp/zfs
# cd /tmp/zfs
# ln -s $(for link in /dev/disk/by-id/ata-WL3000GSA6472_WOL240282406* /dev/disk/by-id/ata-WL3000GSA6472_WOL240282471* /dev/disk/by-id/ata-WL3000GSA6472_WOL240282504* /dev/disk/by-id/ata-WL3000GSA6472_WOL240282506* /dev/disk/by-id/ata-WL3000GSA6472_WOL240282472* ; do readlink -f "${link}" ; done) ./
# zpool import -d /tmp/zfs

(The long ln command simply recreates the ata-WL... links and ensures that they point to the correct device node.)

If all goes well, the final zpool import -d ... should output something like the following:

  pool: pool5
    id: 14850262647910895720
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

    pool5                               ONLINE
      raidz2-0                          ONLINE
        ata-WL3000GSA6472_WOL240282406  ONLINE
        ata-WL3000GSA6472_WOL240282471  ONLINE
        ata-WL3000GSA6472_WOL240282504  ONLINE
        ata-WL3000GSA6472_WOL240282506  ONLINE
        ata-WL3000GSA6472_WOL240282472  ONLINE
    cache
      ...something... MISSING (was ata-ST31500341AS_6VS073SA)

I don't know the exact format in the zpool import output for a missing cache device (it might not even be shown at all), so take that part with a handful of salt, and it might still complain about the pool being "in use", but hopefully this will give ZFS a chance to look for the pool and not be confused by the cache device because ZFS will be looking in a place where the cache device doesn't even exist.

If this works, you should be able to import the pool using -d /tmp/zfs -f (you will need to use -f because the pool wasn't exported earlier, but I recommend trying without it first anyway because using -f with ZFS is very often not what you want to do and you should not get into the habit of using it unless you know for certain that you want to use it and why you want to use it), remove the cache device from the pool using something like zpool detach pool5 ...something..., export the pool and then re-import the pool normally. You can then re-add the cache device if you want to (though I would strongly recommend against using a spindle for a cache device).

After you have been able to re-import the pool normally (without using -d) you can safely delete the /tmp/zfs (or other temporary) directory that you created above.

Also, if this works, I would encourage you to file a bug report with the project issue tracker. This kind of workaround should not be needed for what is, in effect, volatile-data stores.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.