Running Image for Linux Without a Boot Disk

Introduction

To run Image for Linux (IFL), you would normally create a bootable CD/DVD or USB flash drive and then boot from that media. This article will describe a method for running IFL without a boot disk. Instead, IFL will run from a boot file located on your hard drive.

There is a similar article that describes how to do essentially the same thing with Image for DOS (IFD) instead of IFL. You can find that article at this link:  https://www.terabyteunlimited.com/howto/howto-ifd-bootfile.htm

Requires TBOSDT 1.47+ and bootfile.exe/bootfile64.exe 2.0.5 or later for Legacy BIOS booting. Requires TBOSDT 3.08+ and bootfile.exe/bootfile64.exe 3.00+ for UEFI booting (GPT drives). For UEFI booting, the system must support booting the generic/standard EFI System partition (no specific UEFI boot item required).

Overview

Booting from a "boot file" is made possible by the free TeraByte Unlimited BOOTFILE (bootfile.exe) utility, which is included with the TeraByte OS Deployment Tool Suite.  For MBR/EMBR drives, the TBOSDT BOOTFILE utility can be used to set up the Master Boot Record (MBR) to boot an NTFS, FAT, or FAT32 partition that is contained in a contiguous file in an NTFS, FAT, or FAT32 partition. For GPT drives, the TBOSDT BOOTFILE utility can be used to set up the drive to boot a FAT32 EFI System partition that is contained in a contiguous file in an NTFS, FAT, or FAT32 partition.

There are many different ways to configure a boot file, but in this case we will configure it to boot from Windows into IFL. Once booted into IFL, the MBR/GPT is automatically restored by the Linux version of BOOTFILE. This prepares the system to boot back into Windows again (i.e. boot normally) when finished with the IFL session. 

Getting Set Up

Note: While minimum versions for the various programs are indicated in these instructions, using the current versions of the programs is recommended.

  1. Download the IFL boot file setup archive (iflsetup.zip). This zip archive contains the files necessary to configure and boot from the IFL boot file.

  2. If not already installed, install IFL (version 2.57 or later) so that its files will be available. This can be either the stand-alone IFL zip archive extracted to a folder, or the full IFW/IFD/IFL version that includes IFL and IFD with the IFW installation. Specifically, the file iflnet.iso must be available so that it can be mounted and have files copied from it.

  3. If not already installed, download and extract the TeraByte OS Deployment Tool Suite Professional (tbosdts_pro_en_v3.zip) on the system so that its files will be available. The zip archive will contain a second zip file inside the archive that will require a password to extract. The password can be found in the readme.txt file included inside the zip file. The end result should be a folder with contents similar to the screenshot below:



  4. Extract iflsetup.zip to a folder named iflsetup (the default name) so that its contents are in a sub-folder of the TBOSDTS folder shown above. The iflsetup folder should be at the same level as the linux, win, dos_tbos, docs, and scripts folders included with TBOSDTS. The setupifl.bat batch file depends on this location so that it can find the files it needs. The TBOSDTS folder should now look like the screenshot shown below:



  5. In an Explorer window, navigate to the iflsetup folder created in Step 4. The iflsetup folder's contents should be as shown in the screenshot below:



  6. Edit the setupifl.bat batch file (right click and choose Edit) to configure it to your system and preferences. The 11 parameters to edit are at the beginning of the file and are explained in the comments. If using the registered version of IFL, the IFLUN and IFLPK parameters will need to be edited to supply your IFL User Name and Product Key. The other parameters can often be left at their default values for the typical user setup. However, be sure to check the IFLDIR parameter to ensure that it points to the correct location for the iflnet.iso file. Leave IFLDIR not set to use the default for the installed IFW/IFD/IFL package.



  7. Optional: If you would like to include one (or more) executable bash scripts on the IFL boot disk, create them as text files and put them in the ifl_scripts folder. An executable script can be used, for example, to run an IFL command line automatically upon boot. The script(s) that you place in that folder will be copied to the IFL boot file and will be available in /tbu/scripts when booted from IFL. A sample script (named script1) already exists in the ifl_scripts folder by default. This file can be opened with Notepad by double clicking it and choosing Notepad to open it.

  8. Optional: If you would like to execute one or more of the bash scripts in the ifl_scripts folder automatically on boot, edit and uncomment the RUNSCRIPTS option in the file ifl_boot.cfg. See the comments in ifl_boot.cfg file for additional details. Note that if you do not use the RUNSCRIPTS option to execute the script(s) automatically, you can still include them as described in Step 7 and just execute them manually.



  9. Optional: If desired, edit the existing copy of ifl.ini (empty by default) to add any custom IFL settings. Please refer to the IFL User Manual for complete information on settings that can be included in ifl.ini.

  10. From the iflsetup folder, execute the setupifl.bat batch file. This can be done by either double clicking the file or by opening a command prompt window in the iflsetup folder and then running the command 'setupifl'. The setupifl.bat file will create the IFL boot file as well as a batch file to boot from it.

Booting from the Boot File

After setupifl.bat completes execution, the target directory specified in setupifl.bat (C:\IFLBOOT by default) should now exist and should contain 3 files: the IFL boot file, the bootfile.exe utility (Windows version), and a batch file to initiate booting from the boot file. The name of the batch file and the boot file will be based on the value chosen for the IFLBIN parameter in the setupifl.bat file. By default, IFLBIN is set to "ifl", so the batch and boot files will be named run_ifl.bat and ifl.bin respectively, as shown in the screenshot below:



To initiate booting from the boot file, double-click the batch file. This should result in the system rebooting and then coming up to the initial IFL boot menu (as shown in the screenshot below). Use the boot menu to boot into IFL as you normally would. When the IFL boot disk gets initialized on boot, the MBR/GPT will be automatically restored by the Linux version of BOOTFILE so that on the next reboot the system will boot normally.



The IFL boot menu shown above is the same as the standard IFL boot menu when booting in UEFI mode. When booting in Legacy BIOS mode, there is an additional menu item (Boot to TBOS to restore MBR). The purpose of this item is to provide an easy method of restoring the original MBR should IFL fail to boot (hang) on a particular system. This situation should be rare, but it would leave you in a difficult predicament if it did occur, since you would not be able to get back into your normal OS after attempting to boot IFL. If this does happen, this menu item is provided so that you can choose it (type the menu item number, then press <Enter>) to restore the original MBR. The system will be back to normal on the next reboot.

Appendix 1: Description of Files Included in iflsetup.zip

ifl_boot - This file is the starting point in creating the IFL boot file. It  contains a 120 MiB FAT file system that has syslinux installed and also contains a floppy image file containing the DOS version of bootfile. When booting in Legacy BIOS mode, this file can be booted from the boot menu to restore the MBR in the event that IFL fails to boot on the system.

ifl_boot.cfg - This file can be edited to configure the SSHD server to be started on boot and also to configure one or more scripts to execute automatically.

ifl_boot.tbs - This tbscript is executed by tbosdtw.exe, which is called from setupifl.bat. It mounts and copies files to the IFL boot file. Processing .tbs files require the professional (non-trial) version of tbosdtw.exe.

ifl.ini - This file can be edited to add any custom IFL settings as documented in the IFL manual. The file is empty by default and is copied to the IFL boot file by the ifl_boot.tbs script.

setupifl.bat - This batch file is executed to create the IFL boot file as well as a batch file to boot from it. These files, along with the Windows version of bootfile.exe, are copied to a specified folder. The beginning of this file contains variables that can be configured to your preferences. These variables are documented in the file.

ifl_scripts - This folder is where one or more bash scripts can be placed so that they will be copied to the IFL boot file by ifl_boot.tbs. To have one or more of the scripts executed automatically on boot, edit and uncomment the RUNSCRIPTS option in the ifl_boot.cfg file.

readme.txt - Documentation and usage information for iflsetup.

zoneinfo.zip - A timezone reference which can be referred to when setting the TIMEZONE variable in the ifl_boot.cfg file. It is basically a zipped copy of a typical /usr/share/zoneinfo directory in a Linux distribution.

Appendix 2: Using Image for Linux to Determine Command Line Options

You can use IFL itself to determine a command line that you may want to use in a script (see steps 7 and 8).  To do this, proceed as follows:
  1. Run Image for Linux and proceed as if you were going to perform the type of backup or restore you wish to automate until you arrive at the "Backup Options" or "Restore Options" screen.

  2. On the options screen, set the options as desired for the IFL operation being configured. Note: In IFL CUI, to place a check next to an option, highlight it and press the space bar.

  3. Proceed to the "Summary" screen.

  4. On the "Summary" screen, press the F6 key (IFL CUI) or click the Show Command button (IFL GUI) to display the applicable command line options. An example of what you will see is shown in the screenshot below:



    Note: Certain options like the encryption password or unattended (/um, /uy, /un) options will not show on this screen. For full documentation on the various command line options, please refer to the IFL User Manual.