Showing posts with label Unix. Show all posts
Showing posts with label Unix. Show all posts

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

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

FreeBSD CUSTOM kernel recompile


=========================
PREPARE 1st source kernel build world
=========================

oGcServ# cd /boot
oGcServ# cp -Rp kernel kernel.good-09-08-2011
### if stable then, stable-supfile, else standard-supfile
# if you have installed fastest_cvsup mirror go cmd:
oGcServ# csup -h `/usr/local/bin/fastest_cvsup -q -c us` /usr/share/examples/cvsup/standard-supfile
# else
oGcServ# csup -L 2 -h cvsup2.freebsd.org /usr/share/examples/cvsup/standard-supfile
oGcServ# cd /usr/src
oGcServ# less UPDATING - check for important notes
oGcServ# make -j4 buildworld &
oGcServ# make -j4 buildkernel &
oGcServ# make KODIR=/boot/kernel.release installkernel &
oGcServ# nextboot -k kernel.release
oGcServ# shutdown -r now
oGcServ# mv /boot/kernel.release /boot/kernel
oGcServ# mergemaster -p
oGcServ# make installworld
oGcServ# mergemaster -viU
oGcServ# shutdown -r now


===================
RECOMPILE CUSTOM
===================

oGcServ# cd /usr/src/
oGcServ# make -j4 buildkernel KERNCONF=OGCBOX &
oGcServ# make KODIR=/boot/kernel.ogcbox KERNCONF=OGCBOX installkernel &
oGcServ# nextboot -k kernel.ogcbox
oGcServ# shutdown -r now
oGcServ# cp -Rp kernel kernel.bak-29-08-2011
oGcServ# mv /boot/kernel.ogcbox to /boot/kernel
oGcServ# shutdown -r now

Note: putting " & " for backgroud process. even we got disconnect from interenet, the process remain in remote server as background. helpful for Myanmar users who are using internet from stupid no stable internet connection provider. like ME. lmao rofl



FreeBSD boot error howto rescue


Yesterday i got some freeezzz my box fvkBSD while changing in loader.conf
If something wrong loader.conf, we can rescue setting from boot loader.
To fix variable setting:

1. reboot fvkBSD box
2. FreeBSD boot menu -> Press 6 to select "Escape to loader prompt"
3. In loader prompt, type: "show" there u can see loader setting. press page down and search wrong setting that you set before.
4. fix correct type: "set (variable)=(correct value)"
5 after set value, type: boot


Good Luck...

http:// mirror instead of ftp:// for pkg manage


all you know our myanmar users restrict ftp ports, i got problem too.. when i use pkg_add package in freebsd... so i would like to advice to replace http mirror instead of ftp..

if you are using bash shell..
# export PACKAGEROOT='http://ftp.FreeBSD.org'

if you are using csh default shell...
# setenv PACKAGEROOT='http://ftp.FreeBSD.org'

i hope that will help you more... :P