Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 15/02/2012, à 15:39

Jayce_K

P2V de serveur linux (problème avec GRUB)

Bonjour,

Je cherche à faire un P2V de mes serveurs linux. Mais je cherche a faire ce P2V à chaud sans arrêt des serveurs.

J'ai essayé la solution vmware converter avec un serveur esxi c'est pas mal mais sa plante a chaque fois.

Je me suis donc diriger vers une autre solution qui me semble plus pratique : Mondorescue, qui a l'avantage de créer un iso bootable de restauration comme ça j'ai un backup pour ma machine physique, facile a réinstaller.

Je me suis dit que je pouvais peut-être utilisé cette iso pour créer ma machine virtuel.
La restauration fonctionne plutôt bien mes donnée sont bien restaurer sur ma machine mon seul problème est le boot.
Car Ubuntu ce base sur les UUID des disques dur, hors comme la machine est réinstallé sur un hardware différent ils ne sont pas identique.

Je me permets donc de vous demandez de l'aide pour résoudre ce point gênant
Vous trouverez ci dessous le résultat du script boot info

Je me suis basé sur cette doc www.mondorescue.org/docs/p2v.pdf pour faire mon P2V sauf que je ne me sent pas le courage pas modifier les serveurs en production.

Dans la section sda1/etc/fstab vous trouverez que c'est un peu le souk, c'est du a mes tests

                  Boot Info Script 0.60    from 17 May 2011


============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for (,msdos1)/boot/grub on this drive.

sda1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 11.04
    Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:  

sda5: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:  

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disque /dev/sda: 113.8 Go, 113791795200 octets
255 têtes, 63 secteurs/piste, 13834 cylindres, total 222249600 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *             63   221,198,984   221,198,922  83 Linux
/dev/sda2         221,198,985   222,243,209     1,044,225   5 Extended
/dev/sda5         221,199,048   222,243,209     1,044,162  82 Linux swap / Solaris


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs   
/dev/sda1        1f4901c5-a972-4e41-84ac-daed90cc562f   ext4       
/dev/sda5        c28913dc-7887-4689-aeeb-0d77f2766f72   swap       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sr0         /cdrom                   iso9660    (ro,noatime)


=========================== sda1/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos1)'
search --no-floppy --fs-uuid --set=root 42b28991-c908-44ce-a9d4-6a2ebc7863f3
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos1)'
search --no-floppy --fs-uuid --set=root 42b28991-c908-44ce-a9d4-6a2ebc7863f3
set locale_dir=($root)/boot/grub/locale
set lang=fr_FR
insmod gettext
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=2
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, avec Linux 2.6.38-8-server' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set=root 42b28991-c908-44ce-a9d4-6a2ebc7863f3
    linux    /boot/vmlinuz-2.6.38-8-server root=UUID=42b28991-c908-44ce-a9d4-6a2ebc7863f3 ro   quiet
    initrd    /boot/initrd.img-2.6.38-8-server
}
menuentry 'Ubuntu, avec Linux 2.6.38-8-server (mode de dépannage)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set=root 42b28991-c908-44ce-a9d4-6a2ebc7863f3
    echo    'Loading Linux 2.6.38-8-server ...'
    linux    /boot/vmlinuz-2.6.38-8-server root=UUID=42b28991-c908-44ce-a9d4-6a2ebc7863f3 ro single 
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.38-8-server
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set=root 42b28991-c908-44ce-a9d4-6a2ebc7863f3
    linux16    /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set=root 42b28991-c908-44ce-a9d4-6a2ebc7863f3
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda1/etc/fstab: ================================

--------------------------------------------------------------------------------
#                                             
#               /                  was        on /dev/sda1 during installation 
#               /etc/fstab:        static     file system information. 
#               <file              system>    <mount point> <type> <options> <dump> <pass> 
#               Use                'blkid     -o value -s UUID' to print the universally unique identifier 
#               devices            that       works even if disks are added and removed. See fstab(5). 
#               swap               was        on /dev/sda5 during installation 
#/               #                             
#UUID=42b28991-c908-44ce-a9d4-6a2ebc7863f3 #                             
#UUID=d963cb0c-85a5-4fbf-b9d0-50f678886424 #                             
#ext4            errors=remount-ro  0          1 
#proc            /proc              proc       nodev,noexec,nosuid 0 0 
#swap            #                             
#swap            sw                 0          0 

/dev/sda1    /        ext4    rw,user,noauto,exec,utf8 0 0
/dev/sda5    swap        swap    0 0
proc        /proc        proc    nodev,noexec,nosuid 0 0
--------------------------------------------------------------------------------

=================== sda1: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

  62.138358593 = 66.720554496   boot/grub/core.img                             1
  62.133300304 = 66.715123200   boot/grub/grub.cfg                             1
   0.153129101 = 0.164421120    boot/initrd.img-2.6.38-8-server                1
  62.131915569 = 66.713636352   boot/vmlinuz-2.6.38-8-server                   1
   0.153129101 = 0.164421120    initrd.img                                     1
  62.131915569 = 66.713636352   vmlinuz                                        1

=============================== StdErr Messages: ===============================

unlzma: Decoder error

Merci de votre aide.

Dernière modification par Jayce_K (Le 15/02/2012, à 16:07)

Hors ligne

#2 Le 15/02/2012, à 17:44

Gounick

Re : P2V de serveur linux (problème avec GRUB)

Salut,
Pour l'instant, je te propose de regarder ces liens et de les adapter à ta situation :
Méthodes de P2V à chaud ou à froid
Comment restaurer Grub
Utilisation de Grub
Utilisation de Grub2
UUID/Label

Dernière modification par Gounick (Le 15/02/2012, à 17:46)

Hors ligne