Preface
Loving the linux system and it is not comfortable to use Vista , as a programmer, I wan to install Red Hat Linux EL5 on my laptop X61 7675KC1.
There is no CDROM or FloppyDriver in X61. I need to install system booting from usb or network. Try to boot from usb, but the result is depression. Maybe my usb stick is not suitable to make it as a bootable stick.
So, what can I do is to get to know how to install a system booting from network. Now, I want to share my experience.
Introduction
DHCP could dynamically dispatch a IP for the client. Here client is my laptop X61.
TFTP could support the file transfer. Here, for transfering boot files and iso files.
NFS could affording the file to read. Here, there are iso files.
Kickstart could launch the installation as a automated one. Here, I have not use it and only show how to use it.
Precondition
one compuer installed with linux system you are familiar with.
one laptop installed with vista system or any other system you dislike.
Let’ go
1. set dhcp on server
set the server’s ip to 192.168.0.1
edit the file /etc/dhcp.conf as this one:
option domain-name "mydomain";
ddns-update-style none;
max-lease-time 7200;
server-name "bootserver";
default-lease-time 600;
allow booting;
allow bootp;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.1 192.168.0.254;
deny unknown-clients;
}
group pxe {
filename "pxelinux.0";
host testserver { hardware ethernet 00: 0C :29:70:24:5B; fixed-address
192.168.0.2; }
}
#becareful: the filename is pxelinux.0, not pxelinux.o, suffix is zero.
Type the command as following to retart the dhcp service:
# service dhcpd restart
2. set TFTP on server
edit the file /etc/xinetd.d/tftp as this one:
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
}
Copy the install iso into server using commands:
#mkdir /mnt/iso
#mount -o loop=loop0,ro RHEL5- i386-AS-disc1.iso /mnt/iso
#cp /mnt/iso/isolinux/initrd.img /tftpboot
#cp /mnt/iso/isolinux/vmlinuz /tftpboot
Copy the bootup file “pxelinux .0” :
#cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
And write a configure file named with “default” for the pxelinux.0 :
DEFAULT rhel4u2-i386
DISPLAY pxelinux.cfg/list
PROMPT 1
LABEL linux
KERNEL vmlinuz
APPEND initrd=initrd.img ramdisk_size=9216
This file must named as “default” and put it under the directory: /tftpboot/pxelinux.cfg/
Then, under this /tftpboot/pxelinux.cfg directory, we need to write a file named with “list”, the content is at your will, my /tftpboot/pxelinux.cfg/list is like this:
Congratulations! Jonsen!
The system specificated as following will be installed on your laptop.
Name Version
linux RHEL5
type the command as following to restart the tftp service:
# service xinetd restart
Test your configuration: #tftp localhost
Is every thing goes well? OK, let’s go on.
3. set NFS on server
Copy the install iso files into server:
#mkdir /instsvr/LinuxEL5 -p
#mv RHEL5-i386-AS-disc1.iso /instsvr/LinuxEL5
#mv RHEL5-i386-AS-disc2.iso /instsvr/LinuxEL5
#mv RHEL5-i386-AS-disc3.iso /instsrv/LinuxEL5
#mv RHEL5-i386-AS-disc4.iso /instsrv/LinuxEL5
#mv RHEL5-i386-AS-disc5.iso /instsrv/LinuxEL5
Edit the file /etc/exports as this one:
/instsvr * (ro)
Type the command as following to restart the NFS:
# service nfs restart
Test your nfs configuration:
# showmount –e localhost
Can you see:
Export list for localhost:
/instsvr *
Now, write a file /instsvr/ks/ks.cfg as this one:
install
nfs --server=192.168.0.1 --dir=/instsvr/LinuxEL5
Inorder to let the kickstart find out the configuration file, we need to reedit the file “default” mentioned above:
LABEL linux
KERNEL vmlinuz
APPEND ks=nfs:192.168.0.1:/instsvr/ks/ks.cfg initrd=initrd.img ramdisk_size=8192
Congratulations!
Just reboot your client now, of course, before you do this, you need to set the LAN well and let the client could access the server.