I tend to switch between Linux and OpenSolaris as my desktop operating system from time to time. To be more flexible in this setup, I store most of my work-related data (e.g. source trees, VirtualBox images) on an external 320GB USB disk drive, using the ZFS file system. While OpenSolaris supports ZFS natively, I can access the file system on Linux using zfs-fuse and I could even mount these file systems on a FreeBSD system, if needed. There aren't that many file systems that allow an easy exchange of data between (Open)Solaris and Linux – the other ones that I am aware of are FAT and UFS, which both don't give me the confidence and flexibility I need.
A while ago, I purchased a second external drive of the same size and now use both of them in a mirrored configuration. This gives me several benefits:
- Redundancy: external disk drives have a higher risk of getting physically damaged, so having a mirrored copy of my data ensures that I won't lose anything important if one of the drives dies.
- Increased performance: ZFS is capable of distributing reads across both devices, thus I get twice the speed of a single USB 2.0 port, if I connect the drives to ports attached to separate USB host controllers.
- Automatic resyncing: When I'm on the road, I only take one half of the mirror with me. In case this drive gets lost/stolen, I still have a second copy of the data at home. ZFS complains about the pool being in degraded state, but continues to work normally. When I return home, I simply attach the second drive again and ZFS automatically resyncs (resilvers) anything that has been modified in the meanwhile.
- I can use snapshots for backup purposes. I have a small Intel Atom based PC (running OpenSolaris) that acts as my central file server (using two 1TB disks in a ZFS mirror) and CUPS print server. If I want to create a backup of my external USB disks, I create ZFS snapshots of the file systems in question and transfer these to the home server using "zfs send/receive". This works both locally by connecting the drives to the server box directly or via SSH over the network. I wrote a small shell script to automate this process. The transfer is done in an incremental fashion – only the differences between the current and the last snapshot are being propagated. To save disk space on the external drives, I usually discard all older snapshots except for the last one or two. On the file server, I maintain snapshots for a longer time period. The snapshots are named by using a simple date/time timestamp (filesystem@YYYY-MM-DD-HH:MM), this makes it easy to go back to a particular snapshot in case I'm looking for something I may have removed by accident, but I still recall when it was last used.
From my experience, ZFS is a very solid and reliable solution, providing impressive functionality with a very user-friendly UI (you only need use two commands, zfs and zpool).
If you want to learn more about ZFS and how to use it in practice, consider attending my upcoming talk (in German) about this subject at FrOSCon 2010 in Sankt Augustin, Germany!