2006-10-03 23:25

Getting in trouble is interesting. Getting out is educational.

I reorganized the partitions in my notebook. Since it has two different Linuxes, and I didn't touch anything in one of those, I thought I was pretty safe.

Well... I wasn't, because I moved my /boot, and forgot to change my GRUB configuration, so I ended with a non-bootable box.

And not just regular non-bootable:

  • GRUB gave error 17 before the menu
  • The DVD reader is broken
  • My external USB HD is on loan on a client
  • My Sony-discman/PCMCIA-SCSI-external-CD-reader needs 110v power (and I have no transformer around)
  • My original Libretto PCMCIA FD works, at least to boot... but I have no other floppy drive to master a diskette.

Yes, I get into this kind of thing more often than most. I buy second hand hardware. I am not a first-worlder, guys.

So... what do you do in such situation? You go with PXE booting.

First I tried the only thing I knew that worked with PXE, LTSP (Linux Terminal Server Project).

So, two hours, a DHCP/TFTP/NFS config later, it's working.

It worked well enough (although it's quite a bit of work) but... I got no way to access the HD, because the only screen is a remote X display!

I am sure with a little elbow grease I could make it give me a local login with decent rescue tools, but it's not really obvious.

Then I googled for "linux PXE distribution" and found RIP. Specifically the RIP-PXE version.

It is meant for recovery, so it's not surprising that it does a better job than LTSP, which isn't.

One nice thing is that it loads its root FS into RAM from TFTP, so no need for NFSROOT (or NFS at all, really). It works with only DHCP and TFTP. Quite trivial to do... but not documented. However, starting with the LTSP docs about PXE booting, it was pretty obvious :-)

This is what you need to put in your DHCP config (in the subnet chunk):

if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
    filename "/pxelinux.0";
    filename "/kernel";

And then dump RIP-PXE into your /tftpboot (or /var/tfptboot, or whatever).

As long as you can do this with no errors, you are golden:

bash-3.1$ tftp localhost
tftp> get /pxelinux.0
tftp> get /kernel

On some tftp servers, you need to do "get /tfptroot/pxelinux.0" or similar. Adjust paths accordingly.

So, it boots. You login. You fix your menu.lst/grub.conf/fstab/whatever, and you are out.



Comments powered by Disqus

Contents © 2000-2019 Roberto Alsina