Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We normally provision servers using kickstart scripts (served by Cobbler) when installing the operating system.

But we are to be given a new server from an ISP that already has the operating system installed, and possibly with no remote console access.

Is there a way to reboot a linux server (same OS that we normally use) and force it to re-install using a kickstart script?

share|improve this question

You can try using a snake server.

Once configured, both the server and the client machine, it will provide a curses interface to select a kickstart file amongst other options.

share|improve this answer
... so this is like a Linux version of the Depenguinator? :-) – voretaq7 May 31 '13 at 16:16
This works but is unloved, the documentation is poor and wrong. – Iain Sep 11 '14 at 8:48

If you have a separate physical partition to copy your installation media to, you could do that and modify Grub to Kickstart on boot.

install harddrive --partition=sdb2 --dir=/path/to/installation-media

Add to /etc/grub.conf:

title Reinstall CentOS 6
    kernel /vmlinuz-kickstart ks=kickstart.cfg
    initrd /initrd-kickstart.img

You'll need to modify the values above (where appropriate) for your environment. The Kernel and intial ramdisk can be copied from the installation media (usually in the ./isolinux directory.) Note: I appended -kickstart to the filenames so that they stand out in a directory listing.

Last, set the default Grub entry to this one and reboot. (Count the instances of title, starting from 0.)

I can't stress enough that you should test this locally in a VirtualBox VM or the like before trying it on a colocated system.

For more information:
Kickstart Options
Starting a Kickstart Installation

share|improve this answer
I should also say that if you have another server, you could use one of the other installation methods. (NFS, HTTP, FTP, etc.) – Aaron Copley May 30 '13 at 17:19
Alas, I've not gotten this to work. I suspect it's due to the limited access that the ISP gives to the console. I've ended up manually setting things up to bootstrap Puppet. :( – Rob Jun 3 '13 at 10:45
Sorry, to hear. I do this at least twice a day without any console access. The only time I ever need console is when I have a brand new system with nothing on it. If Grub works, this should. Might just take some more work to break it down for your use, but glad you got another solution. – Aaron Copley Jun 3 '13 at 18:34

You can do the installation yourself if the provider gives you remote access to the server's out-of-band management hardware (e.g. IPMI, iLO, DRAC). If you don't get such access, or if the server doesn't even have such hardware, you should probably not do business with them and find another provider.

share|improve this answer

There's no way I know of to do a kickstart on an already-installed server (though I'm not a CentOS/Redhat guy so it's entirely possible I know not what I speak about).

Michael Hampton's solution works if you have remote KVM (with remote media, and decent bandwidth), but in your situation I'd suggest looking into deployment / configuration management via Puppet, Chef, or one of the many other tools out there.
Configuration/Deployment Management tools will let you ensure that all your servers match a standard configuration independent of their starting state (so if your ISP hands you a system that's basically unusable you can get it up and running quickly), and you get the benefit of ongoing management for installing updates and the like.

It's a bit more of a long-terms solution and there's definitely a learning curve involved, but it's probably worth it if you're going to be managing a bunch of machines going forward.

share|improve this answer
We use Puppet, but I was hoping to get the server properly configured with the right version of Puppet etc. by Cobbler beforehand. Otherwise there is still a lot of manual work to do. – Rob May 31 '13 at 15:48
@Rob If you fully leverage puppet you should be able to provision from a generic box (like what your ISP gives you) in two steps -- install puppet ; pull strings -- the work required to get to that "fully leveraged" position is pretty substantial though. Dawud's answer using snake might be a better option if time is a factor. – voretaq7 May 31 '13 at 16:15
Setting up Puppet requires manual work of installing correct repos with correct settings, setting up SSH keys, copying Puppet manifests, etc. – Rob Jun 2 '13 at 18:59

I was recently asked to look at doing just this and as part of searching for a solution I found this Q&A.

As Michael says out-of-band is preferred but it's not always available.

I looked at snake server that Dawud suggests. It works but is unloved and there are errors in it's documentation. I wouldn't recommend using it.

I asked on IRC #centos and they pointed me at install from grub. This is similar to Aaron's solution but it uses network resources rather than a separate partition. This is what I ended up implementing. The gist is

  • Download the installation vmlinuz and initrd.img to /boot
    • wget -N
    • wget -N
  • Edit /boot/grub/grub.conf and create an entry for the new kernel

    • title Reinstall CentOS kernel /vmlinuz ro upgradeany ip= netmask= hostname=somehost.tld ks=http://server.tld/ks/kickstart.ks gateway= dns= headless vnc vncpassword=SomePassword initrd /initrd.img
  • On the server.tld you'll need to have httpd serving a suitably configured kickstart file the important thing here is the url directive

  • url --url

This causes the installation files to be copied from the remote system named.

This obviously only works if you can install your own kernel so for example it wouldn't work with a Digital Ocean droplet.

You can easily misconfigure something whilst developing the solution so I wouldn't recommend doing this on a system that doesn't have some method of reinstalling the service providers image easily.

Since getting this working I've not encountered any issues.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.