Install CentOS via network without CD-ROM and without USB
There is an extremely old machine in our lab and today I want to use it as a node in our Hadoop cluster. There was a Fedora 8 on it. But I’d like to change it to a new CentOS 5.7. The problem I met, was that our machine was too old, and that neither the CD-ROM nor the USB ports work well.
Seems troublesome. But I still find a way to install my new CentOS on this machine, without CD-ROM, without USB and without any external device. It’s net-installation! You might argue that even net-installation need an CD or USB disk too, which contains the net-install ISO image, to boot up our machine. But we can take the GRUB on our old operating system in use, to boot the net-install kernel. Here’s how.
First, we download the net-install image in the old OS, and check its MD5 hash:
wget http://mirrors.163.com/centos/5.7/isos/i386/CentOS-5.7-i386-netinstall.iso http://mirrors.163.com/centos/5.7/isos/i386/md5sum.txt diff <(grep "netinstall" md5sum.txt) <(md5sum CentOS-5.7-i386-netinstall.iso) && echo OK
Then we extract the only directory in the ISO file, isolinux, to the /boot directory. We put isolinux in the /boot directory just for convenience. Because after we boot into the GRUB command line, here is the default root of GRUB.
mkdir tmp mount -o loop CentOS-5.7-i386-netinstall.iso tmp/ cp -Rv tmp/isolinux/ /boot/
After that, we reboot and press c on the GRUB menu to enter the GRUB Command Line Interface. Type the below commands to boot the kernel in the isolinux directory.
kernel /isolinux/vmlinuz initrd /isolinux/initrd.img boot
If you put the isolinux in other partitions, you may need to specify the root path of GRUB using the root command.
The system will boot up correctly just like we insert the net-install disk into the CD-ROM. On the Installation Method screen, we choose HTTP or FTP and then configure the network. Next, we choose an exist mirror site or our own server (will be faster) which host CentOS files, and the remain steps are very familiar to us.
© 2011, Yuliang Jin. All rights reserved.
This post is under a Creative Commons Attribution-ShareAlike 3.0 Unported License.