ZFS Jails Management

[ Available lists | Index of freebsd-jail | Month of Mar 2008 | Week of 8 Mar 2008 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Jeffrey Smith <jeffrey.smith@futurecis.com>
Date
8 Mar 2008 17:58:08
Subject
ZFS Jails Management
Message-ID
1204997488.26124.45.camel@mrwizard.futurecis.com


[ Hide this part ]
I created a little cheat sheet for ZFS Jails (don't know if already
exists, can't find it by google). This works but was wondering if there
was a better way, or ways to improve this.

ZFS Jails


#zpool create pool
#zfs create -o mountpoint=jails pool/jails
#zfs create pool/jails/jailbase
#mkdir -p /jails/7.0-RELEASE/base /jails/7.0-RELEASE/manpages
#cd /jails/7.0-RELEASE/base

NOTE: Files can also be copied from Disc1 cdrom

#ftp ftp.freebsd.org:/pub/FreeBSD/releases/amd64/7.0-RELEASE/base/

ftp>mget *
ftp>cd ../manpages
ftp>lcd ../manpages
ftp>mget *
ftp>exit

#export DESTDIR=/jails/jailbase
#sh install.sh
#cd ../manpages
#sh install.sh

#mkdir -p /jails/jailbase/usr/ports
#mount_nullfs /usr/ports /jails/jailbase/usr/ports
#touch /jails/jailbase/etc/fstab
#cp /etc/resolv.conf /jails/jailbase/etc
#vi /etc/rc.conf

#
# Jail Defaults
#






#
# jailbase.example.org
#




:wq

#/etc/rc.d/jail start
#jls
#jexec 1 tcsh

#set autolist

NOTE: freebsd-update appears to work, but no updates are yet available
for 7.0 to test this further
Install ports or packages that all jails will require, such as bash and
vim-lite

#exit

Back to host

#zfs snapshot pool/jails/jailbase@YYYYMMDD#
#zfs clone pool/jails/jailbase@YYYYMMDD# pool/jails/ns
#zfs clone pool/jails/jailbase@YYYYMMDD# pool/jails/mail
#zfs clone pool/jails/jailbase@YYYYMMDD# pool/jails/www
#vi /etc/rc.conf

...snip...

...snip...

#
# ns.example.org
#




#
# mail.example.org
#




#
# www.example.org
#




:wq

#/etc/rc.d/jail start
#jls


Elapsed time: 0.115 seconds