Set up a PXE Server Using Generic ISO
Procedure
-
Ensure that the machine where you are setting up Network boot or PXE boot is running NFS server, TFTP server and DHCP server in the same subnet as the client. Preferably, use a Linux host to set up the pxe boot.
-
Copy or mount the Linux 1-Touch Live CD ISO to the Linux host and set up NFS server to export this mount point.
-
Copy the kernel and initrd to the host TFTP server directory. The default location is /tftpboot.
-
Configure DHCP server options such that the restoring client will obtain a dynamic IP address and the PXE boot configuration files will be passed to the client.
For example: Create a DHCP configuration file (/etc/dhcpd.conf) as follows:
authoritative ddns-update-style none; allow bootp; allow booting; subnet 172.16.64.0 netmask 255.255.252.0 { option routers 172.16.64.1; option subnet-mask 255.255.252.0; option domain-name-servers 172.19.59.6; option domain-name-servers 172.19.59.7; option ip-forwarding off; default-lease-time 21600; max-lease-time 43200; host garuda5 { hardware ethernet 00:0c:29:c8:bf:11; fixed-address 172.16.65.165; next-server 172.16.66.167; filename "linux-install/pxelinux.0"; } }
The hostname of the client that needs to be assigned the IP address is garuda5
MAC address of the client that needs to be assigned IP is 00:0c:29:c8:bf:11
IP that will be assigned to the client being booted through DHCP is 172.16.65.165
IP address of the TFTP server is 172.16.65.167
The location on the TFTP server where pxelinux.0 boot loader is located: linux-install/pxelinux.0
A prefix of /tftpboot will automatically be added to the filename provided in the /etc/dhcpd.conf file. So the actual location on the TFTP server where pxelinux.0 is located is "/tftpboot/linux-install/pxelinux.0".
-
Create a configuration file to set up a TFTP server at the following location: /tftpboot/linux-install/pxelinux.cfg.
The file should have a name like 01-00-0c-29-c8-bf-11 (MAC address of the client that is being booted through TFTP) or AC1041A5 (IP address that is being assigned to client in the hex notation.) The configuration file contents can be as below:
default onetouch label onetouch kernel onetouch/vmlinuz append initrd=onetouch/initrd.img crashkernel=32M@0 ramdisk_blocksize=1024 ramdisk_size=1024M root=/dev/ram rw method=nfs:172.16.65.167:/mnt/netboot ip=dhcp
The kernel and initrd locations are relative to the location mentioned in dhcpd.conf file. For example: When you create the dhcpd.conf file as mentioned above, the kernel and initrd will be located /tftpboot/linux-install/onetouch.
-
Edit the /etc/xinetd.d/tftp configuration file as follows to enable the TFTP services.
disable=no
-
Restart the xinetd service. This can also be done by running chkconfig tftp on.
The kernel and initrd will be extracted from the 1-Touch boot CD. The network boot will access the contents of boot CD through NFS.
For example: If you have created the above configuration file @ /tftpboot/linux-install/pxelinux.cfg/01-00-0c-29-c8-bf-11, the NFS location that will be used for network boot is 172.16.65.167:/mnt/netboot.
-
Use the following commands for creating the network boot setup.
Copy the bootcd.iso to the TFTP server.
mkdir -p /mnt/cdrom mount -t iso9660 bootcd.iso /mnt/cdrom -o loop cp -f /mnt/cdrom/isolinux/initrd.img /tftpboot/linux-install/onetouch cp -f /mnt/cdrom/isolinux/vmlinuz-2.6.27.29-0.1-default /tftpboot/linux-install/onetouch/vmlinuz
The above commands will create the kernel and initrd required for Network boot.
-
Create the NFS mount point from where the CD contents can be accessed.
cp -rf /mnt/cdrom/* /mnt/netboot
Here /mnt/netboot is a NFS mount point which can be accessed by the restored system through NFS.
-
After creating the above setup, reboot the client being restored and choose to boot through network in BIOS.
Set up a PXE Server Using Single Stage ISO
Before You Begin
The utility dhclient should be installed on the backup machine before running the 1 -Touch backup.
Procedure
-
Ensure that the machine where you are setting up Network boot or PXE boot is running NFS server, TFTP server and DHCP server in the same subnet as the client. Preferably, use a Linux host to set up the pxe boot.
-
Copy or mount the Linux 1-Touch Live CD ISO to the Linux host and set up NFS server to export this mount point.
-
Configure DHCP server options such that the restoring client will obtain a dynamic IP address and the PXE boot configuration files will be passed to the client.
-
Ensure that the subnet entries are populated properly based on the network topology of the environment.
-
Since the PXE server and client node are on the same network, you can get the subnet ID by ANDing IP address and the netmask. This value will be used to instruct the DHCP server about what topology to use.
The file location is /etc/dhcp/dhcpd.conf. You can use a similar configuration for an internal subnet.
For Example: Create a DHCP configuration file as follows. In this example, XXX.16.64.0 refers to the subnet ID of the environment where nodes will be created for restore.
option space pxelinux; option pxelinux.magic code 208 = string; option pxelinux.configfile code 209 = text; option pxelinux.pathprefix code 210 = text; option pxelinux.reboottime code 211 = unsigned integer 32; option architecture-type code 93 = unsigned integer 16; ddns-update-style interim; ignore client-updates; authoritative; allow booting; allow bootp; subnet XXX.16.64.0 netmask 255.255.252.0 { range XXX.16.65.24 XXX.16.67.254; option domain-name-servers XXX.16.72.25,XXX.16.196.25; option domain-name "gp.cv.commvault.com"; option routers XXX.16.64.1; option broadcast-address XXX.16.67.255; option subnet-mask 255.255.252.0; default-lease-time 720; max-lease-time 720; host Pxeboot01 { # PXE Server next-server XXX.16.67.17; # DHCP server ip if option architecture-type = 00:07 { filename "BOOTX64.EFI"; # for UEFI client } else { filename "pxelinux.0"; # for legacy client } } }
-
-
Copy the kernel and initrd to the TFTP server directory and configure the grub files.
-
BIOS system
Example: /mnt/iso1 is the location where 1-Touch live CD is mounted. onetouch is the directory on the tftpserver directory to hold the kernel and initrd, which will be fetch from the TFTP server during boot process.
-
Run the following command to copy the kernel, initrd, and other required files for the boot.
cp -rf /mnt/iso1/isolinux * /var/lib/tftpboot/onetouch cp /mnt/iso1/EFI/BOOT/splash.xpm.gz /var/lib/tftpboot/onetouch cp /mnt/iso1/EFI/BOOT/BOOTX64.efi /var/lib/tftpboot
-
The grub configuration file should be under TFTP server directory tftpboot/pxelinux.cfg with the MAC address of the client as the file name.
Example: If the MAC address of the client is 00:50:56:93:23:6d, then the file name should be 01-00-50-56-93-23-6d or "default". The file will be at /var/lib/tftpboot/pxelinux.cfg/default or 01-MAC_ADDRESS.
Create a grub configuration file as follows:
default=0 splashimage=/onetouch/spash.xpm.gz timeout 10 title Linux 1-Touch Test LiveCD - (U)EFI based systems root (nd) kernel /onetouch/vmlinuz crashkernel=32M@0 initrd=initrd.img ramdisk_blocksize-1024 ramdisk_size=1024 root=/dev/ram rw console=tty0 ghes.disable=1 stage=1 unified=1 efigopmode=2 vga=0x317 ip=dhcp method=nfs: IP_ADDRESS_OF_NFS_SERVER:/mnt/netboot initrd /onetouch/initrd.img
-
-
UEFI system
Note
The -v2 flag should be used while creating Single Stage ISO to create_1tchbootcd.sh.
Example: /mnt/iso1 is location where live 1touch DVD is mounted and /var/lib/tftpboot/ is the TFTP server directory.
-
Run the following command to copy the kerel, initrd, and other required files from the ISO location to the the tftpserver directory.
mkdir /mnt/efiboot mount /mnt/iso1/images/efiboot.img /mnt/efiboot cp -rf /mnt/efiboot/EFI/BOOT * /var/lib/tftpboot/ cp -rf /mnt/iso1/images /var/lib/tftpboot/ umount /mnt/efiboot rmdir /mnt/efiboot
-
The grub configuration file should be under TFTP server directory tftpboot/ with the name grub.cfg-01-MAC_ADDRESS of the client or grub.cfg.
Example: If the MAC address is 00:50:56:93:23:6d, then the file name should be grub.cfg-01-00-50-56-93-23-6d.
Create a grub configuration file as follows:
set default="1" function load_video { insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod all_video } load_video set gfxpayload=keep insmod gzio insmod part_gpt insmod ext2 set timeout=30 search --no-floppy --set=root -l 'ONETOUCH' menuentry 'Commvault 1touch recovery will start in 30 seconds. Press enter to start immediately ..' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/pxeboot/vmlinuz crashkernel=32M@0 initrd=initrd.img ramdisk_blocksize=1024 ramdisk_size=1024 root=/dev/ram rw console=tty0 ghes.disable=1 stage=1 unified=1 efigopmode=2 vga=0x317 ip=dhcp method=nfs:IP_ADDRESS_OF_NFS_SERVER:/mnt/netboot initrdefi /images/pxeboot/initrd.img }
-
-
-
Configure the NFS server.
-
Create the NFS mount point from where the CD contents can be accessed.
Run the following command:
cp -rf /mnt/iso1/* /mnt/netboot
-
After creating the above setup, reboot the client being restored and choose to boot through network.