The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 jail + zfs
Author: tld 
Date:   25-08-08 12:49


ezjail isn't the fun way to play with jails. ZFS is.

First of all, the /etc/rc.d/jail script has been quite updated, and will take care of the day-to-day stuff, such as starting and stopping jails.

Simply define:

jail_psql_devfs_ruleset="devfsrules_jail" # devfs ruleset to apply to jail

And you can do:

/etc/rc.d/jail start psql

That's it. No need for a port to retrofit this.

Also, for the fun part. If you throw in ZFS in the loop, you get better control over disk usage (pr. jail or even pr. dir quotas, compression, redundancy-levels etc).

You can also snapshot jails.

That's right. If you're going to upgrade a jailed "machine", just snapshot it, test it, and roll back if there's a problem. If you have read-write userdata, simply put it in a separate zfs, and you can do it with parts of the "virtual machine".

But wait! There's more!

If you can create a base config, with most of the things you'll typically need for a jail, you can then snapshot and clone it.

If you have a base jail, and you'd like to install a 4MB package in addition to your standard stuff, the entire jail will only take up that 4MB of space.

You save RAM too. I think. Not entirely sure how ZFS fits into the FreeBSD page system, but since you're running your libc and whatnot from the same disk pages for all your jails, I'd think it's quite likely you'll save up some RAM too.

Sounds like a good plan?

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 jail + zfs   new
tld 25-08-08 12:49 
 Re: jail + zfs   new
Dan 25-08-08 13:44 
 Re: jail + zfs   new
tld 26-08-08 08:50 

 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum