Skip to main content

Ralsina.Me — Roberto Alsina's website

Getting in trouble is interesting. Getting out is educational.

I re­or­ga­nized the par­ti­tions in my note­book. Since it has two dif­fer­ent Lin­ux­es, and I did­n't touch any­thing in one of those, I thought I was pret­ty safe.

Well... I was­n't, be­cause I moved my /boot, and for­got to change my GRUB con­fig­u­ra­tion, so I end­ed with a non-­bootable box.

And not just reg­u­lar non-­bootable:

  • GRUB gave er­ror 17 be­­fore the menu

  • The DVD read­­er is bro­ken

  • My ex­ter­­nal USB HD is on loan on a client

  • My Sony-dis­­c­­man/PCM­­CI­A-SC­SI-ex­ter­­nal-CD-read­­er needs 110v pow­er (and I have no tran­s­­former around)

  • My orig­i­­nal Li­bret­­to PCM­­CIA FD work­s, at least to boot... but I have no oth­­er flop­py drive to mas­ter a diskette.

Yes, I get in­to this kind of thing more of­ten than most. I buy sec­ond hand hard­ware. I am not a first-­worlder, guys.

So... what do you do in such sit­u­a­tion? You go with PXE boot­ing.

First I tried the on­ly thing I knew that worked with PX­E, LT­SP (Lin­ux Ter­mi­nal Serv­er Pro­jec­t).

So, two hours, a DHCP/TFT­P/N­FS con­fig lat­er, it's work­ing.

It worked well enough (although it's quite a bit of work) but... I got no way to ac­cess the HD, be­cause the on­ly screen is a re­mote X dis­play!

I am sure with a lit­tle el­bow grease I could make it give me a lo­cal lo­gin with de­cent res­cue tool­s, but it's not re­al­ly ob­vi­ous.

Then I googled for "lin­ux PXE dis­tri­bu­tion" and found RIP. Specif­i­cal­ly the RIP-PXE ver­sion.

It is meant for re­cov­ery, so it's not sur­pris­ing that it does a bet­ter job than LT­SP, which is­n't.

One nice thing is that it loads its root FS in­to RAM from TFT­P, so no need for NF­S­ROOT (or NFS at al­l, re­al­ly). It works with on­ly DHCP and TFT­P. Quite triv­ial to do... but not doc­u­ment­ed. How­ev­er, start­ing with the LT­SP docs about PXE boot­ing, it was pret­ty ob­vi­ous :-)

This is what you need to put in your DHCP con­fig (in the sub­net chunk):

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

And then dump RIP-PXE in­to your /tftp­boot (or /var/tf­pt­boot, or what­ev­er).

As long as you can do this with no er­rors, you are gold­en:

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

On some tftp server­s, you need to do "get /tf­p­t­root/px­elin­ux.0" or sim­i­lar. Ad­just paths ac­cord­ing­ly.

So, it boot­s. You lo­gin. You fix your menu.l­st/­grub.­con­f/f­stab/what­ev­er, and you are out.

Beau­ti­ful!

martinponce / 2006-10-04 04:06:

Yeah! That is the beauty of Open source!.
It is a lot of adrenaline.
But. all that emotions are killing me.
;)

Dario / 2006-10-04 23:28:

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,


Contents © 2000-2024 Roberto Alsina