Cyber memos for my personal knowledge.

2008-09-07

RHAS4+PXE+DRBL+CloneZilla setup

This is a memo of my experience to setup a DRBL+CloneZilla server.
I use offline intallation method.

(A). Base OS and DRBL installation
Linux server installation (RHAS4 for example):
1. Use default installation. DISABLE SELINUX and firewall (iptable).
2. If necessary, use REISERFS, otherwise use EXT2/EXT3.
3. Don’t install office, multimedia, game, video/sound…etc.
4. Manually install some missing RPMs: perl-Digest-SHA1, dhcp, ypserv, tftp-server for RHAS4 (with root permission).

$ rpm –ivh perl-Digest-SHA1-xxx.rpm
$ rpm –ivh dhcp-xxx.rpm
$ rpm –ivh tftp-server-xxx.rpm
$ rpm –ivh ypserv-xxx-rpm

5. Setup network interface eth0:1 if necessary (IP alias if your only have 1 NIC).
Modify /etc/sysconfig/network-scripts/ifcfg-eth0:1.
Reference site: http://drbl.nchc.org.tw/one4all/desktop/ip_alias.txt
6. Setup HDD DMA=1 if necessary. (/etc/sysconfig/harddisks).

Download and make new kernel RPM:
1. Make new kernel RPM to built-in support (not module) ide-generic in our case and some NIC drivers.
2. Reference site: http://www.howtoforge.com/kernel_compilation_fedora

Download and install DRBL related RPMs (use root permission):
1. Download DRBL GPG key: http://drbl.nchc.org.tw/GPG-KEY-DRBL
2. $ rpm --import GPG-KET-DRBL
3. Download DRBL main RPM:
http://drbl.nchc.org.tw/one4all/desktop/download/stable/RPMS/drbl-current.i386.rpm
4. $ rpm –ivh drbl-current.i386.rpm
5. Download extra DRBL RPMs:
http://drbl.sourceforge.net/drbl-core/i386/RPMS.drbl-stable/
6. $ rpm –ivh xxx.rpm to install all extra RPMs (CloneZilla RPM should be the last one to install).
Before you perform next section, it is better to do a reboot.

(B). DRBL setup – OFFLINE mode (use root permission)
1. Type command: $ /opt/drbl/sbin/drblsrv-offline –k (kernel RPM) to use specified kernel RPM or $ /opt/drbl/sbin/drblsrv-offline –s `uname -r` to use same kernel as server used.
2. DRBL will check all necessary RPMs automatically. If need, press Ctrl+C to cancel DRBL setup process. Follow on-screen instruction to answer question.
3. Type command: $ /opt/drbl/sbin/drblpush –i to push settings to clients node. Follow on-screen instruction to answer question.
Reference site: http://drbl.nchc.org.tw/one4all/desktop/examples/
4. Type command: $ /opt/drbl/sbin/mknic-nbi –t initramfs –k (Kernel version that
client used)
to make initramfs boot image for clients.
5. Copy image "folder" to /home/partimag directory (default path). For example: /home/partimag/20080812-beta3-image

(C). Setup image restore option and PXE menu (use root permission):
Unicast restore:
1. Type command: $ /opt/drbl/sbin/drbl-ocs -b --nogui -s -x -r [-p command] [--run-postrun-dir] startdisk restore 20080812-beta3-image "hda"
-b: batch mode. No question aksed.
--nogui: without GUI during restore process.
-s: Don’t detect client HW.
-x: Try to enable full-duplex in UDPcast. (only work with switch, not hub.)
-r: Try to resize partition after restore process finished.
-p [reboot | poweroff | command]: Post-action after restore process finished.
--run-postrun-dir: Excute program or shell script under /opt/drbl/share/ocs/postrun after restore precess finished.
--run-prerun-dir: Excute program or shell script under /opt/drbl/share/ocs/prerun after restore precess finished.
[startdisk | startparts]: CloneZilla restoring mode.
[restore | multicast_restore | save]: CloneZilla restoring type.
20080812-beta3-image: Image "folder" under /home/partimag.
“hda”: device or partition in image to restore.

Multicast restore:
1. Type command: $ /opt/drbl/sbin/drbl-ocs -b --nogui –s -r [-p command]
--clients-to-wait 1 --time-to-wait 10 --max-time-to-wait 60 [--run-postrun-dir]
startdisk multicast_restore 20080812-beta3-image "hda"
-b: batch mode. No question aksed.
--nogui: without GUI during restore process.
-s: Don’t detect client HW.
-r: Try to resize partition after restore process finished.
-p [reboot | poweroff | command]: Post action after restore process finished.
--clients-to-wait NUM: Minimum numbers of client to wait before restore process starting.
--time-to-wait NUM: Minimum seconds to wait before restore process starting.
--max-time-to-wait NUM: Maximum seconds to wait before restore process starting (to avoid CloneZilla service time-out).
--run-postrun-dir: Excute program or shell script under /opt/drbl/share/ocs/postrun after restore precess finished.
--run-prerun-dir: Excute program or shell script under /opt/drbl/share/ocs/prerun after restore precess finished.
[startdisk | startparts]: CloneZilla restoring mode.
[restore | multicast_restore | save]: CloneZilla restoring type.
20080812-beta3-image: Image "folder" under /home/partimag.
“hda”: device or partition in image to restore.

Misc:
*** Open every shell script to read and study so that you can know every thing that DRBL+CloneZilla server does! ***

PXE boot menu is: /tftpboot/nbi_img/pxelinux.cfg/default
Postrun dir is: /opt/drbl/share/ocs/postrun
DRBL conf dir: /etc/drbl and /opt/drbl/conf
DRBL official site: http://drbl.nchc.org.tw/ or http://drbl.sourceforge.net/
FAQ: http://drbl.nchc.org.tw/faq/ or http://drbl.sourceforge.net/faq/

No comments: