LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-12-2011, 10:37 PM   #1
oliaseleven
LQ Newbie
 
Registered: Aug 2010
Location: connecticut, usa
Distribution: ubuntu server 10 (JeOS) x64, fedora 13 i686, tinygentoo
Posts: 12

Rep: Reputation: 0
How do I get gPXE or PXElinux to boot from the cd drive?


I have successfully set up a tftp/dhcp server from which to deliver gPXE or PXElinux, so my machine can boot from iSCSI (there is no hard drive). Using either one (I prefer gPXE to keep thing simple), when iSCSI boot fails (e.g. the iscsi target is empty), the iSCSI target is successfully retained as a device in BIOS, and the BIOS is supposed to move to the next boot device, in this case the DVD drive. However it does not. So in order to be able to install Windows to the iSCSI drive I need to either get gPXE or PXElinux to instruct it to boot from the first optical drive after sanboot fails, or set up a PXE image server to load the Windows DVD from, which I don't really have time to do.

I've scoured the web for instructions on how to get either of these to do a local optical drive boot, but all I can find is codes to boot from hard drives or floppies. Any help?

p.s. My apologies in advance if this isn't in the right forum. I figured networking would hit the most people experienced with PXE and gPXE...

p.p.s. Here are my files so you know what I'm doing:

dhcpd.conf
Code:
allow booting;
authoritative;

option space gpxe;
option gpxe-encap-opts code 175 = encapsulate gpxe;
option gpxe.keep-san code 8 = unsigned integer 8;
option gpxe.bus-id code 177 = string;

subnet 192.168.5.0 netmask 255.255.255.0 {
}

host htpc {
 hardware ethernet (mac address);
 fixed-address 192.168.5.100;
 if exists user-class and option user-class = "gPXE" {
      filename="/gpxe/gpxescript.gpxe";
 }
 else 
      filename="/gpxe/e1000_82541.kpxe";
}
gpxescript.gpxe
Code:
#!gpxe
dhcp net0
set keep-san 1
sanboot iscsi:192.168.5.200::::tftpboot.iscsi.htpc:cdrive
chain tftp://192.168.5.1/pxelinux/pxelinux.0
pxelinux.cfg/default
Code:
label loader
kernel memdisk
append initrd=sbootmgr.dsk

label iscsi
sanboot iscsi:192.168.5.1::::tftpboot.iscsi.htpc:cdrive
append keep-san 1
Note: Yes, I know I can do a UI based menu for this, I'll set that up once I have everything working. I added the loader label because I read that it would execute a boot loader that I could use to select the DVD drive, but it doesn't work yet. The way it's set up, PXElinux fails when I execute "loader". It says kernel memdisk not found even though memdisk.bin is in the same directory, and when i change it to
Code:
kernel memdisk.bin
it just hangs. The files are from SYSlinux 4.0.3 and am using gPXE 1.0.1. I'm sure I've missed something fundamental, this is my first time using PXElinux. Or network booting at all really.

Last edited by oliaseleven; 01-12-2011 at 11:09 PM.
 
Old 01-13-2011, 03:27 AM   #2
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
You can try to force it to boot local from the device configured in the BIOS:
Code:
LABEL localboot
    LOCALBOOT 0
in your PXE configuration.

In your setup you missed to specify .bin for the kernel I think.
 
Old 01-13-2011, 06:17 AM   #3
GeneC
LQ Newbie
 
Registered: Aug 2010
Distribution: Kubuntu Lucid; Debian Lenny
Posts: 6

Rep: Reputation: 2
Quote:
Originally Posted by oliaseleven View Post

pxelinux.cfg/default
Code:
label iscsi
sanboot iscsi:192.168.5.1::::tftpboot.iscsi.htpc:cdrive
append keep-san 1
This should be:
Code:
LABEL iscsi
COM32 sanboot
APPEND iscsi:192.168.5.1::::tftpboot.iscsi.htpc:cdrive keep-san 1
You'll want Syslinux 4.04-pre1 or newer (-pre4 is current testing release) as there's a bug that affects this in 4.xx.

Alternatively, you can use the generic KERNEL directive instead of COM32. Please consult doc/syslinux.txt for more information.
 
1 members found this post helpful.
Old 01-13-2011, 06:27 AM   #4
GeneC
LQ Newbie
 
Registered: Aug 2010
Distribution: Kubuntu Lucid; Debian Lenny
Posts: 6

Rep: Reputation: 2
Sorry, didn't see the other mistake at the same time

Quote:
Originally Posted by oliaseleven View Post
pxelinux.cfg/default
Code:
label loader
kernel memdisk
append initrd=sbootmgr.dsk
The way it's set up, PXElinux fails when I execute "loader". It says kernel memdisk not found even though memdisk.bin is in the same directory, and when i change it to
Code:
kernel memdisk.bin
it just hangs.
KERNEL is the auto-magic boot loader directive. It guesses what to use based on "file extension". ".bin" means a boot strap program (like a typical boot sector) but MEMDISK needs to be loaded like a Linux kernel. Try the "LINUX memdisk.bin" or rename "memdisk.bin" to "memdisk". Filenames in the config files should match the real files.
 
Old 01-13-2011, 06:47 AM   #5
GeneC
LQ Newbie
 
Registered: Aug 2010
Distribution: Kubuntu Lucid; Debian Lenny
Posts: 6

Rep: Reputation: 2
Quote:
Originally Posted by oliaseleven View Post
I have successfully set up a tftp/dhcp server from which to deliver gPXE or PXElinux, so my machine can boot from iSCSI (there is no hard drive). Using either one (I prefer gPXE to keep thing simple), when iSCSI boot fails (e.g. the iscsi target is empty), the iSCSI target is successfully retained as a device in BIOS, and the BIOS is supposed to move to the next boot device, in this case the DVD drive. However it does not. So in order to be able to install Windows to the iSCSI drive I need to either get gPXE or PXElinux to instruct it to boot from the first optical drive after sanboot fails, or set up a PXE image server to load the Windows DVD from, which I don't really have time to do.
If it's blank (binary 0's), all it'll do is execute the instruction "add [bx+si],al" (if I have the info correctly). In order to do anything useful, it needs to execute something like "INT 18h" or "INT 19h". Some BIOSs are nice and analyze the boot sector to determine if it's a blank before executing it. I believe gPXE just boots it.

Quote:
Originally Posted by oliaseleven View Post
I've scoured the web for instructions on how to get either of these to do a local optical drive boot, but all I can find is codes to boot from hard drives or floppies. Any help?
This is probably because booting an optical drive normally requires the BIOS to configure the El Torito boot. I'm very uncertain you'll ever find the answer you seek.
 
Old 01-13-2011, 08:45 AM   #6
oliaseleven
LQ Newbie
 
Registered: Aug 2010
Location: connecticut, usa
Distribution: ubuntu server 10 (JeOS) x64, fedora 13 i686, tinygentoo
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for all your responses! I'll try your suggestions tonight or tomorrow. As for the NIC, it's a single port PCI Intel E1000, not Lan on Motherboard. The mainboard I'm using is an old junk P4 workstation with a VIA chipset. I could try looking for an update for the BIOS, but the manufacturer hasn't even been releasing proper Win XP drivers, so I'm not expecting much help there. It was manufactured in 2001 or 2002 I believe.

About the El Torito booting, according to wikipedia (yeah, maybe a bad source, don't have time to dig) this should be possible using SYS- or ISO-linux. http://en.wikipedia.org/wiki/El_Tori...rd)#Boot_modes unless I'm misinterpreting that.


As far as never getting it to boot from CDROM (if the loadboot 0 doesn't work), is there perhaps a way I could load GRUB via PXE? I've found some notes on making a PXE image for it, but wasn't sure if it was for a local GRUB installation that allows you to boot PXE, or a PXE GRUB image that allows you to boot locally. The notes I found are here: http://grub.enbug.org/PXEBOOT

Thanks again everyone!

Last edited by oliaseleven; 01-13-2011 at 08:46 AM.
 
Old 01-13-2011, 03:36 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Just a note. Once gpxe loads bios has no choice anymore would be my thinking.

"and the BIOS is supposed to move to the next boot device"
 
Old 01-13-2011, 07:52 PM   #8
oliaseleven
LQ Newbie
 
Registered: Aug 2010
Location: connecticut, usa
Distribution: ubuntu server 10 (JeOS) x64, fedora 13 i686, tinygentoo
Posts: 12

Original Poster
Rep: Reputation: 0
I am basically trying to replicate this, except with Windows 7.
http://www.etherboot.org/wiki/sanboo..._iscsi_install

I got everything to work now except that the iSCSI drive doesn't appear in the list of drives for Win 7 installation. Trying some different things, will post solution or best progress when it's working or I'm out of ideas.

So far I:
-am now using SYSlinux 4.04-pre4.
-was using the wrong memdisk file in PXElinux. The correct file is located in ((SYSlinux folder)/memdisk and has no file extension. The "loader" label now works to boot from an optical drive after the sanboot is attempted.
-will post the final versions of the relevant conf files when I have a working solution.

Last edited by oliaseleven; 01-13-2011 at 07:56 PM.
 
Old 01-13-2011, 08:13 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Did you burn gpxe to your rom? http://www.etherboot.org/wiki/romburning

Is this what you want to do? http://etherboot.org/wiki/sanboot/win7
 
Old 01-13-2011, 10:42 PM   #10
oliaseleven
LQ Newbie
 
Registered: Aug 2010
Location: connecticut, usa
Distribution: ubuntu server 10 (JeOS) x64, fedora 13 i686, tinygentoo
Posts: 12

Original Poster
Rep: Reputation: 0
Hello jefro,

I did not burn the ROM.

In case you or anyone else wants a summary, I am using the tftp/dhcp method where the original ROM attempts to PXE boot and is served a gPXE ROM instead of a PXE image. The gPXE ROM then loads and attempts to boot from the iSCSI target, and if it fails it chainloads PXElinux instead. This allows me to use sbootmgr.dsk to boot from the local optical drive, when I can then (theoretically) boot up an OS disk such as Win 7 and install to the iSCSI target which is still in BIOS (due to invoking the keep-san 1 option). Under normal circumstances, as I've read, chainloading PXElinux is unnecessary as BIOS is supposed automatically switch to the second boot device (the optical drive) in the event that the sanboot attempt fails. But this board's BIOS is poorly written, so it does not. Hence the need to do use the sbootmgr.dsk technique.

As for your second question, yes, that is my aim. I am using the method listed under the Win2k8 guide, towards the bottom of the page under Alternative Method (simple) header. I have gotten to the Win 7 install screen, but the installer will not recognize the iSCSI drive. I tried plugging in a hard drive as it suggests, but this does not make the iSCSI drive appear. However, when I click on a partition in the local drive the installer gives the error:
"Windows cannot be installed to this disk. The computer's hardware may not support booting to this disk. Ensure that the disks' controller is enabled in the computer's BIOS menu."
Because the guide I linked predicts this problem and I have not had this problem before when installing this OS to the same local drive in the same machine in absence of the gpxe/pxelinux/sanboot steps, this leads me to believe that the iSCSI target has been successfully added to the BIOS, I just need to find setting that will allow Win 7 to recognize it as a valid install drive.

If all else fails I will probably just install it to a local drive and manually convert the drive to an iSCSI target using this method: http://www.etherboot.org/wiki/sanboot/transfer

Last edited by oliaseleven; 01-13-2011 at 10:50 PM.
 
Old 01-14-2011, 06:53 AM   #11
GeneC
LQ Newbie
 
Registered: Aug 2010
Distribution: Kubuntu Lucid; Debian Lenny
Posts: 6

Rep: Reputation: 2
Quote:
Originally Posted by jefro View Post
Just a note. Once gpxe loads bios has no choice anymore would be my thinking.

"and the BIOS is supposed to move to the next boot device"
If and only if gPXE still has control and can return control to the BIOS. To my knowledge, SANBOOT almost prevents this from happening. The only way to tell gPXE to return to the BIOS is a PXENV+ call. Effectively, this means no. I have written programs to find the PXENV+ header but I don't believe they were small.
 
Old 01-14-2011, 07:15 AM   #12
GeneC
LQ Newbie
 
Registered: Aug 2010
Distribution: Kubuntu Lucid; Debian Lenny
Posts: 6

Rep: Reputation: 2
Quote:
Originally Posted by oliaseleven View Post
Quote:
Originally Posted by oliaseleven View Post
As for your second question, yes, that is my aim. I am using the method listed under the Win2k8 guide, towards the bottom of the page under Alternative Method (simple) header.
It looks like that section of that EtherBoot Wiki page should be updated with some corrected info and links to the official sources. If the author of that section is makes it such that you fetch the PXELINUX binary yourself, MEMDISK should come from the same source.

Quote:
I have gotten to the Win 7 install screen, but the installer will not recognize the iSCSI drive.
While you're in PXELINUX, you can use HDT (com32/hdt/hdt.c32) to list the BIOS drives. This may give some hints but not certain. It's possible that the Win7 installer took control of the NIC but didn't try to preserve the iSCSI BIOS attachment.

Quote:
I tried plugging in a hard drive as it suggests, but this does not make the iSCSI drive appear. However, when I click on a partition in the local drive the installer gives the error:
"Windows cannot be installed to this disk. The computer's hardware may not support booting to this disk. Ensure that the disks' controller is enabled in the computer's BIOS menu."
Probably recognized as BIOS disk 0x81 not 0x80.

Quote:
If all else fails I will probably just install it to a local drive and manually convert the drive to an iSCSI target using this method: http://www.etherboot.org/wiki/sanboot/transfer
Probably the most reliable.

Last edited by GeneC; 01-14-2011 at 07:17 AM. Reason: shortening.
 
1 members found this post helpful.
Old 01-14-2011, 03:11 PM   #13
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
OK, once you pxe a gpxe image over it can't return to bios. If you had burned the gpxe rom to the nic or had a supported gpxe nic then it could then return. (pretty sure on this, bios is a one time shot here)

What you may be able to do is create a timeout to then let either gpxe or more likely grub then boot to the local cd.

Think you should boot to a gpxe disk, floppy, cd or usb on the client system and then work on the iscsi issue.

Then come back to the pxe to load gpxe. Might be a way to grub choice the gpxe then disk,

http://www.etherboot.org/wiki/pxechaining

Last edited by jefro; 01-14-2011 at 03:14 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with porting code from fcoe to gpxe vinvishwa Linux - Networking 1 02-10-2010 03:42 PM
Knoppix gPXE nfs mount jefro Linux - Newbie 1 11-28-2009 04:48 PM
How to boot system with pxelinux.0? Dims Linux - Newbie 3 06-04-2009 11:58 AM
Eee Pc, gPXE boot (with Attansic L1 gigabit ethernet adapter) ernst Linux - Laptop and Netbook 1 05-10-2009 11:21 PM
Pxelinux to network boot, /proc/cmdline truncated early jeriryan Linux - Networking 0 07-16-2008 12:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration