walden pond

install-party chez microtel91

Sommaire

  1. install-party chez microtel91
    1. configuration DHCP/TFTP/NFS pour installer les PC graçe au boot PXE
    2. mise à jour Mandriva
    3. mise à jour Ubuntu
    4. sauvegarde des partitions existantes.

le serveur mis en place en Mars 2010 est : Debian GNU/Linux 5.0 (x86)

configuration DHCP/TFTP/NFS pour installer les PC graçe au boot PXE

docs :

doc non utile ici (car PXE sur Debian) http://wiki.mandriva.com/en/Docs/Installing_Mandriva_Linux/PXE_Install
doc utile pour le netinst de Mandriva : http://wiki.mandriva.com/en/Development/Howto/Stage_One_Install
doc divers http://wiki.mandriva.com/fr/Installer_Mandriva_Linux

config pour TFTP:
doc Setting Up A PXE Install Server For Multiple Linux Distributions On Debian Lenny http://www.howtoforge.com/setting-up-a-pxe-install-server-for-multiple-linux-distributions-on-debian-lenny
doc Setting Up A PXE Install Server On Ubuntu 9.10 http://www.howtoforge.com/setting-up-a-pxe-install-server-on-ubuntu-9.10

config pour install de ubuntu en NFS
Installation d'ubuntu avec le LiveCD en réseau
http://dev.petitchevalroux.net/linux/installation-ubuntu-avec-livecd-reseau-linux.68.html

  • les procedures de netinst sont specifiques aux distributions

Pour mandriva:

  • Creer le repertoire de stockage:
# mkdir /media/inst
# cd /media/inst
  • Telecharger les ISO:
# wget http://www.mandrivalinux-online.org/download/file-31+dvd-free-2010-1-64-bits.php
# wget http://www.mandrivalinux-online.org/download/file-32+dvd-free-2010-1-32-bits.php
  • Vérifier avec les Md5sum
d1ff7a947cf4a0835c17574360c92168  mandriva-linux-free-2010-spring-x86_64.iso
da1f2175a2ac70459970d0debaaba5b0  mandriva-linux-free-2010-spring-i586.iso
  • on crée alors sous /media/isnt les fichiers
# mkdir /media/inst/mandriva-linux-free-2010.1-i586
# mkdir /media/inst/mandriva-linux-free-2010.1-x86_64
  • puis les liens mdv-i586 et mdv-x86_64 vers les dossiers crées :
# ls -n /media/inst/mandriva-linux-free-2010.1-i586 mdv-i586
# ls -n /media/inst/mandriva-linux-free-2010.1-x86_64 mdv-x86_64
  • monter le 1er DVD (i586) ( en loopback) et copier les donnees (ici en exemple mandriva-linux-free-2010.0-i586.iso)
# mount -o loop mandriva-linux-free-2010.0-i586.iso /mnt
# cp -a /mnt/i586/* /media/inst/mandriva-linux-free-2010.1-i586
# umount /mnt
  • monter le 2ème DVD (x86_64) ( en loopback) et copier les données
# mount -o loop mandriva-linux-free-2010.0-x86_64.iso /mnt
# cp -a /mnt/x86_64/* /media/inst/mandriva-linux-free-2010.1-x86_64
# umount /mnt
  • config NFS
# apt-get install nfs-kernel-server

contenu du fichier /etc/exports :

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
/media/inst *(ro,async,no_subtree_check)

recharger la configuration avec le commande

# exportfs -a
  • configuration du serveur DHCP
# apt-get install dhcp3-server

contenu du fichier /etc/dhcp3/dhcpd.conf :

option domain-name "microtel91.local";
option domain-name-servers 4.4.4.4;

default-lease-time 6000;
max-lease-time 72000;

authoritative;
log-facility local7;

subnet 172.16.0.0 netmask 255.255.255.0 {
  option routers 172.16.0.1;
  range 172.16.0.10 172.16.0.254;
  next-server 172.16.0.1;
  filename "pxelinux.0";
}
  • configuration de tftp
# apt-get install tftpd-hpa
  • update "netboot"
# cd /var/lib/tftpboot/

On recupere un pxelinux preconfigure (debian, ubuntu, etc...), et les kernels/initrd d'installation i386 et amd64 d'ubuntu

old
# wget http://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/netboot.tar.gz

# rm netboot.tar.gz

download du netboot i386:
# wget http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-i386/current/images/netboot/netboot.tar.gz

sauvegarder le fichier de config PXE : 
cp pxelinux.cfg/default pxelinux.cfg-default.save
pour réutilisation ultérieure


effacer l'ancien dir "ubuntu-installer"
# rm -rf ubuntu-installer
# rm version.info
# rm pxelinux.0
# rm pxelinux.cfg

(mv ubuntu-installer ubuntu-installer.old


creation du nouveau dir "ubuntu-installer"
 

# tar xvzf netboot.tar.gz
./
./ubuntu-installer/
./ubuntu-installer/i386/
./ubuntu-installer/i386/initrd.gz
./ubuntu-installer/i386/linux
./ubuntu-installer/i386/pxelinux.0
./ubuntu-installer/i386/pxelinux.cfg/
./ubuntu-installer/i386/pxelinux.cfg/default
./ubuntu-installer/i386/boot-screens/
./ubuntu-installer/i386/boot-screens/vesamenu.c32
./ubuntu-installer/i386/boot-screens/adtext.cfg
./ubuntu-installer/i386/boot-screens/menu.cfg
./ubuntu-installer/i386/boot-screens/po4a.cfg
./ubuntu-installer/i386/boot-screens/prompt.cfg
./ubuntu-installer/i386/boot-screens/stdmenu.cfg
./ubuntu-installer/i386/boot-screens/text.cfg
./ubuntu-installer/i386/boot-screens/f1.txt
./ubuntu-installer/i386/boot-screens/f10.txt
./ubuntu-installer/i386/boot-screens/f2.txt
./ubuntu-installer/i386/boot-screens/f3.txt
./ubuntu-installer/i386/boot-screens/f4.txt
./ubuntu-installer/i386/boot-screens/f5.txt
./ubuntu-installer/i386/boot-screens/f6.txt
./ubuntu-installer/i386/boot-screens/f7.txt
./ubuntu-installer/i386/boot-screens/f8.txt
./ubuntu-installer/i386/boot-screens/f9.txt
./ubuntu-installer/i386/boot-screens/splash.png
./pxelinux.cfg
./pxelinux.0
./version.info

effacer
# rm netboot.tar.gz



idem pour x86_64 :

old
# wget http://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-amd64/current/images/netboot/netboot.tar.gz

new 
# wget http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/netboot.tar.gz


# tar xvzf netboot.tar.gz 
./
./ubuntu-installer/
./ubuntu-installer/amd64/
./ubuntu-installer/amd64/initrd.gz
./ubuntu-installer/amd64/linux
./ubuntu-installer/amd64/pxelinux.0
./ubuntu-installer/amd64/pxelinux.cfg/
./ubuntu-installer/amd64/pxelinux.cfg/default
./ubuntu-installer/amd64/boot-screens/
./ubuntu-installer/amd64/boot-screens/vesamenu.c32
./ubuntu-installer/amd64/boot-screens/adtext.cfg
./ubuntu-installer/amd64/boot-screens/menu.cfg
./ubuntu-installer/amd64/boot-screens/po4a.cfg
./ubuntu-installer/amd64/boot-screens/prompt.cfg
./ubuntu-installer/amd64/boot-screens/stdmenu.cfg
./ubuntu-installer/amd64/boot-screens/text.cfg
./ubuntu-installer/amd64/boot-screens/f1.txt
./ubuntu-installer/amd64/boot-screens/f10.txt
./ubuntu-installer/amd64/boot-screens/f2.txt
./ubuntu-installer/amd64/boot-screens/f3.txt
./ubuntu-installer/amd64/boot-screens/f4.txt
./ubuntu-installer/amd64/boot-screens/f5.txt
./ubuntu-installer/amd64/boot-screens/f6.txt
./ubuntu-installer/amd64/boot-screens/f7.txt
./ubuntu-installer/amd64/boot-screens/f8.txt
./ubuntu-installer/amd64/boot-screens/f9.txt
./ubuntu-installer/amd64/boot-screens/splash.png
./pxelinux.cfg
./pxelinux.0
./version.info

attention les liens sont remplacés:

pxelinux.cfg -> ubuntu-installer/i386/pxelinux.cfg
par
pxelinux.cfg -> ubuntu-installer/amd64/pxelinux.cfg


et
pxelinux.0 -> ubuntu-installer/i386/pxelinux.0
par
pxelinux.0 -> ubuntu-installer/amd64/pxelinux.0



# rm netboot.tar.gz

Configuration de pxelinux: /var/lib/tftpboot/pxelinux.cfg/default

default vesamenu.c32
Menu Background menu_pxe.png
Menu Title Distributions


PROMPT 0
TIMEOUT 0

label kubuntu32
        menu label ^Kubuntu 10.04 32bit
        kernel kubuntu/10.04/i386/linux
        append vga=normal initrd=kubuntu/10.04/i386/initrd.gz -- quiet

label kubuntu64
        menu label ^Kubuntu 10.04 64bit
        kernel kubuntu/10.04/amd64/linux
        append vga=normal initrd=kubuntu/10.04/amd64/initrd.gz -- quiet

label ubuntu32
        menu label ^Ubuntu 10.04 32bit
        kernel kubuntu/10.04/i386/linux
        append vga=normal initrd=kubuntu/10.04/i386/initrd.gz -- quiet

label mandriva32
        menu label ^Mandriva 2010.1 32bit
        kernel mandriva/2010.0/i586/alt0/vmlinuz
        append initrd=mandriva/2010.0/i586/alt0/all.rdz automatic=method:nfs,network:dhcp,server:172.16.0.1,directory:/media/inst/mdv-i586 vga=788 splash=silent

label mandriva64
        menu label ^Mandriva 2010.1 64bit
        kernel mandriva/2010.0/x86_64/alt0/vmlinuz
        append initrd=mandriva/2010.0/x86_64/alt0/all.rdz automatic=method:nfs,network:dhcp,server:172.16.0.1,directory:/media/inst/mdv-x86_64 vga=788 splash=silent

Correspondances des chemins: alt0-32/vmlinuz -> /var/lib/tftpboot/alt0-32/vmlinuz Et ainsi de suite...

  • Si on veut un acces Internet, configurer le NAT sur le serveur d'installation
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Note: remplacer eth0 par l'interface de sortie Internet.

mise à jour Mandriva

copier iso sous /media/inst/
mkdir /mnt/nom_de_l'iso
mount -o loop /media/inst/nom_de_l'iso.iso /mnt/nom_de_l'iso
cp -a /mnt/nom_de_l'iso /media/inst/
umount /mnt/nom_de_l'iso
cd /media/inst/
rm mdv-i586 et mdv-x86_64
ln -s nom_de_l'iso mdv-i586
idem pour mdv-x86_64

car les nom mdv-i586 et mdv-x86_64 sont utilisés
dans le fichier /var/lib/tftpboot/pxelinux.cfg/default

mise à jour Ubuntu

l'installation d'unbuntu passe par FTP on configure pure-ftpd

anonymous_enable=YES

et choisir un mirroir de l'archive ubuntu : Saisie manuelle

sauvegarde des partitions existantes.

(utilisation de partimage/partimaged en réseau)

  • avant le repartitionnement du disque la sauvegarde de chaque partition est souvent nécéssaire.

Elle peut se faire avec le CD sysresccd contenant le logiciel "partimage 0.6.8 en ce 13 Mars 2010" en reseau sur un serveur (partimaged) La version sur Debian 5.0 (lenny) étant 0.6.7 nous avons du passer dans la version "testing" pour que les 2 versions soient compatible : 0.6.8

  • boot du CDROM : sysresccd
    • passer en clavier français
    • obtenir la carte LAN up + IP en DHCP : dhclient
    • lancer la couche graphique XFCE and : startx (ou laisser en mode texte)
    • lancer : partimage dans le menu ou en ligne de command: partimage -n -L -s172.16.0.1

    • partimage :
      • utiliser le "login" partimag
      • utiliser l'option de compression pour pouvoir redescendre la sauvegarde une fois la partition réduite
# /usr/sbin/partimage --version
Version de Partition Image 0.6.8 (soumis à la licence GNU GPL2).
# /usr/sbin/partimage --help
===============================================================================
Partition Image (http://www.partimage.org/) version 0.6.8 [stable]
---- distributed under the GPL 2 license (GNU General Public License) ----

Supported file systems: Ext2/3, ReiserFS, FAT16/32, HPFS, JFS, XFS,
                        UFS(beta), HFS(beta), NTFS(experimental)

usage: partimage [options] <action> <device> <image_file>
       partimage <imginfo/restmbr> <image_file>

ex: partimage -z1 -o -d save /dev/hda12 /mnt/backup/redhat-6.2.partimg.gz
ex: partimage restore /dev/hda13 /mnt/backup/suse-6.4.partimg
ex: partimage restmbr /mnt/backup/debian-potato-2.2.partimg.bz2
ex: partimage -z1 -om save /dev/hda9 /mnt/backup/win95-osr2.partimg.gz
ex: partimage imginfo /mnt/backup/debian-potato-2.2.partimg.bz2
ex: partimage -a/dev/hda6#/mnt/partimg#vfat -V1440 save /dev/hda12 /mnt/partimg/redhat-6.2.partimg.gz

Arguments:
* <action>:
  - save: save the partition datas in an image file
  - restore: restore the partition from an image file
  - restmbr: restore a MBR of the image file to an hard disk
  - imginfo: show informations about the image file
* <device>: partition to save/restore (example: /dev/hda1)
* <image_file>: file where data will be read/written. Can be very big.
                For restore, <image_file> can have the value 'stdin'. This allows
                for providing image files through a pipe.

Options:
* -z,  --compress      (image file compression level):
  -z0, --compress=0    don't compress: very fast but very big image file
  -z1, --compress=1    compress using gzip: fast and small image file (default)
  -z2, --compress=2    (compress using bzip2: very slow and very small image file):
* -c,  --nocheck       don't check the partition before saving
* -o,  --overwrite     overwrite the existing image file without confirmation
* -d,  --nodesc        don't ask any description for the image file
* -V,  --volume        (split image into multiple volumes files)
  -VX, --volume=X      create volumes with a size of X MB
* -w,  --waitvol       wait for a confirmation after each volume change
* -e,  --erase         erase empty blocks on restore with zero bytes
* -m,  --allowmnt      don't fail if the partition is mounted. Dangerous !
* -M,  --nombr         don't create a backup of the MBR (Mast Boot Record) in the image file
* -h,  --help          show help
* -v,  --version       show version
* -i,  --compilinfo    show compilation options used
* -f,  --finish        (action to do if finished successfully):
  -f0, --finish=0      wait: don't make anything
  -f1, --finish=1      halt (power off) the computer
  -f2, --finish=2      reboot (restart the computer):
  -f3, --finish=3      quit
* -b,  --batch         batch mode: the GUI won't wait for an user action
* -BX, --fully-batch=X batch mode without GUI, X is a challenge response string
* -y,  --nosync        don't synchronize the disks at the end of the operation (dangerous)
* -sX, --server=X      give partimaged server's ip address
* -pX, --port=X        give partimaged server's listening port
* -g,  --debug=X       set the debug level to X (default: 1):
* -L,  --nologin       disable login in network mode
* -n,  --nossl         disable SSL in network mode
* -S,  --simulate      simulation of restoration mode
* -aX, --automnt=X     automatic mount with X options. Read the doc for more details
* -UX  --username=X    username to authenticate to server
* -PX  --password=X    password for authentication of user to server
  • partimage-serveur
    • IP du partimage-serveur : 172.16.0.1
    • mettre un mot de passe au user : partimag
    • option "-n" pour lancer sans le support de SSL
    • fichier de configuration des utilisateurs (distant) ;
         -rw------- 1 partimag partimag   144 mai   26  2006 partimagedusers
  • (ajouter partuser ) et useradd partuser.

process server : /usr/sbin/partimaged -n -D -L -d /usr/lib/partimaged
ou
/usr/sbin/partimaged -d /var/lib/partimaged/
configuration des options dans "/etc/default/partimaged" OPTS=-n -D -L

usage: partimaged [options] [[BR]]

Options:  [[BR]]
   * -h,  --help            show help  [[BR]]
   * -v,  --version         show version  [[BR]]
   * -d,  --dest            destination directory  [[BR]] 
   * -pX, --port=X          server's port listening (defaults to 4025)  [[BR]]
   * -D,  --daemon          start in daemon mode, not foreground  [[BR]]
   * -i,  --compilinfo      show compilation options used  [[BR]] 
   * -r dir, --chroot dir   use chroot to improve security [[BR]]
   * -g, --debug=X          set the debug level to X (default: 1) [[BR]]
   * -L, --nologin          disable login from clients [[BR]]
   * -n, --nossl            disable SSL [[BR]]

un disque de 500G (ext3) est monté sur /usr/lib/partimaged

finalement partimage n'a pas fonctionné en Decembre, on a utilisé : # tar -cv --numeric-owner -f home.tar * ensuite copie du fichier sur le serveur : # scp -c blowfish -c home.tar Cette adresse e-mail est protégée contre les robots spammeurs. Vous devez activer le JavaScript pour la visualiser..0.3:/home/partimag

conf partimage(sysresccd) / partimaged(debian) à retester pour le 13 Mars 2010