# zfs export and import between diferent controllers



## miks (Aug 3, 2009)

I got error when tried to migrate zfs disk between 2 different systems. After exporting on first system, import on second one are failing with following: 


```
#zpool import storage750
cannot import 'storage750': one or more devices is currently unavailable
```

more information from "zpool import" here:


```
#zpool import
  pool: storage750
    id: 1304450798920256547
 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://www.sun.com/msg/ZFS-8000-6X
config:

        storage750     UNAVAIL  missing device
          ad6       ONLINE
```

As I understand, it's because first system have different controler, so disk is named da2 not ad6.



```
#zdb -l  /dev/ad6
--------------------------------------------
LABEL 0
--------------------------------------------
    version=6
    name='storage750'
    state=1
    txg=8
    pool_guid=1304450798920256547
    hostid=2302370682
    hostname='xxxxxxxxxx'
    top_guid=2004285697880137437
    guid=2004285697880137437
    vdev_tree
        type='disk'
        id=0
        guid=2004285697880137437
        path='/dev/da2'
        whole_disk=0
        metaslab_array=14
        metaslab_shift=32
        ashift=9
        asize=749984022528
```

Are there any way how to learn ZFS that drive name has changed?


----------



## miks (Aug 10, 2009)

any?


----------



## hedwards (Aug 10, 2009)

miks said:
			
		

> Are there any way how to learn ZFS that drive name has changed?


Typically that's not necessary. I'm going to hazard a guess that the drive shouldn't be switching from IDE to SCSI during the move. I suppose you might be doing this over USB or similar, but unless you are, that's probably a part of the problem. I'm not sure if USB is really ready to handle this sort of thing and that sort of error might be the cause.

Typically speaking, I've shuffled disks around with ZFS on them in that fashion without problem. For whatever reason the disk doesn't seem to contain relevant information.

I'd seriously consider trying the disk back in the original system to at least verify that it's working properly there before continuing.


----------



## miks (Aug 10, 2009)

On original system disks are working ok.
I will try to create zfs pool on second server and then move to first (with sata backplane and da device numbering).


----------



## Voltar (Aug 10, 2009)

```
storage750     UNAVAIL  missing device
          ad6       ONLINE
```

My first thought is that you're missing a device somewhere, how many disk/partition does your pool comprise of?


----------



## miks (Aug 10, 2009)

Voltar said:
			
		

> ```
> storage750     UNAVAIL  missing device
> ad6       ONLINE
> ```
> ...



No, it's simple pool from single device.


----------



## hedwards (Aug 10, 2009)

Hmm, I hate to fixate, but SATA drives shouldn't be coming up as direct access. You haven't mentioned it, but are these computers running the same version of FreeBSD, both in terms of release and architecture. Theoretically that shouldn't make a difference beyond the ZFS version.

I'd also point out that if you don't have a current back up of your data, now is a good time to do that, before something unfortunate happens. Probably won't, but with this sort of weirdness, it's worth the effort.

I think what I'd probably do is go look at the any of the devfs and devd config files to make sure that they're not assigning the disk wrongly to da2.

I'd also make sure that the disklabel is properly written and being read correctly.


----------



## miks (Aug 11, 2009)

> Hmm, I hate to fixate, but SATA drives shouldn't be coming up as direct access.


It's because I'm using 3ware 9690sa controller and disk is accessed as single simple volume devices.
ZFS just can't find correct device name after it's connected to motherboard sata controller.
Maybe there are possibility to change ZFS meta data on device?


----------



## desnudopenguino (Aug 12, 2009)

I think labeling your disk would help with this, though you will want to back it up first. Do this command on the original machine to give the disk a label:

```
# glabel label disk1 /dev/ad6
```
You can name the disk whatever, I just used disk1 for this example.

Try something like that after you back up your disk and destroy the zpool and create a new one using the new disk name, then it should work across different machines (at least with FreeBSD installed).

```
# zpool create storage750 /dev/label/disk1
```

Some helpful resources here: glabel(8), zpool


----------



## hedwards (Aug 23, 2009)

miks said:
			
		

> It's because I'm using 3ware 9690sa controller and disk is accessed as single simple volume devices.
> ZFS just can't find correct device name after it's connected to motherboard sata controller.
> Maybe there are possibility to change ZFS meta data on device?


I had the same problem yesterday evening. I was in a sense fairly close when I was fixating on the device name. It's not the change to da that's important it's probably the fact that it's been changed.

I have no idea why, but for some reason it seems to need to be manually put online. At least that worked for me.


```
zpool online storage 750 da2
```

And of course as always, back up your data. It didn't cause me any data corruption or loss, but YMMV.


----------



## miks (Aug 23, 2009)

I solved my problems by using motherboard sata controller, so I can't anymore test hedwards suggestion.


----------

