Linux Reinstallation Without Rebooting? Alternative To Kickstart And Other Such Tools?

Home » CentOS » Linux Reinstallation Without Rebooting? Alternative To Kickstart And Other Such Tools?
CentOS 6 Comments

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.

6 thoughts on - Linux Reinstallation Without Rebooting? Alternative To Kickstart And Other Such Tools?

  • 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,

  • Andrew Holway wrote on Sat, 11 Jan 2014 11:05:37 +0000:

    Well, I think he’s lacking that option (e.g. setup DHCP in the same network). What he wants to do is a VNC install. You add an option to boot a small setup kernel that exposes the installer via VNC. You connect and finish the installation that way. You can also automate this with a kickstart file and skip the VNC part, but you have to be sure that it contains no mistakes. So, for just one occasion it’s easier to just do the manual installation. Google for “CentOS VNC headless install”, there’s lots of tutorials.

    Kai

  • That’s what I was looking for, many thanks! :)
    I have a funny situation in which I need to reinstall remotely from Debian
    7 to CenOS 6.5 without kvm access and now it is possible :)

    Best regards, Rafal.

    2014/1/11 Kai Schaetzl

  • http://www.nux.ro/archive/2011/01/CentOS_install_over_VNC.html (works for EL6, too)

    Watch out for typos! You only get to do it once :)
    Mistakes that I see people do a lot are with the “root (hd0,0)” section and with the path, ie /boot/pxe-vmlinux vs /pxe-vmlinux when you have a dedicated partition for /boot. It has to be like in the running OS. Also, do not configure the network in Anaconda during the install as you’ll probably kill the connection, it will inherit the network settings from grub automatically.


    Sent from the Delta quadrant using Borg technology!

    Nux!
    http://www.nux.ro

  • and if anything goes wrong, you’ll need to get down there to the actual console to sort it out.

    I always buy my servers with remote consoles, IPMI or iLO or DRAC or whatever. Costs a bit extra, but saving a few extra DC visits in the life of the server is priceless.


    john r pierce 37N 122W
    somewhere on the middle of the left coast

  • Thanks for all the tips ;)
    I also prefer iLO-like interfaces but sometimes there is no such option, I’m glad that there are still options to perfom installation in such situations.

    Best regards, Rafal.

    2014/1/11 John R Pierce