Kopiëren installatie naar andere harde schijf mislukt (Grub)

Pagina: 1
Acties:

Acties:
  • 0 Henk 'm!

  • chronoz
  • Registratie: Maart 2010
  • Laatst online: 09-10-2022
Ik heb de data van mijn installatie gekopieerd naar een andere schijf om vervolgens Grub opnieuw te installeren. Ik heb alles overgezet met rsync -av -op en dat lijkt ook goed gegaan te zijn.

Helaas kom ik op een errormelding terecht waar weinig informatie over te vinden is. Ik heb alle combinaties van grub2-mkconfig en grub2-install al geprobeerd via de Fedora Live DVD.

Het aparte is dat de computer de eerste keer gewoon opstartte vanaf de kopie, al weliswaar extreem langzaam.

GRUB loading.
Welcome to GRUB!

error: ELF header smaller than expected.
Entering rescue mode...
grub rescue> _
Hoe kan ik ervoor zorgen dat mijn computer weer opstart?

Acties:
  • 0 Henk 'm!

  • Sir Isaac
  • Registratie: September 2002
  • Laatst online: 21-05 20:45
Kun je je partities lezen als je van de live DVD op bent gestart? En dan met name de inhoud van /boot/grub.

[ Voor 24% gewijzigd door Sir Isaac op 06-01-2012 16:05 ]


Acties:
  • 0 Henk 'm!

  • chronoz
  • Registratie: Maart 2010
  • Laatst online: 09-10-2022
[liveuser@localhost ~]$ sudo su

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

liveuser is not in the sudoers file.  This incident will be reported.
[liveuser@localhost ~]$ su
[root@localhost liveuser]# mount /dev/developer/developer /mnt
[root@localhost liveuser]# mount /dev/sdb1 /mnt/boot
mount: special device /dev/sdb1 does not exist
[root@localhost liveuser]# mount /dev/sda1 /mnt/boot
[root@localhost liveuser]# ls /mnt/boot
config-3.1.6-1.fc16.x86_64  initramfs-3.1.6-1.fc16.x86_64.img
efi                         initrd-plymouth.img
elf-memtest86+-4.20         memtest86+-4.20
grub                        System.map-3.1.6-1.fc16.x86_64
grub2                       vmlinuz-3.1.6-1.fc16.x86_64
[root@localhost liveuser]# ls /mnt/boot -al
total 24229
dr-xr-xr-x.  5 root root     1024 Jan  4 16:43 .
dr-xr-xr-x. 22 root root     4096 Jan  5 01:29 ..
-rw-r--r--.  1 root root   114099 Dec 21 17:46 config-3.1.6-1.fc16.x86_64
drwxr-xr-x.  3 root root     1024 May 13  2011 efi
-rw-r--r--.  1 root root   178436 Dec  7 17:55 elf-memtest86+-4.20
drwxr-xr-x.  2 root root     1024 Jan  2 02:24 grub
drwxr-xr-x.  3 root root     7168 Jan  5 01:37 grub2
-rw-r--r--.  1 root root 16781849 Jan  2 00:17 initramfs-3.1.6-1.fc16.x86_64.img
-rw-r--r--.  1 root root   590728 Jan  2 01:52 initrd-plymouth.img
-rw-r--r--.  1 root root   176760 Dec  7 17:55 memtest86+-4.20
-rw-------.  1 root root  2360182 Dec 21 17:46 System.map-3.1.6-1.fc16.x86_64
-rwxr-xr-x.  1 root root  4580496 Dec 21 17:46 vmlinuz-3.1.6-1.fc16.x86_64
[root@localhost liveuser]# mount
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime,seclabel)
nog twintigtal andere regels
/dev/mapper/developer-developer on /mnt type ext4 (rw,relatime,seclabel,user_xattr,acl,barrier=1,data=ordered)
/dev/sda1 on /mnt/boot type ext4 (rw,relatime,seclabel,user_xattr,acl,barrier=1,data=ordered)
[root@localhost liveuser]# ls /mnt/boot/grub2/grub.cfg
/mnt/boot/grub2/grub.cfg
[root@localhost liveuser]# cat /mnt/boot/grub2/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-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="${saved_entry}"
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 load_video {
true
}

set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora Linux, with Linux 3.1.6-1.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root bfb314cd-677f-42cc-9263-527043a66d5d
	echo	'Loading Linux 3.1.6-1.fc16.x86_64 ...'
	linux	/vmlinuz-3.1.6-1.fc16.x86_64 root=/dev/mapper/developer-developer ro rd.md=0 rd.dm=0 rd.lvm.lv=developer/swap  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 rd.lvm.lv=developer/developr LANG=en_US.UTF-8 
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-3.1.6-1.fc16.x86_64.img
}
menuentry 'Fedora Linux, with Linux 3.1.6-1.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	insmod ext4
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root bfb314cd-677f-42cc-9263-527043a66d5d
	echo	'Loading Linux 3.1.6-1.fc16.x86_64 ...'
	linux	/vmlinuz-3.1.6-1.fc16.x86_64 root=/dev/mapper/developer-developer ro single rd.md=0 rd.dm=0 rd.lvm.lv=vg_developer/lv_swap  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 rd.lvm.lv=vg_developer/lv_root LANG=en_US.UTF-8
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-3.1.6-1.fc16.x86_64.img
}
### END /etc/grub.d/10_linux ###
x
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### 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
[root@localhost liveuser]#

Onder het motto van meer informatie is meer:
[root@localhost liveuser]# fdisk -l /dev/sda

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3c3c61a3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400   83  Linux
/dev/sda2          206848    41943039    20868096   8e  Linux LVM
[root@localhost liveuser]# ls /dev/developer/
developer  swap
[root@localhost liveuser]# ls /dev/developer/ -al
total 0
drwxr-xr-x.  2 root root   80 Jan  6 12:07 .
drwxr-xr-x. 18 root root 3460 Jan  6 12:07 ..
lrwxrwxrwx.  1 root root    7 Jan  6 12:07 developer -> ../dm-3
lrwxrwxrwx.  1 root root    7 Jan  6 12:07 swap -> ../dm-2
[root@localhost liveuser]

Ik moet alleen even mounten en dat gaat perfect.
mount /dev/developer/developer /mnt
mount /dev/sda1 /mnt/boot
chroot /mnt
eventuele bind mounts

Ik heb dus geen idee wat ik nog zou kunnen doen. Ik heb net een wikipedia pagina gelezen over ELF, maar ben nog niets wijzer.

Acties:
  • 0 Henk 'm!

  • chronoz
  • Registratie: Maart 2010
  • Laatst online: 09-10-2022
Herinstallatie van Grub op basis van originele namen van volume groups en logical volumes heeft het probleem opgelost. :)

Gelukkig maar, ben er gisteravond laat lang mee bezig geweest. Had beter op tijd naar bed kunnen gaan om het in de ochtend opnieuw te proberen.
[liveuser@localhost dev]$ su
[root@localhost dev]# vgrename developer vg_developer
  Volume group "developer" successfully renamed to "vg_developer"
[root@localhost dev]# cd vg_developer/
[root@localhost vg_developer]# ls
developer  swap
[root@localhost vg_developer]# lvrename developer lv_root
  Path required for Logical Volume "developer"
  Please provide a valid volume group name
  Run `lvrename --help' for more information.
[root@localhost vg_developer]# lvrename /dev/vg_developer/developer /dev/vg_developer/lv_root
  Renamed "developer" to "lv_root" in volume group "vg_developer"
[root@localhost vg_developer]# lvrename /dev/vg_developer/swap /dev/vg_developer/lv_swap
  Renamed "swap" to "lv_swap" in volume group "vg_developer"
[root@localhost vg_developer]# ls
lv_root  lv_swap
[root@localhost vg_developer]# mount /dev/vg_developer/lv_root /mnt
[root@localhost vg_developer]# mount /dev/sda
sda   sda1  sda2  
[root@localhost vg_developer]# mount /dev/sda1  /mnt/boot
[root@localhost vg_developer]# mount -o bind /proc /mnt/proc
[root@localhost vg_developer]# mount -o bind /dev /mnt/dev
[root@localhost vg_developer]# mount -o bind /srv /mnt/srv
[root@localhost vg_developer]# mount -o bind /sys /mnt/sys
[root@localhost vg_developer]# ls /
bin/                      lib64/                    opt/                      sys/
boot/                     .liveimg-configured       proc/                     tmp/
dev/                      .liveimg-late-configured  root/                     usr/
etc/                      lost+found/               run/                      var/
home/                     media/                    sbin/                     
lib/                      mnt/                      srv/                      
[root@localhost vg_developer]# chroot /mnt
[root@localhost /]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.1.6-1.fc16.x86_64
Found initrd image: /boot/initramfs-3.1.6-1.fc16.x86_64.img
done
[root@localhost /]# grub2-install /dev/sda
Installation finished. No error reported.
[root@localhost /]#