I have a remote CentOS 4 machine on a network where I can't put a DHCP or PXE server, and I want to do a complete reinstall. So what I want to do is, from the currently-running system, to invoke an installation kernel and initrd in just the same way that GRUB would, giving it a boot command line that specifies a remote kickstart file, installation tree, and other required info. It looks like kexec is the right tool to do this, but I have only been able to find it for CentOS 5. Does anyone know where I could get kexec for CentOS 4? Does the CentOS 4 kernel support it? If not, are there any other ways to achieve what I've described? Thanks Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org
On 03/02/2010 05:10 AM, Tony Mountifield wrote:> I have a remote CentOS 4 machine on a network where I can't put a DHCP > or PXE server, and I want to do a complete reinstall. So what I want to > do is, from the currently-running system, to invoke an installation > kernel and initrd in just the same way that GRUB would, giving it a boot > command line that specifies a remote kickstart file, installation tree, > and other required info.> If not, are there any other ways to achieve what I've described?I would use cobbler and koan for this. Once you have a cobbler server setup for the kickstart (which is super easy to do), you can use koan with the --replace-self and -k options and do exactly what you want. Tom
On 03/02/2010 10:10 AM, Tony Mountifield wrote:> I have a remote CentOS 4 machine on a network where I can't put a DHCP > or PXE server, and I want to do a complete reinstall. So what I want to...> If not, are there any other ways to achieve what I've described?Try this ( or a process like this ) : http://www.karan.org/blog/index.php/2005/06/15/ Make sure you test the line you end up using ( like in a local VM ) before you do this on the live machine. The process works, I've used it many times in the past ( and about a dozen times in just the last 10 days ). - KB
On Tue, 2 Mar 2010 at 10:10am, Tony Mountifield wrote> I have a remote CentOS 4 machine on a network where I can't put a DHCP > or PXE server, and I want to do a complete reinstall. So what I want to > do is, from the currently-running system, to invoke an installation > kernel and initrd in just the same way that GRUB would, giving it a boot > command line that specifies a remote kickstart file, installation tree, > and other required info.This is simple. Grab the vmlinuz and initrd.img files from the pxeboot directory of the repo you want to install from. Put those in /boot on the server in question. From there, there are a couple of ways you can go. The easiest is to actually put the ks.cfg on the server itself. Then you can add a stanza like the following (you'll need to tailor all the hard drive references to your own setup, of course) to your grub.conf: title reinstall root (hd0,0) kernel /boot/vmlinuz ks=hd:sda1:/ks.cfg ksdevice=eth0 initrd /boot/initrd.img Make that entry the default, reboot, and your kickstart will start. Obviously all of your network info needs to be specified in the ks.cfg file. If you want to grab the ks.cfg from a remote server, that can be done too, but you'll need to specify the network config options on the "kernel" line above. I don't have the exact syntax handy, but it's all documented. Install the "anaconda" package and look in /usr/share/doc/anaconda-$VERSION/command-line.txt and you can see all the options you can pass to the install kernel. On CentOS-5 installs I always use "noipv6", since it seems to make things go much faster. For a one-off like this, installing cobbler is a bit (read: a lot) of overkill. -- Joshua Baker-LePain QB3 Shared Cluster Sysadmin UCSF