Annex

Notes :

  • To suggest a new feature, please visit the Forum.
  • TIP: if you've got to duplicate an image over several computers within a LAN, you'll have to regenerate Windows' SID. To do so, use newssid.exe from SysInternals.



Special features / FAQ :

  • The PING.CONF file (read the whole paragraph before doing...)

    If you're bored with always having to re-type network and share settings...

    • You can add an answers file to the Linux image. It's path is /etc/ping.conf and it already contains all available keys, in commented lines.
    • To modify it to suit your needs :

    • 1. Boot PING on a machine that has at least 256 Mo of RAM
      2. Get a shell when proposed to, by typing 'x' and Enter
      3. Login as root, no password
      4. Connect to your network:
         - If there's a DHCP server, type: dhcpcd eth0
         - Else, type (adjust to your config):
           - ifconfig eth0 192.168.0.26 netmask 255.255.255.0 up
           - route add default gw 192.168.0.1
      5. Mount a remote share (where your initrd.gz file can be found):
         - mount.smbfs //192.168.0.1/d\$ /mnt/smbfs -o username=domain\\username
          (or just username=username if this is a local user)
      6. Assuming both your initrd.gz and ping.conf files are located
         in the root of the share, type:
         - gzip -d /mnt/smbfs/initrd.gz
         - mount -o loop /mnt/smbfs/initrd /mnt/loop
         - mkdir /tmp/rootfs
         - cd /tmp/rootfs
         - tar xvfj /mnt/loop/rootfs.tar.bz2
         - cp /mnt/smbfs/ping.conf /tmp/rootfs/etc/ping.conf
         - tar cvf - * |bzip2 -9 - >/mnt/loop/rootfs.tar.bz2
         - umount /mnt/loop
         - gzip -9 /mnt/smbfs/initrd
      
      Remember that Linux's shell is case-sensitive.

    From PING 2.00 RC8, it's possible to avoid having to modify the image to get the same result. Every key=value setting contained in the ping.conf file can be passed directly to the kernel at boot time. To do this, simply edit your isolinux.cfg file (if CD/DVD, pxelinux.cfg\DEFAULT if PXE), and modify the APPEND line accordingly.

    For example, to have PING leave you to a shell after job completion, you'd add the string After_Completion=Shell to the APPEND line. Note that the syntax key="value" is accepted, allowing space chars to be passed too.

    If the ping.conf file has been customized, you still can pass keys/values to the kernel at boot time. They'll be given priority over ping.conf's data.

    List of currently supported settings :

      
    Key names
    Possible values / Examples
    Description
    Client network configuration
    IP Ex.: 192.168.0.1
    The IP address you want the client to be assigned. Pass no IP if you've got a DHCP and want to use it.
    Netmask Ex.: 255.255.255.0
    The netmask corresponding to the IP.
    Gateway Ex.: 192.168.0.1
    The gateway corresponding to the IP.
    DHCP_Timeout Ex.: 15
    If you need to set a non-default timeout for DHCP, set it here in seconds.
    Images location section
    Server Ex.: 192.168.0.1
    The IP of the host where images made with PING are located.
    Share Ex.: MyShare
    Name of the MS Share.
    User Ex.: administrator
    User to use (can be domain\user).
    Passwd Ex.: secret
    Password to send.
    Directory Ex.: /
    If you've made a directory in your share, give it here (ex.: \\192.168.0.1\MyShare\Partimage)
    Misc
    Repart Y or N
    If Repart is set to Y, and if you've got only one partition on your local hard disk drive and want to store an image of it locally, then this unique partition will be splitted for you. If set to N, PING will simply exit. And if commented, you'll be asked for what to do. May we suggest you'd better partition yourself for this kind of situation.
    After_Completion Shell or Reboot or Shutdown
    What will PING do after the job is finished ? if Shell, you'll be dropped to a Linux shell. Useful if you want to check the /tmp/x.log log.
    Replace_BIOS Y or N
    Will we replace the BIOS if a "bios" file is found ? Note that you can simply delete this "bios" file before making your restorations to avoid having your bios params modified, but in some cases, you might want to have the bios settings recorded, and to restore them on a selection of target stations.
    CIFS_Preferred Y or N
    To map a MS share, SAMBA can use either SMBFS either CIFS. For some reasons, it has been constated that CIFS can be much faster than SMBFS on some types of networks. And the contrary is true, too!
    Zsplit_Preferred Y or N
    Set this to Y if you want zsplit, which is a dd-like utility, to be used instead of partimage. Most users should use partimage.
    No_Shell Y or N
    Set this option to Y if you don't want PING to propose the user to get a shell.
    Note that if you have also set the After_Completion key to Shell, the user will finally be given a shell. If the After_Completion key is not set at all, then the user won't be proposed to get a shell at the end of PING's job.
    AUTO Y or N
    If you want NO QUESTION to be raised, no popup at all, set this value to Y. It's equivalent to creating an empty AUTO file on the root of a PING CD/DVD (which is now deprecated, yet still supported for backwards compatibility).


  • Can I restore an image to a bigger hard disk drive ?

    • Yes. Moreover, if the file system is NTFS, PING will always try to maximize its size, so you won't end up with unallocated disk space.

  • Can I restore an image to a smaller hard disk drive ?

    • Not yet. But...
    • The problem is in the TODO list. Concretely, we plan to propose to resize parts to their minimum before storing them, then restoring partition's original sizes. Which should do the trick.

  • I've made a bootable DVD with my image and want no user interactivity at all.

    • Before creating your ISO with mkisofs, add an empty file to the directory containing your image, and call it "AUTO" (no extention). When seeing this file, PING will raise no question... unless the answer is really needed. Combine the AUTO file with a customized /etc/ping.conf.
    • You can also set the AUTO parameter, either in the /etc/ping.conf file, either by passing it to the kernel. See the params section for more details.
    • Of course, use at your own risk, as such a DVD will boot and scratch everything :)

  • What happens if I use a filesystem that is unknown to partimage ?

    • Then PING will record the partition with zsplit. It's just like dd, yet much faster. It will store your partition as bytes and not as files. Therefore, it will be much longer than what partimage would have done, and use far more space.
    • If you've got to industrialize the deployment of such partitions, consider blanking unused space (dd if=/dev/zero of=foobar ; rm foobar), and defragmenting. Then you should lose no space.

  • Can I boot on a USB flash drive ?

    • Yes. Thanks to Blas for the research & testing.
    • Mount your USB drive on Windows (say it's F: ), preferably FAT32-formated.
    • Copy the following PING files to it => kernel, initrd.gz, isolinux.cfg .
    • On F:, rename isolinux.cfg to syslinux.cfg .
    • Download SYSLINUX from http://syslinux.zytor.com/download.php
    • Extract the file syslinux.exe from the file you've downloaded to your F: drive (it should be found here in the archive: x:\syslinux-3.51\win32\syslinux.exe)
    • Open a DOS prompt, and type: f:\syslinux.exe f:

  • My image is bigger than the capacity of a DVD. Can I store it on several DVDs ?

    • Yes. This is a pretty new feature.
    • Say you've got a directory structure like this :

    • Directory of E:\Partimage\T1_Bis
      
      24/06/2007  06:38               384 bios
      24/06/2007  06:38               512 hda
      24/06/2007  06:55       660 588 216 hda1.000
      24/06/2007  06:56        32 518 458 hda1.001
      24/06/2007  06:38            10 240 hda1.first_sectors
      24/06/2007  06:56             1 024 hda2.first_sectors
      24/06/2007  06:56            10 240 hda5.first_sectors
      24/06/2007  10:43                38 hda2_0.spl.zp
      24/06/2007  09:30       660 616 876 hda5_0.spl.zp
      24/06/2007  09:38       660 615 020 hda5_1.spl.zp
      24/06/2007  09:45       660 613 560 hda5_2.spl.zp
      24/06/2007  09:53       660 618 499 hda5_3.spl.zp
      24/06/2007  10:05       310 638 295 hda5_4.spl.zp
                    13 File(s)  3 646 231 362 bytes

    • And say you'd like to store it in 6 CD-Roms.
    • Create an empty file in that directory, and call it "MULTI" (no extention).
    • Add PING files to make the future ISO bootable (initrd.gz, kernel, isolinux.cfg, and isolinux.bin).
    • You should have now :

    • Directory of E:\Partimage\T1_Bis
      
      24/06/2007  06:38               384 bios
      24/06/2007  06:38               512 hda
      12/06/2007  10:37         4 164 232 kernel
      25/06/2007  19:46                 0 MULTI
      24/06/2007  06:55       660 588 216 hda1.000
      24/06/2007  06:56           438 213 hda5.000
      24/06/2007  06:56        32 518 458 hda1.001
      15/02/2007  11:44            10 932 isolinux.bin
      22/06/2007  20:33               199 isolinux.cfg
      24/06/2007  06:38            10 240 hda1.first_sectors
      24/06/2007  06:56             1 024 hda2.first_sectors
      24/06/2007  06:56            10 240 hda5.first_sectors
      25/06/2007  14:10        22 766 432 initrd.gz
      24/06/2007  10:43                38 hda2_0.spl.zp
      24/06/2007  09:30       660 616 876 hda5_0.spl.zp
      24/06/2007  09:38       660 615 020 hda5_1.spl.zp
      24/06/2007  09:45       660 613 560 hda5_2.spl.zp
      24/06/2007  09:53       660 618 499 hda5_3.spl.zp
      24/06/2007  10:05       310 638 295 hda5_4.spl.zp
                    19 File(s)  3 673 611 370 bytes

    • First CD should contain the following files :

    • Directory of E:\Partimage\T1_Bis
      
      24/06/2007  06:38               384 bios
      24/06/2007  06:38               512 hda
      12/06/2007  10:37         4 164 232 kernel
      25/06/2007  19:46                 0 MULTI
      24/06/2007  06:55       660 588 216 hda1.000
      24/06/2007  06:56        32 518 458 hda1.001
      15/02/2007  11:44            10 932 isolinux.bin
      22/06/2007  20:33               199 isolinux.cfg
      24/06/2007  06:38            10 240 hda1.first_sectors
      24/06/2007  06:56             1 024 hda2.first_sectors
      25/06/2007  14:10        22 766 432 initrd.gz
      24/06/2007  10:43                38 hda2_0.spl.zp
                    12 File(s)    720 060 667 bytes

    • Second CD should contain the following files :

    • Directory of E:\Partimage\T1_Bis
      
      25/06/2007  19:46                 0 MULTI
      24/06/2007  06:56            10 240 hda5.first_sectors
      24/06/2007  09:30       660 616 876 hda5_0.spl.zp
                     3 File(s)    660 627 116 bytes

      (Note: you'll call mkisofs this way (no boot): mkisofs -r -o ../Image_2.iso .)

    • Third CD should contain the following files :

    • Directory of E:\Partimage\T1_Bis
      
      25/06/2007  19:46                 0 MULTI
      24/06/2007  09:38       660 615 020 hda5_1.spl.zp
                     2 File(s)    660 615 020 bytes

    • Forth CD should contain the following files :

    • Directory of E:\Partimage\T1_Bis
      
      25/06/2007  19:46                 0 MULTI
      24/06/2007  09:45       660 613 560 hda5_2.spl.zp
                     2 File(s)    660 613 560 bytes

    • Fifth CD should contain the following files :

    • Directory of E:\Partimage\T1_Bis
      
      25/06/2007  19:46                 0 MULTI
      24/06/2007  09:53       660 618 499 hda5_3.spl.zp
                     2 File(s)    660 618 499 bytes

    • Finally, sixth CD should contain the following files : (no more MULTI).

    • Directory of E:\Partimage\T1_Bis
      
      24/06/2007  10:05       310 638 295 hda5_4.spl.zp
                     1 File(s)    310 638 295 bytes

  • I've got some problems with the US keyboard...

    • To gain space, PING has been compiled with the US keyboard only. It's qwerty, and we don't plan to add other flavors.
    • It might help you to know that you can use ASCII codes. For instance, you can type a backslash (\) by holding the ALT key down and typying 92 at the same time. The ASCII code for the pipe (|) is 124.

  • How to create a custom boot image on a floppy drive for PING ? If you happen to get an error like "PXE-E32: TFTP open timeout", this may mean you need to create a custom boot disk for your NIC. Here are the steps... (Thanks Curtis & Bobmetelsky for the tip)

    • Identify the NIC type and model. Windows users, right click on my computer, manage, device manager, network adapters.
    • Go to http://rom-O-Matic.Net/5.4.3/ and download the image yournic###.zdsk that matches your NIC.
    • Download the Windows GUI of rawwrite http://www.chrysocome.net/rawwrite to write the image file into a floppy. (UNIX users will just cat the zdsk file to /dev/fd0).
    • Create the boot floppy. Rawwite wants the name of the yournic###.zdsk and an A:\. From there, rawwrite will do all the work of creatiing the boot floppy. You do NOT need to create a system disk or anyting like that.
    • Boot the PC from the A:\ and and answer (N)etwork when prompted. The PC will boot and then look for your PXE server. From there, follow the standard PING documentation.

  • The hard disk drive of my DELL series 2800 and 2850, which uses the Perc 4e/Di Controller, cannot be seen.

    • The Linux kernel uses MegaRAID drivers, and they are correct.
    • Yet, you should enter your MegaRAID BIOS Set Up Utility.
    • Enter the Adapter settings menu.
    • Under Other Adapter Options, select Emulation and set it to Mass Storage.
    • If the adapter is incorrectly set to "I2O" emulation, the system will attempt to load the i2o driver. This will fail, and prevent the proper driver from being loaded.

  • How can I put the PING ISO into my harddisk and boot from it ?

    • PING can be used so to set up some kind of utility partition.
    • There are several ways to do it, and here's one of them. I've chosen to use lilo as a boot manager (either written in the MBR, either written into a file and called from the C:\boot.ini file), and to keep unchanged the files shipped with PING releases (that is, "kernel" and "initrd.gz"). That's the reason why there's still a ramdisk in the method described below, and even the keyword "pxe" in an append line. Really, other ways are possible.
    • Also, don't forget that you can ship your computer with an image stored on a second partition, and a bootable CDRom configured to automatically restore that image.

    • First method - using lilo within the MBR :
      • Boot a PING CDRom.
      • Get a shell when proposed to (type 'x').
      • In my system, there's only one IDE disk, which name is /dev/hda. So, here's the output of the "fdisk -l /dev/hda" command :

      • Disk /dev/hda: 8589 MB, 8589934592 bytes 
        255 heads, 63 sectors/track, 1044 cylinders 
        Units = cylinders of 16065 * 512 = 8225280 bytes 
        
           Device Boot      Start         End      Blocks   Id  System 
        /dev/hda1   *           1        1044     8385898+   7  HPFS/NTFS

      • We're going to store the restoration image and PING files in a second partition. We'll use EXT3 as the filesystem, to make the partition unreadable from Windows (well, difficult to read). Note that we could store the sole kernel file in a small EXT3 partition, and the cloned images on any filesystem. Let's keep it simple - one EXT3 part.
      • In our example, a 2-GB-big partition is enough. First, let's resize our unique hda1 partition with the "ntfsresize -f -s 6000M /dev/hda1" command. Output :

      • ntfsresize v2.0.0 (libntfs 10:0:0)
        Device name        : /dev/hda1
        NTFS volume version: 3.1
        Cluster size       : 4096 bytes
        Current volume size: 8587153920 bytes (8588 MB)
        Current device size: 8587160064 bytes (8588 MB)
        New volume size    : 5999993344 bytes (6000 MB)
        Checking filesystem consistency ...
        100.00 percent completed
        Accounting clusters ...
        Space in use       : 1577 MB (18.4%)
        Collecting resizing constraints ...
        Needed relocations : 0 (0 MB)
        WARNING: Every sanity check passed and only the dangerous operations left.
        Make sure that important data has been backed up! Power outage or computer
        crash may result major data loss!
        Are you sure you want to proceed (y/[n])?

      • Now, using fdisk, we must resize hda1 to 6000M, and create a new partition. Command: "fdisk /dev/had".
      • In our case, the fdisk commands are "p d n p 1 1 +6000M t 7 a 1 n p 2 enter enter w", resulting in this "fdisk -l /dev/had" output :

      • Disk /dev/hda: 8589 MB, 8589934592 bytes
        255 heads, 63 sectors/track, 1044 cylinders
        Units = cylinders of 16065 * 512 = 8225280 bytes
        
           Device Boot      Start         End      Blocks   Id  System
        /dev/hda1   *           1         730     5863693+   7  HPFS/NTFS
        /dev/hda2             731        1044     2522205   83  Linux

      • Finally, let's format hda2: "mkfs.ext3 /dev/hda2".
      • Now, let's mount the two parts :
        • mount -t ntfs-3g /dev/hda1 /mnt/dos
        • mount /dev/hda2 /mnt/linux

      • df should output something like :

      • Filesystem           1K-blocks      Used Available Use% Mounted on
        /dev/hdc                 19582     19582         0 100% /mnt/cdrom
        /dev/hda1              5859368   1539268   4320100  27% /mnt/dos
        /dev/hda2              2482556     69304   2287144   3% /mnt/linux

      • We've got to store PING's files in our new linux partition :
        • cp /mnt/cdrom/initrd.gz /mnt/linux
        • cp /mnt/cdrom/kernel /mnt/linux

      • Let's now write a lilo.conf file for /sbin/lilo to rewrite our MBR. It must be able to boot Windows on our hda1 partition, and Linux on the second one, with a (customizable but not customized here) text menu. Command: "vi /etc/lilo.conf" (i to insert text, :wq to save and exit). My lilo.conf file :

      • boot = /dev/hda
        map = /mnt/dos/map
        prompt
        timeout = 150
        vga = normal
        lba32
        delay = 30
        read-only
        large-memory
        root = current
        
        other = /dev/hda1
        label = windows
        
        image = /mnt/linux/kernel append="pxe init=/linuxrc root=/dev/ram0 rw noapic nolapic lba devfs=nomount ramdisk_size=33000 load_ramdisk=1 prompt_ramdisk=0"
        label = restoration
        initrd = /mnt/linux/initrd.gz

      • Rewrite the MBR. Command: "lilo". It should output :

      • Added windows *
        Added restoration

      • Optionally, you can create directories on your linux partition, to replicate the contents of the Partimage.zip file. But PING will always propose you to create an image, and you can store it on the root of the partition.

      • You should now be able now to boot your system and access PING if needed. You'll do so at least once, so to write on the linux partition the image of your windows system. Afterwards, if you don't want any more users to be able to boot this linux partition and do whatever they want with it, you still can customize the append="" section of your /etc/lilo.conf file (and rewrite the mbr). The optional parameters are described in the howto's annex.

    • Second method - writing lilo to the linux partition, and having Windows's boot sector boot optionally the linux restoration partition through the edition of the C:\boot.ini file :
      • The procedure is almost similar to the first method.
      • The /etc/lilo.conf file will be slightly different :
        • First line will be: boot = /dev/hda2
        • You'll have to add a ignore-table entry.
        • >e'll remove the Windows entry, and set the delay to 0 second.
        • So, your /etc/lilo.conf file should look like this :

      • boot = /dev/hda2
        map = /mnt/dos/map
        prompt
        timeout = 150
        vga = normal
        lba32
        delay = 0
        read-only
        large-memory
        root = current
        ignore-table
        
        image = /mnt/linux/kernel append="pxe init=/linuxrc root=/dev/ram0 rw noapic nolapic lba devfs=nomount ramdisk_size=33000 load_ramdisk=1 prompt_ramdisk=0"
        label = restoration
        initrd = /mnt/linux/initrd.gz

      • When running the "lilo" command, you might get warnings, that can be safely ignored.
      • After running "lilo", we'll have to extract the boot sector that has been written into the /dev/hda2 partition, and store it as a file in our Windows partition. Command: "dd if=/dev/hda2 of=/mnt/dos/bootsect.lnx bs=512 count=1".
      • Finally, on our C:\boot.ini, we'll append a line to the [operating systems] paragraph so to call our new C:\bootsect.lnx sector : "echo "C:\\BOOTSECT.LNX="Restoration" >> /mnt/dos/boot.ini".


BACK  (Storing an image on a Bootable ISO)

Summary


Copyright © 2005 SysAngel