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.

#26 Le 02/02/2011, à 22:53

Compte anonymisé

Re : Restauration Grub (RESOLU)

Salut

En fait c'est le dernier montage "foireux" :  sudo mount --bind /proc /vdisk  qui a mis le souk.

Tu peux essayer de le démonter :
sudo  umount  /proc
puis
sudo  umount   /dev

et refaire un
sudo  ls -l  /vdisk

Dernière modification par Compte anonymisé (Le 02/02/2011, à 22:54)

#27 Le 02/02/2011, à 23:18

Baptiste22000

Re : Restauration Grub (RESOLU)

Je viens de rebooter et de tout recommencer, et je replante au moment de chrooter :

ubuntu@ubuntu:~$ sudo mkdir /win
ubuntu@ubuntu:~$ sudo mount /dev/sda5 /win
ubuntu@ubuntu:~$ sudo mkdir /vdisk
ubuntu@ubuntu:~$ sudo mount -o loop /win/ubuntu/disks/root.disk /vdisk
ubuntu@ubuntu:~$ sudo mount --bind /dev /vdisk/dev
ubuntu@ubuntu:~$ sudo mount --bind /proc /vdisk/proc
ubuntu@ubuntu:~$ sudo chroot /vdisk
chroot: ne peut exécuter la commande «/bin/bash»: Erreur de format pour exec()
ubuntu@ubuntu:~$

Hors ligne

#28 Le 02/02/2011, à 23:24

Compte anonymisé

Re : Restauration Grub (RESOLU)

Peux-tu lister le contenu de /vdisk :
ls -l  /vdisk
et de boot :
ls -l  /vdisk/boot

La version du  système qui est sur ton disque est bien la même que celle du LiveCD et de même type : 32 bits ou 64 ?

Dernière modification par Compte anonymisé (Le 02/02/2011, à 23:24)

#29 Le 02/02/2011, à 23:27

Baptiste22000

Re : Restauration Grub (RESOLU)

Oui, je te confirme que c'est la même version.
Tu veux que je te liste le contenu de /vdisk avant le montage (et dans ce cas je démonte avec les commandes que tu m'as indiqué auparavant) ou là, avec le problème ?

Hors ligne

#30 Le 02/02/2011, à 23:31

Compte anonymisé

Re : Restauration Grub (RESOLU)

Non tu ne démontes rien car là çe doit être ok

#31 Le 02/02/2011, à 23:33

Baptiste22000

Re : Restauration Grub (RESOLU)

Voici

ubuntu@ubuntu:~$ ls -l /vdisk
total 116
drwxr-xr-x   2 root root  4096 2011-01-29 17:07 bin
drwxr-xr-x   3 root root  4096 2011-01-29 17:09 boot
drwxr-xr-x   2 root root  4096 2010-12-01 11:26 cdrom
drwxr-xr-x  19 root root  3880 2011-02-02 21:58 dev
drwxr-xr-x 139 root root 12288 2011-01-30 23:15 etc
drwxr-xr-x   3 root root  4096 2010-12-01 11:26 home
drwxr-xr-x   2 root root  4096 2010-12-01 11:23 host
lrwxrwxrwx   1 root root    33 2011-01-29 17:08 initrd.img -> boot/initrd.img-2.6.32-28-generic
lrwxrwxrwx   1 root root    33 2011-01-12 13:32 initrd.img.old -> boot/initrd.img-2.6.32-27-generic
drwxr-xr-x  17 root root 12288 2011-01-29 17:07 lib
drwxr-xr-x   7 root root 12288 2011-01-12 15:39 lib32
lrwxrwxrwx   1 root root     4 2010-12-01 11:23 lib64 -> /lib
drwx------   2 root root 16384 2010-12-01 11:23 lost+found
drwxr-xr-x   4 root root  4096 2011-01-30 22:24 media
drwxr-xr-x   2 root root  4096 2010-04-23 10:23 mnt
drwxr-xr-x   2 root root  4096 2010-08-16 09:53 opt
dr-xr-xr-x 186 root root     0 2011-02-02 21:57 proc
drwx------  10 root root  4096 2011-01-30 23:06 root
drwxr-xr-x   2 root root  4096 2011-01-29 17:07 sbin
drwxr-xr-x   2 root root  4096 2009-12-05 22:25 selinux
drwxr-xr-x   2 root root  4096 2010-08-16 09:53 srv
drwxr-xr-x   2 root root  4096 2010-03-30 14:30 sys
drwxrwxrwt  14 root root  4096 2011-01-30 23:14 tmp
drwxr-xr-x  11 root root  4096 2010-12-01 11:23 usr
drwxr-xr-x  15 root root  4096 2010-08-16 10:08 var
lrwxrwxrwx   1 root root    30 2011-01-29 17:08 vmlinuz -> boot/vmlinuz-2.6.32-28-generic
lrwxrwxrwx   1 root root    30 2011-01-12 13:32 vmlinuz.old -> boot/vmlinuz-2.6.32-27-generic


ubuntu@ubuntu:~$ ls -l /vdisk/boot
total 61208
-rw-r--r-- 1 root root  645813 2010-09-16 18:24 abi-2.6.32-24-generic
-rw-r--r-- 1 root root  646144 2010-11-24 10:58 abi-2.6.32-26-generic
-rw-r--r-- 1 root root  646144 2010-12-02 04:42 abi-2.6.32-27-generic
-rw-r--r-- 1 root root  646144 2011-01-11 00:27 abi-2.6.32-28-generic
-rw-r--r-- 1 root root  110458 2010-09-16 18:24 config-2.6.32-24-generic
-rw-r--r-- 1 root root  110601 2010-11-24 10:58 config-2.6.32-26-generic
-rw-r--r-- 1 root root  110601 2010-12-02 04:42 config-2.6.32-27-generic
-rw-r--r-- 1 root root  110590 2011-01-11 00:27 config-2.6.32-28-generic
drwxr-xr-x 2 root root    4096 2011-01-30 23:06 grub
-rw-r--r-- 1 root root 8609335 2010-12-04 12:15 initrd.img-2.6.32-24-generic
-rw-r--r-- 1 root root 8663255 2010-12-04 12:17 initrd.img-2.6.32-26-generic
-rw-r--r-- 1 root root 8664258 2011-01-12 15:40 initrd.img-2.6.32-27-generic
-rw-r--r-- 1 root root 8665393 2011-01-29 17:09 initrd.img-2.6.32-28-generic
-rw-r--r-- 1 root root  160280 2010-03-23 09:40 memtest86+.bin
-rw-r--r-- 1 root root 2154635 2010-09-16 18:24 System.map-2.6.32-24-generic
-rw-r--r-- 1 root root 2156100 2010-11-24 10:58 System.map-2.6.32-26-generic
-rw-r--r-- 1 root root 2156429 2010-12-02 04:42 System.map-2.6.32-27-generic
-rw-r--r-- 1 root root 2157108 2011-01-11 00:27 System.map-2.6.32-28-generic
-rw-r--r-- 1 root root    1336 2010-09-16 18:28 vmcoreinfo-2.6.32-24-generic
-rw-r--r-- 1 root root    1336 2010-11-24 11:00 vmcoreinfo-2.6.32-26-generic
-rw-r--r-- 1 root root    1336 2010-12-02 04:48 vmcoreinfo-2.6.32-27-generic
-rw-r--r-- 1 root root    1336 2011-01-11 00:28 vmcoreinfo-2.6.32-28-generic
-rw-r--r-- 1 root root 4050848 2010-09-16 18:24 vmlinuz-2.6.32-24-generic
-rw-r--r-- 1 root root 4050080 2010-11-24 10:58 vmlinuz-2.6.32-26-generic
-rw-r--r-- 1 root root 4049888 2010-12-02 04:42 vmlinuz-2.6.32-27-generic
-rw-r--r-- 1 root root 4052512 2011-01-11 00:27 vmlinuz-2.6.32-28-generic

Hors ligne

#32 Le 02/02/2011, à 23:37

Compte anonymisé

Re : Restauration Grub (RESOLU)

Peux-tu lister le contenu du fichier :
gedit   /vdisk/boot/grub/grub.cfg    (entre balises Code de préférence  c'est le symbole <> juste en dessus de la fenêtre de saisie et tu colles le texte entre ces balises. merci)

#33 Le 02/02/2011, à 23:40

Baptiste22000

Re : Restauration Grub (RESOLU)

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/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
  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
}
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=10
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 ###
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (loader) (on /dev/sda1)" {
    insmod ntfs
    set root='(hd0,1)'
    search --no-floppy --fs-uuid --set ae900b04900ad32f
    chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sda2)" {
    insmod ntfs
    set root='(hd0,2)'
    search --no-floppy --fs-uuid --set 7aa0d822a0d7e2a5
    chainloader +1
}
### 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 ###

Hors ligne

#34 Le 02/02/2011, à 23:54

Compte anonymisé

Re : Restauration Grub (RESOLU)

En effet ton joliciel de paramétrage a fait des dégâts.

Tu vas éditer ce fichier et lui ajouter un kernel ubuntu pour pouvoir booter et après il faudra revoir en détail.

1) tu te donnes les autorisations de modifier ce fichier :

sudo  chmod a+w  /vdisk/boot/grub/grub.cfg

2) tu l'édites :
sudo  gedit  /vdisk/boot/grub/grub.cfg

3) tu vas ajouter le paragraphe suivant entre les lignes :
### BEGIN /etc/grub.d/10_linux ###
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.32-28-generic sur /dev/sda5" {
    insmod ntfs
    set root=(hd0,5)
    loopback  loop0  /ubuntu/disks/root.disk
    set root=(loop0)
    linux  /boot/vmlinuz-2.6.32-28-generic  root=/dev/sda5  loop=/ubuntu/disks/root.disk   ro   quiet splash
    initrd  /boot/initrd.img-2.6.32-28-generic
}

menuentry "Ubuntu, Linux 2.6.32-28-generic sur /dev/sda1" {
    insmod ntfs
    set root=(hd0,5)
    loopback  loop0  /ubuntu/disks/root.disk
    set root=(loop0)
    linux  /boot/vmlinuz-2.6.32-28-generic  root=/dev/sda1  loop=/ubuntu/disks/root.disk   ro   quiet splash
    initrd  /boot/initrd.img-2.6.32-28-generic
}
### BEGIN /etc/grub.d/10_linux ###

N'étant pas un spécialiste de wubi je préfère mettre les 2 choix, ne sachant pas trop s'il utilise /dev/sda1 ou /dev/sda5.

et tu essayes ensuite de rebooter normallement.

@+

Dernière modification par Compte anonymisé (Le 02/02/2011, à 23:55)

#35 Le 03/02/2011, à 00:06

Baptiste22000

Re : Restauration Grub (RESOLU)

Et bien mon ami peut-être que tu n'es pas trop 1 spécialiste de wubi, mais en tout cas, grâce à toi, je te répond actuellement de ma session. Donc oui, c'est bon, problème résolu. C'était pas bien compliqué en fait (1 fois qu'on sait où chercher wink). Je te remercie grandement et encore 1 fois, merci beaucoup pour tes précieux conseils. Grâce à toi, j'en sais 1 peu plus sur Linux/Ubuntu wink

Bonne soirée à toi big_smile

Hors ligne

#36 Le 03/02/2011, à 00:08

Baptiste22000

Re : Restauration Grub (RESOLU)

Et même si j'ai eu 1 interlocuteur privilégié, merci à vous aussi qui avez apporté votre aide et vos conseils. Bonne soirée à vous aussi wink

Hors ligne

#37 Le 03/02/2011, à 00:11

Compte anonymisé

Re : Restauration Grub (RESOLU)

Bon tu peux passer ton problème en résolu. Simplement quelle entrée à fonctionné ? /dev/sda5 ou /dev/sda1 ?

Ensuite, ce n'est pas normal d'avoir perdu ces lignes alors que les kernels sont présents dans le répertoire boot.

Il faut vérifier pourquoi le système ne les reconnait pas automatiquement.

Certainement un "coup bas" de ton logiciel   "Grub-customizer" logiciel à éviter peut être ?

En tous cas tu peux commencer par taper un :
sudo  update-grub

puis aller vérifier le contenu de ton fichier /boot/grub/grub.cfg  pour savoir si les kernels sont là maintenant.

@+

#38 Le 03/02/2011, à 00:56

Baptiste22000

Re : Restauration Grub (RESOLU)

C'est le /dev/sda5 qui a fonctionné.
Pour le contenu de mon Grub, j'obtiens ça avec ta commande :

Generating grub.cfg ...
Found Windows Vista (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
done

Donc, lui, il me signale pas Ubuntu... Bizarre...

Hors ligne

#39 Le 03/02/2011, à 07:55

Compte anonymisé

Re : Restauration Grub (RESOLU)

Salut

C'est bien ce que je pensais, ton logiciel "miracle" a du faire des dégats.

Si tu as rebooté -->  trop tard tu vas être obligé de recommencer comme hier (il suffit d'ajouter le paragraphe /dev/sda5), sinon modifies directement le fichier grub.cfg.

Ensuite il faut à mon avis supprimer de toute urgence ce "grub-custobordelmizer" mad
Et re paramétrer GRUB.
Il faudrait regarder dans le répertoire /etc/grub.d :
sudo  ls  -l  /etc/grub.d/*
et lister le fichier grub:
cat  /etc/default/grub

Je te conseille aussi en attendant de sauver le grub.cfg qui fonctionne :
sudo  cp   /boot/grub/grub.cfg  /boot/grub/grub.cfg.sov

Au cas où il sera plus simple de recopier ce fichier en grub.cfg plutôt que d'éditer et modifier le fichier.

@+

Dernière modification par Compte anonymisé (Le 03/02/2011, à 08:08)

#40 Le 03/02/2011, à 11:10

Baptiste22000

Re : Restauration Grub (RESOLU)

Salut.

Bon, en redémarrant ce matin, le problème s'est représenté. Il me semble que t'avais vu le coup venir wink
Bon, j'ai refait toutes les manip' et comme tu m'as demandé, voici les 2 commandes que tu m'as demandé d'effectuer :

ubuntu@ubuntu:~$ sudo ls -l /etc/grub.d/*
-rwxr-xr-x 1 root root 4444 2010-04-13 13:59 /etc/grub.d/00_header
-rwxr-xr-x 1 root root 1416 2010-04-13 13:40 /etc/grub.d/05_debian_theme
-rwxr-xr-x 1 root root 4594 2010-04-13 13:59 /etc/grub.d/10_linux
-rwxr-xr-x 1 root root  918 2010-03-23 09:37 /etc/grub.d/20_memtest86+
-rwxr-xr-x 1 root root 6605 2010-04-13 13:59 /etc/grub.d/30_os-prober
-rwxr-xr-x 1 root root  214 2010-04-13 13:59 /etc/grub.d/40_custom
-rw-r--r-- 1 root root  483 2010-04-13 13:59 /etc/grub.d/README


ubuntu@ubuntu:~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_LINUX_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Hors ligne

#41 Le 03/02/2011, à 12:28

Compte anonymisé

Re : Restauration Grub (RESOLU)

Salut

La meilleure solution serait peut être de réinstaller grub avec toutefois le risque qu'avec wubi tu ailles écraser le MBR ce qui bloquerai le boot de ton micro.
Donc il faudrait commencer par sauver le MBR par la commande :
sudo  dd  if=/dev/sda  of=/Sov_Mbr  bs=512  count=1
puis tu copies ce fichier sur une clé au cas où.

Ensuite tu tapes les commandes suivantes :
sudo  apt-get  purge   grub2  grub-pc
devrait supprimer la config actuelle
puis
sudo  apt-get  install  grub-pc 

devrait réinstaller grub-pc.
C'est là qu'il y a un risque d'écrasement du MBR mais si tu as sauvé le MBR comme indiqué ci-dessus pas de problèmes.

Sinon il faudrait revoir ton produit d'optimisation qui a du modifier les scripts de bas de grub.
Le script concerné est  : /etc/grub.d /10_linux.

Tu peux commencer par lister ce fichier (entre balises code)

@+

#42 Le 03/02/2011, à 15:13

Baptiste22000

Re : Restauration Grub (RESOLU)

Alors, je viens de lire ton message et là, j'avoue que ça me fait 1 peu peur quand même. Parce que si le MBR est écrasé, je ne pourrai même plus accéder à Windows, c'est ça ? Dans tous les cas, je viens quand même de faire la sauvegarde comme tu me l'a conseillé, mais je ne vois pas où est-ce qu'elle s'est enregistrée cette sauvegarde. Donc dur de la metter sur 1 clés USB.
Et ensuite, je viens de lister le script que tu me demande, ça donne ça :

ubuntu@ubuntu:~$  cat /etc/grub.d/10_linux
#! /bin/sh -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

prefix=/usr
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
. ${libdir}/grub/grub-mkconfig_lib

export TEXTDOMAIN=grub
export TEXTDOMAINDIR=@LOCALEDIR@

CLASS="--class gnu-linux --class gnu --class os"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR}"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
  /dev/loop/*|/dev/loop[0-9])
    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
    # We can't cope with devices loop-mounted from files here.
    case ${GRUB_DEVICE} in
      /dev/*) ;;
      *) exit 0 ;;
    esac
  ;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
    || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm"  ] ; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

# add crashkernel option if we have the required tools
if [ -x "/usr/bin/makedumpfile" ] && [ -x "/sbin/kexec" ]; then
    GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M"
fi

linux_entry ()
{
  os="$1"
  version="$2"
  recovery="$3"
  args="$4"
  if ${recovery} ; then
    title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
  else
    title="$(gettext_quoted "%s, with Linux %s")"
  fi
  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}"
  cat << EOF
    recordfail
EOF
  save_default_entry | sed -e "s/^/\t/"

  if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ]; then
      cat << EOF
    set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
EOF
  fi

  if [ -z "${prepare_boot_cache}" ]; then
    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
  fi
  printf '%s\n' "${prepare_boot_cache}"
  if [ "x$5" != "xquiet" ]; then
    cat << EOF
    echo    '$(printf "$(gettext_quoted "Loading Linux %s ...")" ${version})'
EOF
  fi
  cat << EOF
    linux    ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
  if [ "x$5" != "xquiet" ]; then
    cat << EOF
    echo    '$(gettext_quoted "Loading initial ramdisk ...")'
EOF
  fi
  if test -n "${initrd}" ; then
    cat << EOF
    initrd    ${rel_dirname}/${initrd}
EOF
  fi
  cat << EOF
}
EOF
}

list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`
prepare_boot_cache=

while [ "x$list" != "x" ] ; do
  linux=`version_find_latest $list`
  echo "Found linux image: $linux" >&2
  basename=`basename $linux`
  dirname=`dirname $linux`
  rel_dirname=`make_system_path_relative_to_its_root $dirname`
  version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
  alt_version=`echo $version | sed -e "s,\.old$,,g"`
  linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"

  initrd=
  for i in "initrd.img-${version}" "initrd-${version}.img" \
       "initrd-${version}" "initrd.img-${alt_version}" \
       "initrd-${alt_version}.img" "initrd-${alt_version}"; do
    if test -e "${dirname}/${i}" ; then
      initrd="$i"
      break
    fi
  done
  if test -n "${initrd}" ; then
    echo "Found initrd image: ${dirname}/${initrd}" >&2
  else
    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
    linux_root_device_thisversion=${GRUB_DEVICE}
  fi

  linux_entry "${OS}" "${version}" false \
      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
      quiet
  if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
    linux_entry "${OS}" "${version}" true \
    "single ${GRUB_CMDLINE_LINUX}"
  fi

  list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done

Hors ligne

#43 Le 03/02/2011, à 15:43

Baptiste22000

Re : Restauration Grub (RESOLU)

Je suis en train de tenter de faire la sauvegarde sur la clé en recommençant tout à partir de ma session (puisque j'arrive à y accéder 1 fois, après avoir rebooter en ayant au préalable tout refait là encore, à aprtir du Live CD). Je suis donc sur ma session et je recommence ton poste #19. Et là, alors que ça bloquait au moment de chrooter, ça fonctionne mais il ne veux as copier ma sauvegarde sur ma clé :

olivier@ubuntu:~$ sudo mkdir /win
olivier@ubuntu:~$ sudo mount /dev/sda5 /win
olivier@ubuntu:~$ sudo mkdir /vdisk
olivier@ubuntu:~$ sudo mount -o loop /win/ubuntu/disks/root.disk /vdisk
olivier@ubuntu:~$ sudo mount --bind /dev /vdisk/dev
olivier@ubuntu:~$ sudo mount --bind /proc /vdisk/proc
olivier@ubuntu:~$ sudo chroot /vdisk
root@ubuntu:/# dd if=/dev/sda of=/Sov_Mbr.bs bs=512 count=1
1+0 enregistrements lus
1+0 enregistrements écrits
512 octets (512 B) copiés, 8,6394e-05 s, 5,9 MB/s
root@ubuntu:/# cp /Sov_Mbr /media/Olivier/Sov_Mbr.bs
cp: accès à «/media/Olivier/Sov_Mbr.bs»: Erreur d'entrée/sortie
root@ubuntu:/#

Hors ligne

#44 Le 03/02/2011, à 15:48

Compte anonymisé

Re : Restauration Grub (RESOLU)

Fais plutôt :

mount

pour connaitre le point de montage de ta clé puis remplace /media/Olivier par la bonne valeur.


cp     /Sov_Mbr.bs        /media/Olivier/Sov_Mbr.bs

@+

Dernière modification par Compte anonymisé (Le 03/02/2011, à 15:50)

#45 Le 03/02/2011, à 15:51

Baptiste22000

Re : Restauration Grub (RESOLU)

Toujours pas :

root@ubuntu:/# cp /Sov_Mbr.bs /media/Olivier/Sov_Mbr.bs
cp: accès à «/media/Olivier/Sov_Mbr.bs»: Erreur d'entrée/sortie

Hors ligne

#46 Le 03/02/2011, à 15:52

Baptiste22000

Re : Restauration Grub (RESOLU)

Et si je passe par 1 nouveau terminal (n'étant pas alors en "root"), j'obtient :

olivier@ubuntu:~$ cp /Sov_Mbr /media/Olivier/Sov_Mbr.bs
cp: impossible d'évaluer «/Sov_Mbr»: Aucun fichier ou dossier de ce type
olivier@ubuntu:~$

Hors ligne

#47 Le 03/02/2011, à 15:58

Baptiste22000

Re : Restauration Grub (RESOLU)

En faisant "mount, je ne vois même pas ma clé :

root@ubuntu:/# mount
/dev/loop0 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/dev/sda5 on /host type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/olivier/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=olivier)
/dev/sda5 on /win type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)

root@ubuntu:/# mount /media/Olivier
mount: ne peut repérer /media/Olivier dans /etc/fstab ou /etc/mtab

Hors ligne

#48 Le 03/02/2011, à 15:59

Compte anonymisé

Re : Restauration Grub (RESOLU)

Salut

J'avais pas capté, mais le chroot ne sert à rien si tu démarres sur ta session.
Donc tu rebootes normalement et tu tapes :
sudo  dd  if=/dev/sda  of=/Sov_Mbr  bs=512  count=1

Ensuite tu montes ta clé usb et tu copies le fichier dessus :
sudo  cp  /Sov_Mbr  /point_de_montage/Sov_Mbr

@+

#49 Le 03/02/2011, à 16:08

Compte anonymisé

Re : Restauration Grub (RESOLU)

Sinon qu'as-tu fait exactement avec "grub_customatomiseur" . Te souviens-tu car le script 10_linux semble ok.

Que donne la commande :
sudo  grub-mkconfig

@+

#50 Le 03/02/2011, à 16:18

Baptiste22000

Re : Restauration Grub (RESOLU)

Pour pouvoir repartir sur ma session, j'ai dû repartir à partir du Live CD et tout recommencer depuis le début. Et j'en ai profiter pour copier sur ma clé, ce qui a marché cette fois. Je quitte maintenant le live pour retourner sur ma session.
Veux-tu que je te fasse la commande "sudo  grub-mkconfig" ou est-ce que je continue le #19 maintenant que j'ai sauvegardé ?

Hors ligne