{"id":808,"date":"2016-11-20T23:07:10","date_gmt":"2016-11-21T05:07:10","guid":{"rendered":"http:\/\/tiemensfamily.com\/TimOnCS\/?p=808"},"modified":"2016-11-20T23:07:10","modified_gmt":"2016-11-21T05:07:10","slug":"zfs-flash-drives","status":"publish","type":"post","link":"https:\/\/tiemensfamily.com\/timoncs\/2016\/11\/20\/zfs-flash-drives\/","title":{"rendered":"ZFS Flash Drives"},"content":{"rendered":"<p>As an experiment, I created a small (8GB) ZFS volume in a mirror configuration using two 8GB USB Flash drives.<\/p>\n<p>The purpose was to put &#8220;small, but really important things&#8221; on this storage system.<\/p>\n<p>It actually ended up being two discrete pieces of work.  First, setting up a VirtualBox FreeNas 9 image with &#8220;USB passthrough&#8221;.  Second, running the FreeNas\/BSD commands to create the volume by hand, since FreeNas insists on using 2G (fixed) per disk when it creates volumes.  2GB of 1000GB isn&#8217;t even a drip; 2GB of 8GB is significant.<\/p>\n<p>So, second things first:  creating the partition and volume and getting FreeNas to acknowledge it.<\/p>\n<p>Once you know the two devices in FreeNas (for me it was \/dev\/ada1 and \/dev\/ada2), you can run these commands:<\/p>\n<pre>gpart create -s gpt \/dev\/ada1\n\ngpart add -i 1 -t freebsd-zfs \/dev\/ada1\n# now run ls -l \/dev\/gptid, make note of the new entry,\n#   e.g.  d50a7a3b-aeb0-11e6-86a2-080027bed2b8\n\ngpart add -i 1 -t freebsd-zfs \/dev\/ada2\n# make note of that gptid too, \n#    e.g.  e9c860e9-aeb0-11e6-86a2-080027bed2b8\n<\/pre>\n<p>Since my two USB drives were not exactly the same (7.4G versus 7.2G), the zpool create required the &#8220;-f&#8221; flag:<\/p>\n<pre>\nzpool create -f  usb8 mirror \/dev\/gptid\/d50a7a3b-aeb0-11e6-86a2-080027bed2b8 \/dev\/gptid\/e9c860e9-aeb0-11e6-86a2-080027bed2b8\n\nzpool status\n  pool: usb8\n state: ONLINE      \n  scan: none requested \nconfig:   \n        NAME                                            STATE     READ WRITE CKSUM  \n        usb8                                            ONLINE       0     0     0 \n          mirror-0                                      ONLINE       0     0     0    \n            gptid\/d50a7a3b-aeb0-11e6-86a2-080027bed2b8  ONLINE       0     0     0 \n            gptid\/e9c860e9-aeb0-11e6-86a2-080027bed2b8  ONLINE       0     0     0  <\/pre>\n<p>Then, to get FreeNas to acknowledge it:<\/p>\n<pre>\nzpool export usb8\n<\/pre>\n<p>Finally, in the FreeNas GUI, run &#8220;Import Volume&#8221;, no encryption, selecting the volume name in the drop-down list.  Under &#8220;Disks&#8221;, you should see two &#8220;7.xGiB&#8221; entries, not the &#8220;5.xGiB&#8221; the the 2GB swap partition would have given you.<\/p>\n<p>If you didn&#8217;t make note of the gptid as you created the partitions, you can run<\/p>\n<pre>gpart list<\/pre>\n<p>And look for the &#8220;Name: ada1p1&#8221; entry to get the &#8220;rawuuid&#8221; value to use with \/dev\/gptid\/hxhxhx&#8230;.<\/p>\n<p>Using the gptid\/rawuuid, instead of \/dev\/adaX, is a good idea in general.  In this particular case, remember that the device is actually a VirtualBox-created &#8220;Disk&#8221;, with a VirtualBox serial number, and a VirtualBox gptid.<\/p>\n<p>See the next post on how the &#8220;pass-through&#8221; was created in VirtualBox.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As an experiment, I created a small (8GB) ZFS volume in a mirror configuration using two 8GB USB Flash drives. The purpose was to put &#8220;small, but really important things&#8221; on this storage system. It actually ended up being two &hellip; <a href=\"https:\/\/tiemensfamily.com\/timoncs\/2016\/11\/20\/zfs-flash-drives\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts\/808"}],"collection":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/comments?post=808"}],"version-history":[{"count":0,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts\/808\/revisions"}],"wp:attachment":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/media?parent=808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/categories?post=808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/tags?post=808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}