Menu

NTLDRNotFound

Juan Jose Pablos

Last modified 5 years ago Last modified on 03/01/10 02:23:41

Update: August 11th, 2007

There are four much better solutions for the problem. Unattended seems to be outdated, the recent CVS source doesn't compile without altering the Makefile.

It is now very possible to get the current (September 16th, 2007) CVS source to compile, which has linux kernel 2.6.22.6 so great hardware support, including SATA. Here's a (very) brief guide : [CompileCVS]

The problem

On recent systems, many of you may have experienced the infamous

NTLDR Not Found

error message after the first or second reboot. Users of Unattended 4.6 might not experience this problem, but users of the CVS version will under certain circumstances. For recent systems, the old Unattended is no choice because the used kernel misses support for several hardware items. Thus, the above error message is a problem for many of us. It only occurs on the Linux boot disk, the DOS boot disks seems to be problemless.

The solution

After poking around for a while, we seem to have at least found a workaround for this. The culprit lies in parted, which is responsible for partitioning and writing the MBR of the fat32 partition which will later on be converted to NTFS. The partition table gets created wrong, thus the Windows can't find its own boot loader, resulting in the above error message. Using parted up to version 1.6.22 cures the problem, as it relies on the old way of getting a disk's geometry, but starting with 1.6.23, it switched to a new function that causes the problem. I don't know for how long the deprecated old way will be supported in Linux kernels, but for now it works.

The main workaround is to use parted 1.6.22. Get Unattended from CVS and just modify your linuxboot/Makefile to read

parted=parted-1.6.22

and go on with compiling, that should fix the problems.

We will soon provide a ready-to-use makefile, a short documentation on this and a ready-to-use linuxboot ISO for your convenience. The parted mailing list has already been informed about this problem, and we hope to have a solution for newer parted versions soon.

Compiling Unattended from CVS

  • cd unattended/linuxboot
  • copy Makefile in there (available for download on this site)
  • make download (in case of error, retry, can take some while until you got everything)
  • sed -i "s/2.6.15.6/2.6.16.20/g" misc/nail-floppy.txt

replace "2.6.16.20" with the version of the kernel you are really using in Makefile

  • make tftpboot (users wanting to have the ISO instead of the TFTP boot have to enter make iso here and copy the ISO instead of the TFTP boot files later on)
  • when the Kernel configuration runs, press Enter for using default values
  • extract SYSLINUX (no compilation necessary) and copy pxelinux.0 to tftpboot/
  • modify tftpboot/pxelinux.cfg/default to match your z_path, z_user and z_pass
  • wget http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.817-MSWin32-x86-257965.msi -O install/packages/ActivePerl-5.8.8.817-MSWin32-x86-257965.msi
  • mkdir install/os/xp_sp2
  • copy your Windows XP CD's i386 folder and your own OEM drivers to install/os/xp_sp2
  • to create an Unattended archive, just run tar cvfz unattended.tar.gz unattended/install unattended/linuxboot/tftpboot

Other variants for fixing the NTLDR Not Found error

  • Changing the BIOS notation to LBA or combined seems to work on some systems, but not on all.
  • Adding z:\tools\sys a: c: to doit.bat, right before the Windows setup is invoked, might work as well. (Thanks to Huberstuff for that!)
  • Switching from IDE emulation mode to "real" SATA mode in the BIOS seems to help as well.
  • After formating with parted mkpartfs, format again as usual with

format_cmd="format /y /z:seriously /q /u /a /v: c:"

  • Using the two patches supplied below and compiling parted 1.7.1 into the image. (yet untested)
  • Try the new Gentoo-based boot image: ​http://unattended.technikz.de/index.php/Main_Page
  • Sometimes, putting BIOS into "Fail Safe Mode" helps, even if there are no visible SATA/IDE settings in the BIOS itself

Sidenote: ThinkPad? issues

  • As suggested by Chris Needham, change linuxboot/misc/master for fixing DHCP issues

    146c146

    < if [ $SECONDS -ge $(($start + 60)) ] ; then


        if [ $SECONDS -ge $(($start + 10)) ] ; then
    
  • A fix suggested by Tobias Richter for the NTLDR Not Found message

    --- master.org 2006-06-10 12:45:21.828736942 +0200

    +++ master 2006-06-10 12:47:04.144845228 +0200

    @@ -399,9 +399,15 @@

    cp /etc/dosemu/dosemu.conf /tmp

    echo \$_hdimage = \"/dev/dsk$active_part\" >> /tmp/dosemu.conf

    +[ -f /z/site/preinst.sh ] \

    • && . /z/site/preinst.sh

    +

    # DOSEMU always exits non-zero. FIXME.

    dosemu.bin -f /tmp/dosemu.conf

    +[ -f /z/site/postinst.sh ] \

    • && . /z/site/postinst.sh

    +

    sync

    reboot

    And then create a postinst.sh script inside the site folder:

    ----postinst.sh----

    FOR "NORMAL" USE if you have 255 HEADs but you don't have to use this because

    the linuxbootdisk

    is working for "NORMAL" PCs

    echo -e -n "\xff" |dd of=/dev/sda1 bs=1 seek=26 conv=notrunc

    mkdir -p /mnt/drive

    mount -t msdos /dev/dsk1 /mnt/drive

    echo -e -n "\xff" |dd of=/mnt/drive/\$win_nt\$.~bt/bootsect.dat bs=1 seek=26

    conv=notrunc

    FOR IBM R52 AND R51

    echo -e -n "\xf0" |dd of=/dev/sda1 bs=1 seek=26 conv=notrunc

    mkdir -p /mnt/drive

    mount -t msdos /dev/dsk1 /mnt/drive

    echo -e -n "\xf0" |dd of=/mnt/drive/\$win_nt\$.~bt/bootsect.dat bs=1 seek=26

    conv=notrunc

    sleep 30


  • Another idea from Falko Trojahn

    If I correctly remember there's a way to use unattended.txt files

    according to the mac address as (mac-address-here).txt. Perhaps this

    could be a way here, too, if somebody knows if there is (or we can get

    somewhere from) an environment variable with the mac address to use it

    during postinst.sh.

    Or put in /etc/master something like

    val=$(get_cmdline_param z_special)
    
    [ -n "$val" ] && Z_SPECIAL=${val#*=}
    

    (around line 180 there same is done for Z_PATH etc.).

    Then, in postinst.sh you can have:

    if [ -n $Z_SPECIAL ] ; then

    # FOR IBM ...

    else

    # FOR NORMAL PC ...

    fi

    So, if you specify e.g. "z_special=1" on the linuxboot command line,

    your script gets executed.

Downloads

When using precompiled ISOs, remember du update the linuxaux directory.


Related

Wiki: AdvancedTopics