-   Red Hat (
-   -   How do I pack stage2.img into initrd.img for a PXE linux rescue? (

real1elmo 09-18-2009 12:31 PM

How do I pack stage2.img into initrd.img for a PXE linux rescue?
My goal is to repack stage2.img into initrd.img and have it detected without it asking for a seperate location during pxe boot. I want this so I can run "linux rescue" without FTP, HTTP, NFS.
I know that initrd.img checks the cdrom for stage2 inside /images/

This would make a great linux password reset tool for admins to add to PXE menus hosted from a windows server.

Can anyone help me figure out the loader process and howto change the detected location of stage2.img inside initrd in pxe ram?

Please Help

aus9 09-21-2009 05:57 AM


why not get rid of windows server software ...for a start?

2) I can not tell from your post count...but have you ever re-mastered a linux cd of any kind before?

3) also how about a link to the distro you are referring to for the cd image?

real1elmo 09-21-2009 08:53 AM

Info update
More info:

1) Windows2003r2 using 3com TFTP (sorry just the way it is)
3com tftp--> pxelinux --> initrd.img (using menu of course)

2) I have made a similiar disk with KNOPPIX for Damn Small Linux using a great tutorial I found.

3) rhel-server-5.4-i386-dvd.iso ( via account only)
files I am trying to use:

The tutorial for DSL leads me to think something similiar for Red Hat is possible, I just need some real help. Or if someone has a turorial that would be awesome. I don't want to use a kickstart via fixed IP, or NFS/HTTP/FTP. (I already can do that) I just need this for a pxe "linux rescue" via only TFTP (aka 1 bigger initrd.img)

aus9 09-23-2009 08:46 AM

don't know but see if you like this link?

real1elmo 09-23-2009 11:59 AM

I will check out the link you sent
Thanks for the link.. I will try it out right now.

real1elmo 09-23-2009 02:34 PM

grml not quite what i need
any other ideas how to easily achieve a "linux rescue" via pxe

DrLove73 09-23-2009 07:54 PM

real1elmo 10-05-2009 07:36 PM

Still unsolved
This would be a great problem for a linux guru to help me solve. None of the links so far relate to packing stage1 and initrd together. I appreciate the input so for, but I still need help solving this problem.

aus9 10-05-2009 09:10 PM

gunzip -c --suffix '.img' /boot/initrd-<version>.img | cpio -i
> to unpack the file, and
> find . -print | cpio -c -o | gzip -c9 >/path/of/new/initrd

may help you unpack and repack an initrd


I have re-looked at your post. I think you already know howto unpack? if you know there is some folder called /images
or is it that pxe calls a script that looks at a folder outside the intrd called /images?

real1elmo 10-06-2009 05:53 PM

I know how to unpack
I have unpacked the initrd.img and found it contains "loader" and "init" inside the /etc folder. Inside these compiled files is the location lookup for stage2.img I cannot decompile the 2 files. Simply creating a /images folder inside the initrd.img subsystem did not work. Any clues?

aus9 10-07-2009 07:38 AM

I can offer no guarantee but a link to actual distro you are using might help others see what you mean.

leaping ahead..if no one helps....

2) alternative ?? he has a PXE distro
and docs on how to remaster

real1elmo 10-14-2009 03:31 PM

Obviously I need a Red Hat person
For the last time AUS9... I am not giving you a link to the distro. Stop asking. It is Red Hat Enterprise Linux 5.3 (or any RHEL 4+)
I do not want any advise pointing me to any other "distro." All info is in my previous posts. Aus9 please do not "help" me anymore I do not want wild goose chases just 1 RHEL solution from someone else.

aus9 10-14-2009 06:29 PM

consider reporting your first post to a moderator.

you have my permission to get entire post you start a fresh post and will appear in zero replies....and I can assure you I will not the best I can do

but the moderator is the only one who can kill this post and all thread all delete all replies ok


All times are GMT -5. The time now is 04:07 AM.