Licensing is to blame for ZFS not being more popular, particularly within the Linux world. However the open source combined filesystem / volume manager originally from Sun is coming on strong these days. While you might traditionally think of ZFS in a server context, the combination of Thunderbolt drive enclosures and the MacZFS project suddenly make for some tantalizing opportunities for the Mac user. Let's just think this through.
Thunderbolt gives you a 10Gb/s pathway to your drives which they can't come close to filling. There is also a good chance that once you have some Thunderbolt drives, you will want to add more in the future. Rather than just adding more and more volumes to your machine and splitting your data amongst them, you could use ZFS and grow a single volume as you add drives instead. Oh, and did I mention you also get the data integrity, copy on write, snapshots, continuous integrity checking and automatic repair that come with ZFS as well? I digress.
Admittedly the Thunderbolt drive options are few and far between these days but they will come. We are just starting to see Thunderbolt enclosures that allow you to snap in any old bare drive, and Thunderbolt PCIe cards can't be far off either.
So how would you format a ZFS volume? Here's a practical example.
I have a 4 drive external enclosure where drives show up as /dev/disk5, /dev/disk6, /dev/disk7 and /dev/disk8. I know this by plugging it in, turning it on and running diskutil in a terminal:
---
diskutil list
---
I partition each disk with a GPT (GUID Partition Table) rather than the standard APM. (Apple Partition Map)
---
diskutil partitiondisk /dev/disk5 GPTFormat ZFS %noformat% 100%
diskutil partitiondisk /dev/disk6 GPTFormat ZFS %noformat% 100%
diskutil partitiondisk /dev/disk7 GPTFormat ZFS %noformat% 100%
diskutil partitiondisk /dev/disk8 GPTFormat ZFS %noformat% 100%
---
Next I will create a RAID-Z out of all the second partitions on each disk. (by default, the second partition is marked ZFS on each disk - see the output of diskutil list)
---
zpool create Data raidz disk5s2 disk6s2 disk7s2 disk8s2
---
You should be left with a mounted RAID-Z volume called Data.
Lastly I'm going to disable Spotlight indexing on that volume because Spotlight is incompatible with ZFS. (Spotlight is created to be used on HFS+ (normal Mac) volumes)
---
mdutil -i off /Volumes/Data
---
So we're good to go. You can now use the volume like any other Mac volume, reading and writing as usual.
You can see how your ZFS storage pools are doing with:
---
zpool status
---
At some point, you might have a drive failure. To replace /dev/disk5, you would:
---
zpool offline disk5
(physically replace the disk)
zpool replace Data disk5
---
In the future, you also might want to add more drives to your setup. Currently you can't just add single disks to a RAID-Z to increase it's size. What you want to do to grow the filesystem is add another group of disks to create a new virtual device which ZFS will use to expand the filesystem. As a rule of thumb, you want to keep the groups of disks to similar size or you will end up using whatever set is bigger a little more than the others. To add the new disks, it is very similar to how you initially created your initial RAID-Z:
---
zpool add Data raidz disk9s2 disk10s2 disk11s2 disk12s2
---
Now notice zpool status shows you two virtual RAID-Z devices and your Data volume magically grew to twice it's size!
Additional Reading:
Mac ZFS - Getting Started
Solaris ZFS Administration Guide
ZFS Best Practices Guide
Design Redux
I've updated the design of Anders.com once again - this time stripping out a good deal of the little links to this and that. The thought here is to focus on the content primarily. The really important things are really big and I've axed a whole pile of stuff that was doing more harm than good to the focus of the site.
http://Anders.com/ is here for things that are a bit too long to tweet or are things I want to have stick around longer than a blip on someone's timeline. http://AndersBrownworth.com/ remains a link page - something similar to an About.me profile. LinkedIn remains my professional resume and @Anders94 my primary "short thoughts" medium. For all else, there is http://Anders.com/.
FreeSWITCH: mod_sms Patch for Simple Logging Capability
Here's a patch for FreeSWITCH to add a simple logging capability to mod_sms. Basic usage is:
<action application="log" data="${_body}"/>
which will log the body of the SMS message. Don't forget that this should be part of the chatplan:
<section name="chatplan" description="Regex/XML Chatplan">
<context name="default">
<extension name="public_dids">
<condition field="to" expression="^(.*)$">
<action application="log" data="SMS Body:[${_body}]"/>
</condition>
</extension>
</context>
</section>
http://anders.com/1offs/freeswitch-mod_sms-logging.diff
Thoughts on Entrepreneurialism
I'm not passionate about building a great company, I'm passionate about creating a great product. Great companies come from great products.
Almost anything you build has been tried before. It may have been only the timing that was bad.
Meander some in your work. The best ideas come out of left field.
Creativity is both an intensely independent and massively collaborative process. Forgetting one or the other leaves you at a disadvantage.
New Anders.com Design
I've just replaced the look and feel of Anders.com with a minimal mobile-focused design. For some time I've been considering mobile over desktop for the sites I build so I figure it was high time to make Anders.com reflect that shift. If you are on a desktop browser, try resizing this page and see how the design conforms to even the tiniest of screen sizes.
I've also gotten rid of my Google advertising. The hit of having advertising that gets in the way of the reading experience didn't seem worth it to me. The theory is if you want people to read what you write, don't punish them for it!
Most of my short thoughts end up on twittier these days so I tend to update this blog less and less. I also talk a bit on 350 Third, my podcast with Scott Barstow, so the things I end up writing here will be here because they are best expressed (and searched) via text.
I hope you enjoy the less intrusive direction. Hit me up at @anders94 if you have comments.
EyeZo.com - Get Short URLs for any Location on Earth
http://eyezo.com is a new website that creates short URLs for locations. Instead of giving people addresses which can vary widely in accuracy, give them a URL that shows them unambiguously where something is.
Ever tried to find someone in a crowd? EyeZo.com can use the location services on your mobile phone to automatically figure out where you are so your friends can find you easily. You could tweet a spot to meet for lunch or find that out-of-the-way place everyone is talking about.
EyeZo.com is an HTML5 app so it works on your iPhone, iPad, Android device and even your desktop browser. You can add it to your home screen and make it run just like any other fullscreen app.
Run a food truck business? You can update the locations behind URLs you create so your customers can find you no matter where your mobile business goes. We?re working on adding support for custom URLs too!
EyeZo URLs are permanent and extremely accurate. They are so accurate, in fact, that you could differentiate between two grains of sand sitting side by side!
Get started by tapping "Share Location" on the http://EyeZo.com/ homepage. If you drop a pin on the map, you can move it to update it?s location. If you are using geo-location, just walk around to update your location.
Tweet about us and let others know about #EyeZo. Here are a few Twitter suggestions:
-------------
Get a short URL for any location on Earth http://eyezo.com/
Show people where you are with http://eyezo.com/
Found an http://eyezo.com/ bug? Menu -> Feedback
http://eyezo.com/ is an #HTML5 app
Try http://eyezo.com/ on your iPhone or Android device - uses the geolocation API
-------------
Run into any problems? Use Menu -> Feedback to let us know. EyeZo.com is an active work in progress. Thanks for using EyeZo!
jQuery: Change or Reload an iframe for Twitter Buttons
The standard javascript Twitter buttons execute their script on page load and then never again. You are out of luck if you want to programmatically change parameters later. (such as setting the "URL to tweet") The work-around is to instead use the iframe version of Twitter buttons and use query parameters to set options.
<iframe id="twitFrame" allowtransparency="true" frameborder="0" scrolling="no" src="//platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fanders.com%2F&count=none" style="width:130px; height:20px;"></iframe>
Then change the iframe's src programmatically later to set options on the fly via jQuery. Here I change the URL to http://example.com/.
$( '#twitFrame' ).attr( 'src', '//platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fexample.com%2F&count=none' );
Getting the Linux Kernel Config from a Running System
If you need to get the configuration of a running Linux kernel, have a look at:
/proc/config.gz
You might use that like this:
zcat /proc/config.gz > /usr/src/linux/.config
If /proc/config.gz isn't there (ie the kernel was compiled without CONFIG_IKCONFIG_PROC) have a look at:
/usr/src/linux/scripts/extract-ikconfig
Sloppy Reporting
This past week, details of our republic wireless skunkworks project at Bandwidth.com were splashed somewhat prematurely across the tech press starting with an article on TechCrunch. That was quickly followed up by GigaOm adding some detail including our $19 price point. Since then, most stories have fallen into one of two buckets. The first bucket is some blend of the above sources and the second presumably was started by this Forbes story. Notably, the Forbes writer mentions a $20 price point and claims that the parent company is Broadband.com. Thankfully, Bandwidth.com owns the domain Broadband.com but this is just sloppy reporting. I would assume people hearing $19 might think that means $19.99 and shorten it to $20 but that just isn't the case here either. The errors in this story, however, make it easier to see where various publications get their information and it is very interesting to track the proliferation.
Accurate:
TechCrunch
GigaOm
PC World
Not so accurate:
Forbes
TMC.net
VoIP Catalog
nginx and Intermediate SSL Certificates
Unlike Apache which takes intermediate SSL certificates using a specific config file directive:
SSLCertificateChainFile /sites/api.anders.com/conf/PositiveSSL.ca-bundle
nginx vends out intermediate certificates by concatenating them together between the server certificate and the root certificate in a single file. You can very simply do this with cat:
cat site.crt intermediate.crt root.crt > chain.pem
Don't forget, order matters here!