Adding a drive to a zone

In my neverending challenge to organise the immense photo archive we have amassed over the year, I ran into Koken quite a while ago. Even though I quite like the program, the fact that you need to import every single photo into the Koken library put me off.

About two years later and I still have not found something decent, which makes me rethink my strategy. I am adding a dedicated 2Tb drive to the SmartOS GZ (The Dell 710R) and use that as storage for a Koken LX zone and the entire photo library. I will need some workflow to keep the NAS synchronised with the Koken photolibrary, but I guess rsync will be sufficient for that. The 2Tb drive is not in mirror - if it dies, I will have to reimport everything in Koken. We'll see if that was a bad idea in hindsight when the drives dies, I guess.

So how do you add a physical drive to a zone? There are two options, either as type "zfs" or "lofs", the difference between the two is explained on the SmartOS mailing list. It actually is pretty easy if you remember to do it while creating the zone. Just add the following block for ZFS to add a zpool named fotos to the /mnt dir on Linux:

"filesystems": [
    {
      "type": "zfs",
      "source": "fotos",
      "target": "/mnt"
    }
]

Should you forget to do this (I make a habit of that), you can add the drive through zonecfg:

zonecfg -z zone
add fs
set type=zfs
set special=fotos
set dir=/mnt
end

Now in my case, after rebooting the LX zone I received an error message:

Command failed: could not verify fs /mnt: zfs 'fotos' mountpoint is not "legacy"

To correct this, use:

zfs set mountpoint=legacy fotos