Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've got a bunch of identical systems on which I want to clone the same openSUSE 12.3 installation.

I've set up clonezilla on PXE server.

After appling the disk-image of on another machine, it fails to boot.

This is because all the partitions are referred to be their UUIDs instead of the kernel-assigned name (sda1, sda2, etc).

How do I configure grub to be using the kernel names instead of the UUID so that the image can be truly ported to the other systems?

I have tried setting GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub and then run grub2-mkconfig -o /boot/grub2/grub.cfg. I have also changed the entry in /etc/fstab.

After these changes, the system still boots fine on the source machine, but doesn't boot on all the others. Grub loads, but only shows the word "GRUB" and thats all. Nothing else happens.

My current grub.cfg is the following:

#
# 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 [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

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 {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4
else
  search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4
fi
    font="/usr/share/grub2/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4
else
  search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4
fi
insmod gfxmenu
loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2
insmod png
set theme=($root)/boot/grub2/themes/openSUSE/theme.txt
export theme
if [ x${boot_once} = xtrue ]; then
  set timeout=0
elif sleep --interruptible 0 ; then
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE 12.3' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-5613d48c-eedb-4389-91bc-e49de73a1cc4' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4
    else
      search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4
    fi
    echo    'Loading Linux 3.7.10-1.4-default ...'
    linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5   splash=silent acpi=on barrier=off reboot=pci  init=linuxrc splash=silent quiet showopts
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd-3.7.10-1.4-default
}
submenu 'Advanced options for openSUSE 12.3' $menuentry_id_option 'gnulinux-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' {
    menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4
        else
          search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4
        fi
        echo    'Loading Linux 3.7.10-1.4-default ...'
        linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5   splash=silent acpi=on barrier=off reboot=pci  init=linuxrc splash=silent quiet showopts
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd-3.7.10-1.4-default
    }
    menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default (recovery mode)' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-recovery-5613d48c-eedb-4389-91bc-e49de73a1cc4' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4
        else
          search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4
        fi
        echo    'Loading Linux 3.7.10-1.4-default ...'
        linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5  showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd-3.7.10-1.4-default
    }
}

### 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+ ###
### END /etc/grub.d/20_memtest86+ ###

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

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-52EA4C7AEA4C5C7B' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  52EA4C7AEA4C5C7B
    else
      search --no-floppy --fs-uuid --set=root 52EA4C7AEA4C5C7B
    fi
    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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###
share|improve this question
1  
What is the error you get on the other systems ? Could you post the content of your /boot/grub2/grub.cfg (use pastebin or something) ? Also, do you have a /boot/grub2/device.map file ? Finally, any reason you wouldn't make your own custom entry in /etc/grub.d/40_custom and do away with the default grub stuff ? –  don_crissti May 13 '13 at 15:49
    
@don_crissti, I have updated my question to point out that there are only symptoms, no particular errors. There is a device.map and I have also tried editing it. Changed something like /dev/disk/by-id/... to /dev/sda. I will post my grub.cfg Once I get back to that machine. So putting something into /etc/grub.d/40_custom could be the answer to my question?? –  d_inevitable May 14 '13 at 5:21
    
@don_crissti, Ok I've posted the config file. –  d_inevitable May 14 '13 at 10:12
    
@don_crissti Thanks a lot for your reply. I have just done an intersting test and found that the grub.cfg cannot be the problem after all. On the cloned machine I have fixed grub by reinstalling it from an ubuntu live cd so that the system now boots. Upon comparing the config files, they are identical. So I am guessing there is something wrong with the MBR. Does grub-mkconfig_lib set uuid for the MBR too? –  d_inevitable May 14 '13 at 13:21
    
I'm not familiar with Clonezilla but apparently it re-runs "grub-install" ? You might want to investigate whether this is an issue caused by Clonezilla rather than GRUB. –  don_crissti May 14 '13 at 16:49
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.