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"; } else{ 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 tftp>
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.
Beautiful!
Yeah! That is the beauty of Open source!.
It is a lot of adrenaline.
But. all that emotions are killing me.
;)
Hi Roberto,
You can get a local shell with LTSP. In the server, in /opt/ltsp-4.2/i386/etc/lts.conf (or wherever your lts.conf file is), you can put something like:
SCREEN_02 = shell
Or just replace the "startx" in SCREEN_01 with "shell". That will do the trick.
Anyway, it's not a pretty complete environment, so you're right about not being a proper rescue system. But it's useful to debug broken thin clients.
Regards,