FreeNAS zfs export fails – the gui reports your volume status is …

Having exported (zfs speak for deleted) a volume, you can sometimes see the volume still in the gui… this is a problem – because it shows as a warning – and you don’t want warnings on what you already deleted…

Here is how to fix that…

1. ssh to the machine – su to root…
2. sqlite3 /data/freenas-v1.db “select * from storage_diskgroup;”
3. sqlite3 /data/freenas-v1.db “select * from storage_volume;”

The output will be something like this…

1|disk250stripe|stripe|1
2|disk500stripe|stripe|2
3|disk750stripe|stripe|3

and

1|disk250|ZFS
2|disk500|ZFS
3|disk750|ZFS

most likely – you’ll see the volume that you deleted right there in the database still…
assuming it is #2…

4. mount -uw /
5. cp /data/freenas-v1.db /data/freenas-v1.db.bak
6. sqlite3 /data/freenas-v1.db “delete from storage_disk where id=2;”
7. sqlite3 /data/freenas-v1.db “delete from storage_diskgroup where id=2;”
8. sqlite3 /data/freenas-v1.db “delete from storage_volume where id=2;”
9. reboot

If you experience problems after rebooting, mount -uw / and copy freenas-v1.db.bak to freenas-v1.db and reboot