Monday, September 7, 2009

Boot Acronis from PXE

I found these two articles about booting into acronis environment using PXE.

Source :

http://thesystemadministrator.com/the_system_administrator/tips_%26_tricks/pxe%2c_aka_pre-execution_environment_-_part_1/
http://thesystemadministrator.com/the_system_administrator/tips_&_tricks/pxe,_aka_pre-execution_environment_and_acronis_-_part_2/

Few days ago, I’ve received 50 new servers without any OS preinstalled. The servers came without floppy drive and CD/DVD. I tried to connect an external CD (USB) or Disk on Key, but servers didn’t start. So, I decided to run PXE Boot. If you don't know what PXE is, here’s what is written in Wikipedia:


“The Preboot Execution Environment (PXE, aka Pre-Execution Environment, or 'pixie') is an environment to boot computers using a network interface card independently of available data storage devices (like hard disks) or installed operating systems.”

There are several solutions of PXE implementation. Microsoft has its Remote Installation Service (RIS), there are sort of HP, Symantec and Acronics. Some of them are based on Linux.
I decided not to straggle with Microsoft RIS or Linux and fortunately I found a more simple solution.

So, here is an explanation of what I did:
WHAT WE NEED:
1. Additional Computer, running Windows to act as the PXE server. I have used Windows XP.
2. Syslinux-3.51.zip (or other version) from http://www.kernel.org/pub/linux/utils/boot/syslinux/ (We need only a few files).
3. DHCP and TFTP Server software for windows (I used TFTPD32. As a DHCP server you can use a MS DHCP Server from Windows 2000/2003).
4. DOS bootable floppy. I have used a boot image with NetBoot and Boot image of clean Windows 98. Both images can be downloaded here.

WORKSTEPS:
Download the software above into a temporary folder on the computer that will act as the PXE Server.
1. On the future PXE server, create a following directory structure:
C:\PXEServer
|
--- TFTPRoot
|
---Boot
|
----- pxelinux.cfg (This is a directory, not a file)

2. Download and Unpack syslinux-3.51.zip in any Temp directory. We need only 2 file from the archive. Take a pxelinux.0 and put it in the root of C:\PXEServer\TFTPRoot\Boot . Then, from the directory memdisk take 'memdisk' file and put it same place (C:\PXEServer\TFTPRoot\Boot).
Take file menu.c32 (from \syslinux-3.51\com32\modules) and put it to the C:\PXEServer\TFTPRoot\Boot.

3. Download Tftpd32 v3.03 from http://www.jounin.net/tftpd32_download.html and extract the tftpd32.exe files to C:\PXEServer.

4. Now we need a boot disk image. You can take a boot floppy and create an image, by using the WinImage. I have downloaded Universal TCP / IP Network Boot disk from http://www.netbootdisk.com/

Created diskette, and then made an IMA image in WinImage.

NOTE : Universal TCP / IP Network Boot disk uses a boot disk which created at Windows XP. It was a problem to use this diskette for PXE boot, so I took all files from created disk and placed them in the boot disk of Windows 98. If you do not have time to create an image, you can simply download it here.

5. Inside pxelinux.cfg create a text file default. Please note that the file should be NO extension. In my file you have an option to select which boot image to use, image with network Support (Universal TCP / IP Network Boot disk) or simply use a clean boot of Windows 98. Here is a content of my default file:

DEFAULT menu.c32
TIMEOUT 300
ALLOWOPTIONS 0
PROMPT 0
MENU TITLE PXE Boot System
LABEL NetworkBoot
MENU LABEL ^Network Boot
kernel memdisk
append initrd=w98se-netboot.IMA
LABEL CleanBoot
MENU LABEL ^Clean Win 98 Boot
kernel memdisk
append initrd=W98.IMA
LABEL BootNormal
MENU LABEL ^Boot Normal
LOCALBOOT 0

6. Now, let’s run tftpd32.exe. In Global Settings select TFTP Server and DHCP Server. See Figure 1 for an example of my setup. After finishing settings click OK.


Figure 1

7. On the DHCP Server tab make settings appropriate for your network. The one of the most important settings, this is' Boot file '. Set the 'Boot file' to ' /boot/pxelinux.0 '. See Figure 2 for an example of my setup. Remember to click on SAVE button.


Figure 2

8. The server setup is DONE! Now, you can turn on a new server and choose at startup PXE Boot. Further installation, is a thing of technology :).

Note: If you already have any DHCP server at your network, it will be a problem. I'd like to advise to disable another DHCP server or to configure it as written above. For example Microsoft DHCP Server Boot option file is 67 (67 Bootfile Name).


Since I've published article "PXE, aka Pre-Execution Environment - Part 1" I've got a lot of emails with the same question - 'Where is a Part 2?". So, here it is.

I know many Network Administrators who work with Acronis products and i also sometime work with those good products. This week i did a project for one of my clients in Seattle, WA. The main idea was to deploy an Acronis image on new servers and configure those servers according to system requirements. So, again, those servers came without floppy drive and CD/DVD :) and as all of you know, to restore Acronis image on a new machine we have to use Bootable Rescue Media, aka Bootable CD with Acronis on it. Yes, I know, that Acronis provides a products with PXE integrated, but i don't have it :) and I've used my own PXE server.

The first step I did was create Bootable Rescue Media. Then I took 2 files, kernel.dat and ramdisk.dat from Acronis's directory and put them into C:\PXEServer\TFTPRoot\Boot directory. Well, now was the time to make a small changes to our "default" file (default file located in C:\PXEServer\TFTPRoot\Boot\pxelinux.cfg\ directory). After all those changes my "default" file now looks as follow:

DEFAULT menu.c32

TIMEOUT 300
ALLOWOPTIONS 0
PROMPT 0

MENU TITLE PXE Boot System

LABEL ACRONIS
MENU LABEL ^Acronis Bootable
kernel kernel.dat
append initrd=ramdisk.dat vga=791 ramdisk_size=32768 acpi=off quiet noapic

LABEL NetworkBoot
MENU LABEL ^Network Boot
kernel memdisk
append initrd=w98se-netboot.IMA

LABEL CleanBoot
MENU LABEL ^Clean Win 98 Boot
kernel memdisk
append initrd=W98.IMA

LABEL MemTest
MENU LABEL ^Memory Test
kernel memdisk
append initrd=W98_MemTest.IMA
The next steps were pretty simple ;), Boot, Select Acronis from the menu, Select Image for recovery and.....

Thanks to time PXE saved me I was able to spend some time in very beautiful city Seattle.



---

3 comments:

  1. Nice work, you've explained it all very well, I found it extremely helpful...

    ReplyDelete
  2. well i want to know how we can choose acronis safe mode and other options while booting with pxe, as you show the acronis true image itself starts.

    ReplyDelete
  3. Hi Nadu,

    I notice that the acronis solution , is depend on the version of the acronis , latest version dont have that option.

    ReplyDelete

Feel free to leave your question or comment here, we will reply you as soon as possible.