# Move from OpenIndiana to FreeBSD



## jpbkslave42 (Oct 29, 2013)

I had a ZFS pool that was sitting on disks unused for a while, so long that I honestly forget what I had used to create them initially (I know for fact it wasn't Solaris 11 Express, so it shouldn't be a ZFS version issue that I'm running into).

I decided recently to check if it still works, so I installed them in a system and installed OI on a separate system disk. Installed great, and when I ran `zpool list` it showed that the previous system it had been on was FreeBSD. I imported it and was able to access everything on the filesystem just fine. 

Unfortunately it was soon after this I remembered I don't like OI too much, so I exported the pool, and installed FreeBSD 9.2. Now however, nothing shows up on `zpool list` / `import`. The OS is seeing the actual disks, and my limited experience troubleshooting ZFS is now pinning me to a brick wall. It seems odd to me - it must have been originally created by FreeBSD; would importing / exporting to OI have changed anything on the disks? 

Apologies if this is already answered somewhere - I've done a good amount of searching on Google / these forums already, I'm thinking that my limited understanding of what's wrong here is preventing me from searching effectively.

I'm not looking for the direct answer - if someone could teach me how to fish better, I'd appreciate it


----------



## ondra_knezour (Oct 29, 2013)

I am not sure if the zpool and zfs commands will complain in case that the zfs.ko is not loaded. Do you have loaded it or compiled in your kernel?
`kldstat -v | grep zfs`


----------



## wblock@ (Oct 29, 2013)

Is the ZFS kernel module loaded?  `kldload zfs`


----------



## usdmatt (Oct 29, 2013)

Do you know if the disks are partitioned or not. If so, do the partitions show up in FreeBSD or just the raw devices?

You can also run `# zdb -l /dev/{device}` to try and pull the ZFS labels directly off a disk. Assuming you pass this command a device (or partition) that's functional and is/was part of a pool, it should find 4 labels - 2 from the start of the disk and 2 from the end. If zdb() finds valid labels then I'll be stumped if `# zpool import` shows nothing at all.

Edit: I'm pretty sure the zfs() and zpool() commands automatically load the kernel module if necessary.


----------



## jpbkslave42 (Oct 29, 2013)

@ondra_knezour, @wblock@: yes it's loaded, I made sure to check that last night (perhaps something I should have included in my original post, I will remember for next time).

@usdmatt: I'm not certain. I will check that and try your suggestions as soon as I get home from work.

Thank you all for your help, will update this later today hopefully.


----------



## jpbkslave42 (Oct 31, 2013)

@usdmatt - Tried `# zdb -l /dev/{device}`, however it returned the following:


```
root@storage:~ # zdb -l /dev/ada2
--------------------------------------------
LABEL 0
--------------------------------------------
failed to unpack label 0
--------------------------------------------
LABEL 1
--------------------------------------------
failed to unpack label 1
--------------------------------------------
LABEL 2
--------------------------------------------
failed to unpack label 2
--------------------------------------------
LABEL 3
--------------------------------------------
failed to unpack label 3
```

I checked in /var/run/dmesg.boot and found this - I'm not certain if the "Previously was known as" parts would have any effect on ZFS? I should still be able to get the labels regardless right? 


```
ada0 at ata2 bus 0 scbus2 target 0 lun 0
ada0: <WDC WD1001FALS-00J7B0 05.00K05> ATA-8 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad4
ada1 at ata3 bus 0 scbus3 target 0 lun 0
ada1: <WDC WD3200AAKS-00L9A0 01.03E01> ATA-8 SATA 2.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada1: 305245MB (625142448 512 byte sectors: 16H 63S/T 16383C)
ada1: Previously was known as ad6
ada2 at ata4 bus 0 scbus4 target 0 lun 0
ada2: <WDC WD1001FALS-00E8B0 05.00K05> ATA-8 SATA 2.x device
ada2: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada2: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
ada2: Previously was known as ad8
```

I have a lot of spare time tonight, so I'm willing to try anything to try to figure this out. I'm almost tempted to reinstall OI just to see if it shows up there still, but I'd rather not.


----------



## jpbkslave42 (Oct 31, 2013)

I just re-installed OpenIndiana, and sadly that is not showing the zpool now either.  Starting to look like something nasty happened sometime between when I exported it, and installed FreeBSD. Does anyone have experience restoring zpools after having their labels auto-magically ripped off?


----------



## wblock@ (Oct 31, 2013)

Were they originally connected through a RAID controller?


----------



## ondra_knezour (Oct 31, 2013)

jpbkslave42 said:
			
		

> ada0: Previously was known as ad4



It is part of the transition to new cam(4) based ATA layer, see the Release Notes.

If there is a problem under OpenIndiana too, it is less likely related and also little dated, but still may be useful to see this message. Pawel Jakub Dawidek (pjd@) responding later in the thread is author of the original import of ZFS to FreeBSD.


----------



## jpbkslave42 (Oct 31, 2013)

Before I went into work this morning, I made a realization - I forgot to put my third disk back into the system! (It was a 3-way mirror when I had set it up in ~Feb). I found the disk, installed it, and was elated to see that the tags are still on that disk and was able to import the zpool. I've never been so happy to do a resilver before. To clarify, the system is now back running FreeBSD 9.2.

I'd still like to try to figure out what happened if anyone else has some ideas? I'm only resilvering one of the disks (I had to at least do one of them; my paranoia is back in full force after the last couple days), so there's still one left that I can "poke" at. I 

@wblock@ - Never connected to a RAID controller, and this is actually even the same hardware I had created it on originally.


----------

