Info16.fr

Le blog de B@rtounet

#Non classé

Installation d'une distribution Ubuntu/Debian sur un laptop sans Lecteur de CDROM

26 juillet 2011 Rédigé par bartounet

J'ai un petit laptop Dell avec lequel j'ai beaucoup galéré. Mon but était d'installer une distribution Gnu/Linux sur ce portable, mais j'ai vite été confronté au fait qu'il n'avais ni lecteur CD ni possibilité de booter en usb. Heureusement il est doté d'une carte réseau supportant nativement le boot par le réseau (pxe). Le but de ce billet est de me faire un petit aide mémoire pour ce type d'installation. Pour cela il nous faut installer un serveur PXE avec tout le toutim (pxe, tftp, dhcp-server etc ...) Après avoir réfléchi un peu, je me suis rappeler qu'un outil faisait cela très bien sans avoir besoin de se prendre la tête: le fameux System Rescue CD. je m'empresse donc de télécharger la dernière version de cet outil sur le site officiel : http://www.sysresccd.org/ Pour ma part je n'ai pas gracer un CD pour cela. j'ai simplement booter le sysrescuecd a partir d'un DomU Xen. mais vous pouvez très bien le faire en gravant le CD et en bootant sur une machine physique. ou même en utilisant l'outil de virtualisation de votre choix (vmware, virtualbox, qemu et j'en passe). Une fois le system rescue on vérifie que le serveur on active la carte réseau du serveur et on lui assigne une ip ( en fixe ou en DHCP)
root@sysresccd / % ifconfig eth0
pour ma part j'avais dejà mon serveur dhcp qui tournait.
root@sysresccd / % dhclient eth0
root@sysresccd / % ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:16:3a:11:11:01 inet addr:10.0.0.54 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::216:3aff:fe11:1101/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:52799 errors:0 dropped:0 overruns:0 frame:0 TX packets:68521 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14016982 (13.3 MiB) TX bytes:99265410 (94.6 MiB) Interrupt:32 Base address:0x2000
Mon serveur à obtenu l'ip 10.0.0.54/24 On modifie maintenant les options su serveur pxe
root@sysresccd / % vi /etc/conf.d/pxebootsrv
# Copyright 2003-2007 Francois Dupoux - www.sysresccd.org # Distributed under the terms of the GNU General Public License v2 # Config file for /etc/init.d/pxebootsrv # Have a look at the PXE chapter in the official manual for more details: # http://www.sysresccd.org/Sysresccd-manual-en_PXE_network_booting # ------------------------- README ------------------------------------ # The pxebootsrv service allows to provide a PXE-boot-server for # SystemRescueCd out of the box. You just need to edit the following # options and run "/etc/init.d/pxebootsrv restart", and you can boot # any computer of your local network with PXE. # # You must configure these options if the current SystemRescueCd system # acts as DHCP-server and TFTP-server and HTTP-server. If you keep this # default behavior you just need to edit these options and start the # service with "/etc/init.d/pxebootsrv restart". # If you don't want the current system to be the DHCP server, you will have # to configure everything by hand and it will not be possible to use # the pxebootsrv service. # ------------------------ CONFIGURATION ------------------------------- # By default the current systems acts as DHCP and TFTP and HTTP server # If you want another machine of you network to act as one of those # you will have to turn the appropriate option yo "no" # Set to "yes" if you want this machine to act as a DHCP server PXEBOOTSRV_DODHCPD="yes" # Set to "yes" if you want this machine to act as a TFTP server PXEBOOTSRV_DOTFTPD="yes" # Set to "yes" if you want this machine to act as an HTTP server PXEBOOTSRV_DOHTTPD="yes" # Here is a typical PXE-Boot configuration --> update with your settings PXEBOOTSRV_SUBNET="10.0.0.0" # Used only if PXEBOOTSRV_DODHCPD="yes" PXEBOOTSRV_NETMASK="255.255.255.0" # Used only if PXEBOOTSRV_DODHCPD="yes" PXEBOOTSRV_DEFROUTE="10.0.0.253" # Used only if PXEBOOTSRV_DODHCPD="yes" PXEBOOTSRV_DNS="10.0.0.253" # Used only if PXEBOOTSRV_DODHCPD="yes" PXEBOOTSRV_DHCPRANGE="10.0.0.100 10.0.0.110" PXEBOOTSRV_LOCALIP="10.0.0.54" # Keep these values to $PXEBOOTSRV_LOCALIP if the current computer # acts as TFTP server and HTTP server as well as DHCP server PXEBOOTSRV_TFTPSERVER="$PXEBOOTSRV_LOCALIP" # IP address of the TFTP server if PXEBOOTSRV_DODHCPD="yes" PXEBOOTSRV_HTTPSERVER="http://$PXEBOOTSRV_LOCALIP/sysrcd.dat" # download URL
Comme on peut le voir, j'ai modifié le fichier pour coller avec ma config réseau. Et j'ai bien défini une plage dhcp pour mes clients pxe D'ailleurs Attention, pensez à stopper vos autres serveurs dhcp qui tourne sur votre réseau ( ou du moins sur votre vlan) sinon le client pxe risque d'obtenir un bail dhcp venant d'un autre serveur. A partir de là notre serveur PXE est prêt pour distribuer une image de SystemRescueCD aux clients PXE.
root@sysresccd / %/etc/init.d/pxebootsrv start
Vous pouvez dejà tester en lançant un client pxe il devrait booter directement sur system rescue CD. (pensez à régler le bios de votre client en conséquence). Bon c'est pas fini, ce que nous venons de faire peut être très pratique pour utiliser system rescue CD sur un pc sans lecteur CD, afin de faire de la maintenance ( partitionement, backup, deboggage etc...) Mais ce que je cherche à faire est d'installer une distribution Ubuntu sur mon laptop. pour cela il suffit simplement de modifier les fichiers du serveur TFTP de system rescue CD en les remplçant par les fichier de netboot de Ubuntu. Vous pouvez les récuperer sur le net, mais pour ma part j'avais télécharger le .iso de Ubuntu sur mon pc. J'ai donc pris les fichiers de netboot directement dessus. J'ai donc monter mon image iso pour en extraire les fichiers en questions.
opensuse:/ # mount -o loop /media/stock/xubuntu-9.04-alternate-i386.iso /mnt/
Sur le cd les fichiers en questions se trouve dans le repertoire /install/netboot
opensuse:/ # ls /mnt/install/netboot/ pxelinux.0 pxelinux.cfg ubuntu-installer version.info
Revenons sur le serveur PXE sysrescuecd Les fichiers necessaires au boot se situent dans /tftpboot J'ai donc simplement supprimer tout le contenu de /tftpboot
root@sysresccd / %rm -rf /tftpboot/*
et copié les fichier du netboot ubuntu dans ce dossier.
opensuse:/ #scp -r /mnt/install/netboot/* 10.0.0.54:/tftpboot/
et voilà
root@sysresccd /tftpboot % ls pxelinux.0 pxelinux.cfg ubuntu-installer version.info
Notre serveur pxe est prêt. il ne reste plus qu'a lancer le client lorsque vous booterez sur le serveur, une belle install d'ubuntu va apparaitre.

Information sur bartounet auteur de l'article

Les commentaires sont fermés.