在 PXE Server 功能表加上 Parted Magic

Parted Magic 是一套功能強大的硬碟分割工具,之前的版本是免費的,但目前新版本似乎是要收費的。
Parted Magic 官方網站:http://partedmagic.com/

[@more@]這裡以 Parted Magic 2013_08_01 為例:
1. 建立 pmagic 目錄
# mkdir /var/lib/tftpboot/pmagic

2. 將 Parted Magic 2013_08_01 ISO 光碟中的 pmagic 中的 bzImage 和 initrd.img 複製到 /var/lib/tftpboot/pmagic 目錄

3. 修改 PXE Server 設定檔
# vim /var/lib/tftpboot/pxelinux.cfg/default
LABEL partmagic
  MENU LABEL PartMagic 2013_08_01
  LINUX pmagic/bzImage
  INITRD pmagic/initrd.img
  APPEND edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256

4. 開機過程

時區設定

開機完成

PXE Server 的功能表

如果沒有特別做設定,PXE Server 的功能表就是這樣醜醜的

但也可以加上背景圖,以 DRBL PXE 為例
[@more@]DRBL PXE 功能表設定
default vesamenu.c32
# 倒數計時時間(7sec)
timeout 70
prompt 0
noescape 1
MENU MARGIN 5
# 背景圖
MENU BACKGROUND drblwp.png
# Set the color for unselected menu item and timout message
MENU COLOR UNSEL 7;32;41 #c0000090 #00000000
MENU COLOR TIMEOUT_MSG 7;32;41 #c0000090 #00000000
MENU COLOR TIMEOUT 7;32;41 #c0000090 #00000000
MENU COLOR HELP 7;32;41 #c0000090 #00000000

# MENU MASTER PASSWD

say **********************************************
say Welcome to DRBL.
say NCHC Free Software Labs, Taiwan.
say http://drbl.org; http://drbl.nchc.org.tw
say **********************************************

# Allow client to edit boot parameters
ALLOWOPTIONS 1

# simple menu title
MENU TITLE DRBL (http://drbl.org)

label drbl
# 預設選項
  MENU DEFAULT
  # MENU HIDE
  MENU LABEL Ubuntu 14.04 Linux (DRBL mode, mostly local resources)
  # MENU PASSWD
  kernel vmlinuz-pxe
  append initrd=initrd-pxe.img devfs=nomount drblthincli=off selinux=0 quiet edd=on
# 下方的說明
  TEXT HELP
  * DRBL version: 2.6.15-1. (C) 2003-2014, NCHC, Taiwan
  * Disclaimer: DRBL comes with ABSOLUTELY NO WARRANTY
  ENDTEXT

label clonezilla
  # MENU DEFAULT
# 功能表隱藏
  MENU HIDE
  MENU LABEL Clonezilla
  # MENU PASSWD
  kernel vmlinuz-pxe
  append initrd=initrd-pxe.img devfs=nomount drblthincli=off selinux=0 quiet text 1 edd=on
  TEXT HELP
  * Clonezilla version: 3.5.2-2. (C) 2003-2014, NCHC, Taiwan
  * Disclaimer: Clonezilla comes with ABSOLUTELY NO WARRANTY
  ENDTEXT

label local
  # MENU DEFAULT
  # MENU HIDE
  MENU LABEL Local operating system (if available)
  # MENU PASSWD
  # 2 method to boot local device:
  # (1) For localboot 0, it is decided by boot order in BIOS, so uncomment the follow 1 line if you want this method:
  # localboot 0

  # (2) For chain.c32, you can assign the boot device.
  # Ref: extlinux.doc from syslinux
  # Syntax: APPEND [hd|fd]<number> [<partition>]
  # [<partition>] is optional.
  # Ex:
  # Second partition (2) on the first hard disk (hd0);
  # Linux would *typically* call this /dev/hda2 or /dev/sda2, then it’s “APPEND hd0 2”
  #
  kernel chain.c32
  append hd0
  TEXT HELP
  Boot local OS from first hard disk if it’s available
  ENDTEXT

背景圖資訊

在 Ubuntu Server 14.04 上安裝 PXE Server

之前的安裝方式是採用手動一一安裝所須套件,這裡是直接改用 DRBL 所提供的套件。
[@more@]1. 安裝
安裝 tftp 和 dhcp server 及一些所須的套件
# apt-get -y install tftpd tftp isc-dhcp-server update-inetd xinetd clonezilla drbl
建立 dhcp server 設定檔
# vim /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.201 192.168.1.210;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.254;
    option broadcast-address 192.168.1.255;
    filename “pxelinux.0”;
    next-server 192.168.1.124;
}

2. 啟動 dhcpd server
# /etc/init.d/isc-dhcp-server restart
 * Stopping ISC DHCP server dhcpd                                        [fail]
 * Starting ISC DHCP server dhcpd                                        [ OK ]

3. 檢查 dhcpd server 是否有正常啟動
# netstat -lu | grep boot
udp        0      0 *:bootps                *:*
udp        0      0 *:bootpc                *:*

4. 修改 tftpd server 設定,設定目錄在 /tftpboot/nbi_img
# vim /etc/xinetd.d/tftp
service tftp
{
    disable = no
    socket_type     = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server          = /usr/sbin/in.tftpd
    server_args     = -s /tftpboot/nbi_img
    per_source      = 11
    cps         = 100 2
    flags           = IPv4
}

4. 重新啟動 xinetd
# service xinetd restart

5. 檢查 tftpd server 是否有正常啟動
# netstat -lu | grep tftp
udp        0      0 *:tftp                  *:*

6. 安裝 syslinux
# apt-get install syslinux

7. 建立 PXE 開機的開機選單
# vim /tftpboot/nbi_img/pxelinux.cfg/default

在 Ubuntu Server 14.04 安裝 PXE Server

在 Ubuntu Server 14.04 安裝 PXE Server 主要是想利用 PXE Server 搭配 Clonezilla 來備份及還原 Client 端作業系統。
參考網站:
How to Setup a PXE Server on Ubuntu
PXE Boot Server Installation Steps in Ubuntu Server VM – Ask Ubuntu

安裝 tftp 和 dhcp server 及一些所須的套件
# apt-get -y install tftpd-hpa isc-dhcp-server lftp openbsd-inetd inetutils-inetd
建立 dhcp server 設定檔
# vim /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.201 192.168.1.210;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.254;
    option broadcast-address 192.168.1.255;
    filename “pxelinux.0”;
    next-server 192.168.1.124;
}
[@more@]啟動 dhcpd server
# /etc/init.d/isc-dhcp-server restart
 * Stopping ISC DHCP server dhcpd                                        [fail]
 * Starting ISC DHCP server dhcpd                                        [ OK ]

檢查 dhcpd server 是否有正常啟動
# netstat -lu | grep boot
udp        0      0 *:bootps                *:*
udp        0      0 *:bootpc                *:*

修改 tftpd server 設定
# vim /etc/inetd.conf
加入下面一行
tftp    dgram   udp wait    root    /usr/sbin/in.tftpd  /usr/sbin/in.tftpd -s /var/lib/tftpboot

# update-inetd –enable BOOT
# /etc/init.d/openbsd-inetd restart
 * Restarting internet superserver inetd                                 [ OK ]
# /etc/init.d/tftpd-hpa restart

檢查 tftpd server 是否有正常啟動
# netstat -lu | grep tftp
udp        0      0 *:tftp                  *:*

安裝 syslinux
# apt-get install syslinux

複製設定檔到 /var/lib/tftpboot 目錄
# cp /usr/lib/syslinux/menu.c32  /var/lib/tftpboot
# cp /usr/lib/syslinux/vesamenu.c32 /var/lib/tftpboot
# cp /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot
# cp /usr/lib/syslinux/memdisk /var/lib/tftpboot
# cp /usr/lib/syslinux/mboot.c32 /var/lib/tftpboot
# cp /usr/lib/syslinux/chain.c32 /var/lib/tftpboot

建立 /var/lib/tftpboot/pxelinux.cfg 目錄,用來存放 PXE 開機時 Client 端的一些設定
# mkdir /var/lib/tftpboot/pxelinux.cfg

建立 PXE 開機的開機選單
# vim /var/lib/tftpboot/pxelinux.cfg/default
UI vesamenu.c32
TIMEOUT 300
MENU TITLE Welcom to Tou-Cheng Elementary School PXE Server System

LABEL local
  MENU LABEL Boot from local drive
  MENU DEFAULT
  localboot 0

開機畫面

透過 PXE Server 安裝 Ubuntu 13.10 Server

# mkdir /mnt/{Ubuntu-12.04.3-amd64,Ubuntu-12.04.3-i386,Ubuntu-13.10-amd64,Ubuntu-13.10-i386}
# mount -o loop /var/ftp/pub/ubuntu-13.10-server-amd64.iso /mnt/Ubuntu-13.10-amd64
# mount -o loop /var/ftp/pub/ubuntu-13.10-server-i386.iso /mnt/Ubuntu-13.10-i386

# mkdir -p /var/lib/tftpboot/Ubuntu/{1310,1204}/{amd64,i386}

# cp /mnt/Ubuntu-13.10-amd64/install/netboot/ubuntu-installer/amd64/linux /var/lib/tftpboot/images/Ubuntu/1310/amd64
# cp /mnt/Ubuntu-13.10-amd64/install/netboot/ubuntu-installer/amd64/initrd.gz /var/lib/tftpboot/images/Ubuntu/1310/amd64

# vim /var/lib/tftpboot/pxelinux.cfg/Ubuntu_Server
LABEL Install Ubuntu 13.10 Server amd64
        MENU LABEL Install Ubuntu 13.10 Server amd64
        kernel images/Ubuntu/1310/amd64/linux
        append initrd=images/Ubuntu/13.10/amd64/initrd.gz ramdisk_size=65535 vga=normal url=http://192.168.1.6/us1310-amd64/preseed.cfg

# mkdir /var/www/html/us1310-amd64
# vim /var/www/html/us1310-amd64/preseed.cfg
# Components to use for loading installer components (options).
d-i mirror/udeb/components multiselect main
# Apt Setup
d-i apt-setup/restricted boolean false
d-i apt-setup/universe boolean false
d-i apt-setup/backports boolean false
d-i apt-setup/non-free boolean false
d-i apt-setup/contrib boolean false
# Don’t want to use a network mirror
d-i apt-setup/use_mirror boolean false
d-i apt-setup/services-select multiselect none
d-i apt-setup/security-updates boolean false
d-i apt-setup/another boolean false
# Soultion for could not find any live images
d-i live-installer/net-image string

http://192.168.1.6/Ubuntu-13.10-amd64/install/filesystem.squashfs

# mount –bind /mnt/Ubuntu-13.10-amd64 /var/www/html/Ubuntu-13.10-amd64

透過 PXE Server 使用 Samba 和 Clonezilla 自動備份及還原

主要是在 PXE Server 的功能表,使用 Samba 和 Clonezilla 做自動的備份及還原,另外因為要做到自動化,所以 Samba Server 是設定成不用密碼就可以使用,但在防火牆上要限定連線來源。

修改 PXE Server 功能表,因為執行的時候會覆蓋原有的備份檔和把 Windows 系統磁碟還原,所以在選項上加上了密碼,避免誤觸
要注意的是 append initrd 到後面算是一行
# vim /var/lib/tftpboot/pxelinux.cfg/Backup_Restore
LABEL Clonezilla Livei Samba AutoBackup
        MENU LABEL Clonezilla Live Samba ^AutoBackup
        MENU PASSWD CloneZilla
        kernel images/Clonezilla/live/vmlinuz
        append initrd=images/Clonezilla/live/initrd.img boot=live config username=user quiet noswap edd=on nomodeset noeject locales=”zh_TW.UTF-8″ keyboard-layouts=”NONE” ocs_live_run=”/usr/sbin/ocs-sr -q2 -j2 -z1p -p true saveparts Win7Backup sda1″ ocs_live_extra_param=”” ocs_live_batch=”yes” ocs_prerun=”mount -t cifs //192.168.1.6/public /home/partimag” vga=788 ip=frommedia nosplash fetch=tftp://192.168.1.6/images/Clonezilla/live/filesystem.squashfs

LABEL Clonezilla Livei Samba AutoRestore
        MENU LABEL Clonezilla Live Samba ^AutoRestore
        MENU PASSWD CloneZilla
        kernel images/Clonezilla/live/vmlinuz
        append initrd=images/Clonezilla/live/initrd.img boot=live config username=user quiet noswap edd=on nomodeset noeject locales=”zh_TW.UTF-8″ keyboard-layouts=”NONE” ocs_live_run=”/usr/sbin/ocs-sr –batch -g auto -e1 auto -e2 -r -j2 -p reboot restoreparts Win7Backup sda1″ ocs_live_extra_param=”” ocs_live_batch=”yes” ocs_prerun=”mount -t cifs //192.168.1.6/public /home/partimag” vga=788 ip=frommedia nosplash fetch=tftp://192.168.1.6/images/Clonezilla/live/filesystem.squashfs

透過 PXE Server 使用 NFS 和 Clonezilla 自動備份及還原

主要是在 PXE Server 的功能表,使用 NFS 和 Clonezilla 做自動的備份及還原

修改 PXE Server 功能表,因為執行的時候會覆蓋原有的備份檔和把 Windows 系統磁碟還原,所以在選項上加上了密碼,避免誤觸
要注意的是 append initrd 到後面算是一行
# vim /var/lib/tftpboot/pxelinux.cfg/Backup_Restore
LABEL Clonezilla Livei nfs AutoBackup
        MENU LABEL Clonezilla Live nfs ^AutoBackup
        MENU PASSWD CloneZilla
        kernel images/Clonezilla/live/vmlinuz
        append initrd=images/Clonezilla/live/initrd.img boot=live config username=user quiet noswap edd=on nomodeset noeject locales=”zh_TW.UTF-8″ keyboard-layouts=”NONE” ocs_live_run=”/usr/sbin/ocs-sr -q2 -j2 -z1p -p true saveparts Win7Backup sda1″ ocs_live_extra_param=”” ocs_live_batch=”yes” ocs_prerun=”mount -t nfs4 192.168.1.6:/var/lib/tftpboot/Backup /home/partimag” vga=788 ip=frommedia nosplash netboot=nfs nfsroot=192.168.1.6:/var/lib/tftpboot/images/Clonezilla

LABEL Clonezilla Livei nfs AutoRestore
        MENU LABEL Clonezilla Live nfs ^AutoRestore
        MENU PASSWD CloneZilla
        kernel images/Clonezilla/live/vmlinuz
        append initrd=images/Clonezilla/live/initrd.img boot=live config username=user quiet noswap edd=on nomodeset noeject locales=”zh_TW.UTF-8″ keyboard-layouts=”NONE” ocs_live_run=”/usr/sbin/ocs-sr –batch -g auto -e1 auto -e2 -r -j2 -p reboot restoreparts Win7Backup sda1″ ocs_live_extra_param=”” ocs_live_batch=”yes” ocs_prerun=”mount -t nfs4 192.168.1.6:/var/lib/tftpboot/Backup /home/partimag” vga=788 ip=frommedia nosplash netboot=nfs nfsroot=192.168.1.6:/var/lib/tftpboot/images/Clonezilla

PXE Client 端的功能表

PXE Client 端的功能表,預設會讀取 /var/lib/tftpboot/pxelinux.cfg 目錄下的 default 當做設定檔,但也可以每一台 PXE Client 端都有自己的功能表設定檔,如果是在電腦教室,每一台電腦的設備都會是一樣,所以使用共用的設定是沒有問題的,但如果像是辦公室,每個人的每一台電腦設備、作業系統……,和要求的功能也有所不同,這時候就有必要,為不同的 PXE Client 端設定不同的設定檔。[@more@]PXE Client 端在開機時,會搜尋 /var/lib/tftpboot/pxelinux.cfg 目錄之下是否有 01-aa-bb-cc-dd-ee-ff 的設定檔,其中 aa-bb-cc-dd-ee-ff 就是 PXE Client 端的網路卡卡號
   01:00:15:58:6b:7d –> 01-00-15-58-6b-7d

如果找不到,接著搜尋是否有 AABBCCDD 的設定檔,其中 AABBCCDD 就是 PXE Client 端的 IP 的 16 進位
   192.168.1.11 –> C0A8010B
   192 –> C0
   168 –> A8
   1 –> 01
   11 –> 0B

如果都找不到,就會抓取 /var/lib/tftpboot/pxelinux.cfg/default 當做是功能表

多層 PXE 功能表

因為 PXE 功能表的選項愈來愈多,一個頁面放不下,所以修改 PXE 功能表,讓 PXE 功能表可以有很多層。
底下文章參考: http://wiki.centos.org/HowTos/PXE/PXE_Setup/Menus

# vim /var/lib/tftpboot/pxelinux.cfg/default
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

MENU TITLE Welcom to Tou-Cheng Elementary School PXE Server System

LABEL local
MENU LABEL Boot from local hard drive
LOCALBOOT 0

LABEL Install CentOS 6.5 x86_64 Servers
MENU LABEL Install CentOS 6.5 x86_64 Servers
MENU PASSWD CentOS
KERNEL menu.c32
APPEND pxelinux.cfg/x86_64_Servers

LABEL Install CentOS 6.5 x86 Servers
MENU LABEL Install CentOS 6.5 x86 Servers
MENU PASSWD CentOS
KERNEL menu.c32
APPEND pxelinux.cfg/x86_Servers

LABEL Backup / Restore
MENU LABEL Backup / Restore
MENU PASSWD BR
KERNEL menu.c32
APPEND pxelinux.cfg/Backup_Restore

LABEL Tools
MENU LABEL Tools
KERNEL menu.c32
APPEND pxelinux.cfg/tools[@more@]# cat /var/lib/tftpboot/pxelinux.cfg/x86_64_Servers
MENU TITLE Install CentOS 6.5 x86_64 Server Menu

LABEL Main Menu
MENU LABEL ^Return Main Menu
KERNEL menu.c32
APPEND pxelinux.cfg/default

LABEL Install CentOS 6.5 x86_64 from FTP
MENU LABEL Install CentOS 6.5 x86_64 from FTP
kernel images/CentOS/6.5/x86_64/vmlinuz
append initrd=images/CentOS/6.5/x86_64/initrd.img method=ftp://192.168.1.6/CentOS/6.5/os/x86_64/

LABEL Install CentOS 6.5 x86_64 from HTTP
MENU LABEL Install CentOS 6.5 x86_64 from HTTP
kernel images/CentOS/6.5/x86_64/vmlinuz
append initrd=images/CentOS/6.5/x86_64/initrd.img method=http://192.168.1.6/CentOS/6.5/os/x86_64/

LABEL Install CentOS 6.5 x86_64 from NFS
MENU LABEL Install CentOS 6.5 x86_64 from NFS
kernel images/CentOS/6.5/x86_64/vmlinuz
append initrd=images/CentOS/6.5/x86_64/initrd.img method=http://192.168.1.6/CentOS/6.5/os/x86_64/

LABEL AutoInstall CentOS 6.5 x86_64 from FTP
MENU LABEL AutoInstall CentOS 6.5 x86_64 from FTP
kernel images/CentOS/6.5/x86_64/vmlinuz
append initrd=images/CentOS/6.5/x86_64/initrd.img ks=ftp://192.168.1.6/ks/ks.cfg method=ftp://192.168.1.6/CentOS/6.5/os/x86_64/

LABEL AutoInstall CentOS 6.5 x86_64 from HTTP
MENU LABEL AutoInstall CentOS 6.5 x86_64 from HTTP
kernel images/CentOS/6.5/x86_64/vmlinuz
append initrd=images/CentOS/6.5/x86_64/initrd.img ks=http://192.168.1.6/ks/ks.cfg method=http://192.168.1.6/CentOS/6.5/os/x86_64/

LABEL AutoInstall CentOS 6.5 x86_64 from NFS
MENU LABEL AutoInstall CentOS 6.5 x86_64 from NFS
kernel images/CentOS/6.5/x86_64/vmlinuz
append initrd=images/CentOS/6.5/x86_64/initrd.img ks=http://192.168.1.6/ks/ks.cfg method=http://192.168.1.6/CentOS/6.5/os/x86_64/

# cat /var/lib/tftpboot/pxelinux.cfg/x86_Servers
MENU TITLE Install CentOS 6.5 x86 Server Menu

LABEL Main Menu
MENU LABEL ^Return Main Menu
KERNEL menu.c32
APPEND pxelinux.cfg/default

LABEL Install CentOS 6.5 i386 from FTP
MENU LABEL Install CentOS 6.5 i386 from FTP
kernel images/CentOS/6.5/i386/vmlinuz
append initrd=images/CentOS/6.5/i386/initrd.img method=ftp://192.168.1.6/CentOS/6.5/os/i386/

LABEL Install CentOS 6.5 i386 from HTTP
MENU LABEL Install CentOS 6.5 i386 from HTTP
kernel images/CentOS/6.5/i386/vmlinuz
append initrd=images/CentOS/6.5/i386/initrd.img method=http://192.168.1.6/CentOS/6.5/os/i386/

LABEL Install CentOS 6.5 i386 from NFS
MENU LABEL Install CentOS 6.5 i386 from NFS
kernel images/CentOS/6.5/i386/vmlinuz
append initrd=images/CentOS/6.5/i386/initrd.img method=http://192.168.1.6/CentOS/6.5/os/i386/

LABEL AutoInstall CentOS 6.5 i386 from FTP
MENU LABEL AutoInstall CentOS 6.5 i386 from FTP
kernel images/CentOS/6.5/i386/vmlinuz
append initrd=images/CentOS/6.5/i386/initrd.img ks=ftp://192.168.1.6/ks/ks.cfg method=ftp://192.168.1.6/CentOS/6.5/os/i386/

LABEL AutoInstall CentOS 6.5 i386 from HTTP
MENU LABEL AutoInstall CentOS 6.5 i386 from HTTP
kernel images/CentOS/6.5/i386/vmlinuz
append initrd=images/CentOS/6.5/i386/initrd.img ks=http://192.168.1.6/ks/ks.cfg method=http://192.168.1.6/CentOS/6.5/os/i386/

LABEL AutoInstall CentOS 6.5 i386 from NFS
MENU LABEL AutoInstall CentOS 6.5 i386 from NFS
kernel images/CentOS/6.5/i386/vmlinuz
append initrd=images/CentOS/6.5/i386/initrd.img ks=http://192.168.1.6/ks/ks.cfg method=http://192.168.1.6/CentOS/6.5/os/i386/

# cat /var/lib/tftpboot/pxelinux.cfg/Backup_Restore
MENU TITLE Backup / Restore Menu

LABEL Main Menu
MENU LABEL ^Return Main Menu
KERNEL menu.c32
APPEND pxelinux.cfg/default

LABEL Symantec Ghost
MENU LABEL ^Symantec Ghost
MENU PASSWD Ghost
kernel memdisk
append initrd=images/dos/GHO1151.IMG

LABEL Clonezilla Live tftp
MENU LABEL Clonezilla Live ^tftp
MENU PASSWD CloneZilla
kernel images/Clonezilla/live/vmlinuz
append initrd=images/Clonezilla/live/initrd.img boot=live config username=user quiet noswap edd=on nomodeset noeject locales=”zh_TW.UTF-8″ keyboard-layouts=”NONE” ocs_live_run=”ocs-live-general” ocs_live_extra_param=”” ocs_live_batch=no vga=788 ip=frommedia nosplash fetch=tftp://192.168.1.6/images/Clonezilla/live/filesystem.squashfs

LABEL Clonezilla Livei nfs
MENU LABEL Clonezilla Live ^nfs
MENU PASSWD CloneZilla
kernel images/Clonezilla/live/vmlinuz
append initrd=images/Clonezilla/live/initrd.img boot=live config username=user quiet noswap edd=on nomodeset noeject locales=”zh_TW.UTF-8″ keyboard-layouts=”NONE” ocs_live_run=”ocs-live-general” ocs_live_extra_param=”” ocs_live_batch=no vga=788 ip=frommedia nosplash netboot=nfs nfsroot=192.168.1.6:/var/lib/tftpboot/images/Clonezilla

# cat /var/lib/tftpboot/pxelinux.cfg/tools
MENU TITLE Tools Menu

LABEL Main Menu
MENU LABEL ^Return Main Menu
KERNEL menu.c32
APPEND pxelinux.cfg/default

LABEL Memory Test
MENU LABEL ^Memory Test – memtest86+
kernel images/memtest/memtest86+-5.01

LABEL SPFDisk
MENU LABEL ^SPFDisk
MENU PASSWD SPFDisk
kernel memdisk
append initrd=images/dos/spfdisk.img

label FreeDOS 1.0 Bootdisk
MENU LABEL ^FreeDOS 1.0 bootdisk
MENU PASSWD FreeDOS
kernel memdisk
append initrd=images/dos/balder10.img

在 PXE 開機選單中加入 Clonezilla 功能

Clonezilla 是一套類似 Ghost 的備份和還原程式,是由國家高速網路中心所開發,完全免費,支援多種平台的備份及還原,如:Windows / Linux / Mac…等等,一般使用時都是放在 USB 隨身碟(硬碟) 或燒錄成光碟來使用,不過既然有 PXE,就放在 PXE Server 上,更加的方便,完全不用光碟或隨身碟,既方便又環保。
Clonezilla 官方網站: http://clonezilla.nchc.org.tw/clonezilla-live/

參考網站:
【FreeBSD】架設電腦教室大量佈署環境 – PXE + Clonezilla Live + NFS 備份/還原 @ 有為青年生活札記 :: 痞客邦 PIXNET ::
Clonezilla live

下載 Clonezilla: 版本會一直更新,視所需平台而定
# wget http://downloads.sourceforge.net/project/clonezilla/clonezilla_live_alternative_testing/20140107-trusty/clonezilla-live-20140107-trusty-amd64.zip
# wget http://downloads.sourceforge.net/project/clonezilla/clonezilla_live_alternative_testing/20140107-trusty/clonezilla-live-20140107-trusty-i386.zip
# mkdir /var/lib/tftpboot/images/Clonezilla
# unzip clonezilla-live-20140107-trusty-amd64.zip -d /var/lib/tftpboot/images/Clonezilla

[@more@]
修改 PXE 選單
# vim /var/lib/tftpboot/pxelinux.cfg/default
加入下面幾行
使用 tftp
LABEL Clonezilla Live
   MENU LABEL Clonezilla Live
   MENU PASSWD Clonezilla
   kernel images/Clonezilla/live/vmlinuz
   append initrd=images/Clonezilla/live/initrd.img boot=live config noswap nolocales edd=on nomodeset ocs_live_run=”ocs-live-general” ocs_live_extra_param=”” ocs_live_keymap=”NONE” ocs_live_batch=”no” ocs_lang=”zh_TW.UTF-8″ vga=788 nosplash fetch=tftp://192.168.1.6/images/Clonezilla/live/filesystem.squashfs

使用 nfs
LABEL Clonezilla Live
   MENU LABEL Clonezilla Live
   MENU PASSWD Clonezilla
   kernel images/Clonezilla/live/vmlinuz
   append initrd=images/Clonezilla/live/initrd.img boot=live config noswap nolocales edd=on nomodeset ocs_live_run=”ocs-live-general” ocs_live_extra_param=”” ocs_live_keymap=”NONE” ocs_live_batch=”no” ocs_lang=”zh_TW.UTF-8″ vga=788 nosplash  netboot=nfs nfsroot=192.168.1.6:/Clonezilla

PXE 功能表


開機畫面


開機完成