[CentOS] Linux reinstallation without rebooting? Alternative to kickstart and other such tools?

Sat Jan 11 11:05:37 UTC 2014
Andrew Holway <andrew.holway at gmail.com>

We do unattended installations of machines using pxeboot and kickstart.

You will need another server set up on the same L2 network that will
serve DHCP and TFTP and HTTP. You can set it up similar to the
following.

# The machine boots with DHCP and, in the DHCP host config you specify
a subnet declaration and a host.

#first Install dhcp

yum install dhcp

#edit /etc/init.d/dhcpd.conf and add something similar to the
following. Note that "next-server" 192.168.0.99 is the IP address of
the dhcp server. This tells the pxe booting host which ip address to
get the "pxelinux.0" file from.

subnet 192.168.0.0 netmask 255.255.255.0 {
        option routers                  192.168.0.1;
        option subnet-mask              255.255.255.0;
        option domain-search             "vct.nsslabs.com";
        option domain-name-servers       192.168.0.1;
        next-server                     192.168.0.99;

host wibble-machine {
hardware ethernet 00:25:90:5B:16:F6;
fixed-address 192.168.0.100;
option host-name "wibble-machine";
filename "pxelinux.0";
}

#Then install tftp-server. TFTP will serve the "pxelinux.0" and other
files to start the installation.

yum install tftp-server

#The Syslinux package contains all of the stuff we need to make pxeboot work.

yum install syslinux
cp /usr/share/syslinux/pxelinux.0 /tftpboot
cp /usr/share/syslinux/menu.c32 /tftpboot
cp /usr/share/syslinux/memdisk /tftpboot
cp /usr/share/syslinux/mboot.c32 /tftpboot
cp /usr/share/syslinux/chain.c32 /tftpboot

# Make the config file.

mkdir /tftpboot/pxelinux.cfg

#Add the pxelinux config at /tftpboot/pxelinux.cfg/default.

default linux
label linux
  kernel images/centos/x86_64/6.5/vmlinuz
  append ksdevice=eth0 load_ramdisk=1
initrd=images/centos/x86_64/6.5/initrd.img network
ks=http://192.168.0.99/ks/default.ks

#You will have to work out how to find and place vmlinuz, initrd.img
yourself as I have to go out for breakfast now :)

#The important bit is the kickstart file. This file feed anaconda with
all the options it need to make an installation

#default.ks - https://gist.github.com/mooperd/5e4c199ead97a10cfcb7

As we can see from the "ks=http://192.168.0.99/ks/default.ks"
declaration in the pxelinux.cfg/default file,  On my kickstart server
here at home I have it served via http.

Here is some Centos docs but they suck.

http://wiki.centos.org/HowTos/PXE/PXE_Setup

If you have any trouble setting this up please let us know.

ta

Andrew

On 11 January 2014 09:08, Rafał Radecki <radecki.rafal at gmail.com> wrote:
> Hi All.
>
> I am curious if it is possible to reinstall linux distribution to centos
> (or another distro) if I have a remote linux server with no kvm access (i
> do not want to use virtualization). I know that for installation pxe,
> tftpboot and kickstart or a proper iso/cd and kickstart are standard
> options. But for such operations I would need kvm access. Are there any
> alternatives which do not need it? For example: I have a centos server,
> then I add some software, run it, point to a kickstart file available
> through http remotely or give network parameters and partitioning layout
> and the software takes care of the rest, no need for kvm access during
> install.
>
> Is something like that possible? :)
> I know that it may be seen as an "exotic" question but there are many
> opensource projects starting every day and maybe someone knows an
> interesting piece of software. Thanks!
>
> Best regards,
> Rafal.
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos