Monday, December 31, 2012

Creating freeBSD vds or vps with zfs developed by Sun™

Recommend to make with 2nd disk
it is a example just we can create...
if you create zfs in main host disk, i am sure u cant boot next reboot :P

============================================
Prepare
---------
kern.geom.debugflags: 0 -> 16
freebsd82# dd if=/dev/zero of=/dev/ad0 bs=1m count=1

Build
------
freebsd82# zpool create -m /usr/ogcvps ogcdev /dev/ad0
freebsd82# zpool status
pool: ogcdev
state: ONLINE
scrub: none requested
config:

NAME      STATE    READ WRITE CKSUM
ogcdev    ONLINE   0       0         0
ad0         ONLINE   0       0         0

freebsd82# zfs set quota=10g ogcdev
freebsd82# zfs create ogcdev/ogcshell
freebsd82# zfs list
NAME USED AVAIL REFER MOUNTPOINT
ogcdev 112K 10.0G 21K /usr/ogcvps
ogcdev/ogcshell 21K 10.0G 21K /usr/ogcvps/ogcshell


freebsd82# zfs set quota=5g ogcdev/ogcshell
freebsd82# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ad0s1a 81G 1.7G 73G 2% /
devfs 1.0K 1.0K 0B 100% /dev
ogcdev 10G 22K 10G 0% /usr/ogcvps
ogcdev/ogcshell 5.0G 21K 5.0G 0% /usr/ogcvps/ogcshell

freebsd82# zfs list
NAME USED AVAIL REFER MOUNTPOINT
ogcdev 114K 10.0G 22K /usr/ogcvps
ogcdev/ogcshell 21K 5.00G 21K /usr/ogcvps/ogcshell

freebsd82# cd /usr/src
freebsd82# make installworld DESTDIR=/usr/ogcvps/ogcshell
freebsd82# make distribution DESTDIR=/usr/ogcvps/ogcshell

============================================

No comments:

Post a Comment