top

Posts tagged with zfs

ZFS: Instant "online" Backups

We had several web sites hosted by lighttpd on a single server. We wanted to make on-line backups of them, something we've procrastinated a long time! Once you see how simple it is to make online backups of your data with our OpenSolaris VPS ZFS file system, we hope you won't follow the same path as us and spend some minor time now to save some trouble later.

We wanted to make backup of all the data in /var/lighttpd, where all of our actual web site data lives. Here's what we did.

root@mask:/# zfs create zones/mask/ROOT/lighttpd
root@mask:/# zfs get mountpoint zones/mask/ROOT/lighttpd
NAME PROPERTY VALUE SOURCE
zones/mask/ROOT/lighttpd mountpoint legacy inherited from zones/mask/ROOT
root@mask:/#

Now disable lighttpd, move the data, and create new ZFS snapshot.

root@mask:/# svcadm disable lighttpd14
root@mask:/# mv /var/lighttpd /var/lighttpd.old
root@mask:/# zfs set mountpoint=/var/lighttpd zones/mask/ROOT/lighttpd
root@mask:/# cd /var
root@mask:/var# mv lighttpd.old/* lighttpd
root@mask:/var# zfs snapshot zones/mask/ROOT/lighttpd@backup
root@mask:/var# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
zones/mask/ROOT/lighttpd@backup 0 - 411M -
zones/mask/ROOT/zbe@backup 143M - 1.12G -
root@mask:/var#

That's it! What just happened?

We took a snapshot of the full file system as it was when we ran that zfs snapshot command. This is a real file system backup, which can be used to restore to if there is ever a need.

Of course, this is just the beginning. You can destroy snapshots and use these snapshots to make offline backups. More on these topics later, or better yet, give them a shot yourself. There are lots of resources on Google.

Want to learn more? Why not purchase our OpenSolaris VPS servers from Entic.net, powered by ZFS? We're sure you'll love it. It'll simplify your life, and you might even like it more than Linux!

Solid State Disks, a premier

SSD's are flash based drives (a more advanced version of the one you might find in a digital camera) connected to SATA interfaces. There are no moving parts and hence are faster than HDD's but slower than RAM. SSD's fit in the middle and have benefits of both.

SSD's have very low seek time (no moving parts), the amount of time it takes to go find the data on the storage media. This is what gives them the edge over HDD's, but they are still connected to a SATA interface, limiting it to the same throughput as a SATA HDD. SSD's are especially great for random IO.

There are two kinds of SSD's: SLC and MLC. SLC is a single-cell, storing 1 bit in each memory cell. MLC is a multilevel cell, storing 2 or 3 bits in a cell. MLC's have more capacity but the catch is: SSD's are generally slower at writes, they need to clear the cells (pages) before writing to it. It is a two step process for writes.

SSD's prices are dropping a lot. Expect to see more of them in the coming years. They also save on power and are great for laptops!

In servers, and especially ZFS file systems, SSD's come especially handy.

OpenSolaris 2009.06 Zones and ZFS

Don't mess with the the ZFS cloned BE (boot environments) of the zones using zfs commands. There is very little documentation out there, so here is what we've found with ZFS, zones, and IPS upgrades.

If you have a zone that went through a pkg image-update, you'll notice there are a couple of new cloned ROOT file systems for your zones:

root@vps1:/# zfs get -r mounted,origin,mountpoint zones/tail
NAME PROPERTY VALUE SOURCE
zones/tail mounted yes -
zones/tail origin - -
zones/tail mountpoint /zones/tail default
zones/tail/ROOT mounted no -
zones/tail/ROOT origin - -
zones/tail/ROOT mountpoint legacy local
zones/tail/ROOT/zbe mounted no -
zones/tail/ROOT/zbe origin - -
zones/tail/ROOT/zbe mountpoint legacy local
zones/tail/ROOT/zbe@zbe-1 mounted - -
zones/tail/ROOT/zbe@zbe-1 origin - -
zones/tail/ROOT/zbe@zbe-1 mountpoint - -
zones/tail/ROOT/zbe-1 mounted yes -
zones/tail/ROOT/zbe-1 origin zones/tail/ROOT/zbe@zbe-1 -
zones/tail/ROOT/zbe-1 mountpoint legacy local
root@vps1:/#

Everything below zones/tail/ROOT have a zoned ZFS property. They behave a bit differently, and make it so the zone's can use ZFS root securely. That's good, but what is going on with all of that cloned file systems, the zbe and zbe-1?

zbe is the ROOT fs before the upgrade. zbe-1 is the new ROOT, after the upgrade. zbe-1 is just the clone of the zbe, as indicated with the origin property above, this is great because clones use less disk space.

zbe-1 is the one being used now. In case the global zone was to be reverted back to an original environment, the zone tail will then use zbe as the ROOT fs. This is done automatically when beadm command is used (in the global zone) to manipulate the boot environments. You should not go around destroying the zbe fs in an attempt to clean up disk space. It is tied to the BE of the global zone.

If you have a OpenSolaris VPS with us, and you want to create a snapshot of your zone, we recommend you create a snapshot of the mounted zfs file system above (in this case, you can do: zfs snapshot zones/tail/ROOT/zbe-1@backup). If you create a snapshot of zbe, and you need to restore it, we will not restore it, unless we restore the global zone to that be.

New SSD servers (flash drives)

Sun just announced some SSD based servers. This is just awesome news. We'll hopefully get some of them soon and can start offering it to our customers. Stay tuned.



*think* SSD and ZFS's HSP (hybrid storage pools).



Update: Has anyone tried to use these SSD drives as swap devices instead of using ZFS's HSP? I posed this question to Adam. It'll be a good test to see how ZFS+SSD vs UFS+SSD performs.

 1