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 installed Ubuntu GNOME Remix 64-bis on my system. I set the installer to reuse my /boot and /home. Since ubiquity (the Ubuntu installer) was giving me hard time installing GRUB I selected to "Continue Without a Bootloader" and since I installed/mounted /boot in my previous /boot I just had to do update-grub from Debian 32-bits and problem solved... sounds easy, but it isn't. The update-grub command detects Ubuntu in my other HD:

sudo update-grub2
[sudo] password for braiam: 
Generating grub.cfg ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-3.10-2-686-pae
Found initrd image: /boot/initrd.img-3.10-2-686-pae
Found linux image: /boot/vmlinuz-3.8.0-19-generic
Found initrd image: /boot/initrd.img-3.8.0-19-generic
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
Found Ubuntu 13.04 (13.04) on /dev/sda1
Found Windows 7 (loader) on /dev/sdb1
done

But when I select "Ubuntu 13.04" it boots into Debian. I check out the grub.cfg entries and see that the root and UUID values are set the same as Debian's.

sudo grub-mkconfig
Generating 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
  load_env
fi
set default="0"

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,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7 --hint='hd0,msdos7'  cead26d6-08f4-4894-ac78-a9a4ce59f773
else
  search --no-floppy --fs-uuid --set=root cead26d6-08f4-4894-ac78-a9a4ce59f773
fi
    font="/usr/share/grub/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
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos8'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos8 --hint-efi=hd1,msdos8 --hint-baremetal=ahci1,msdos8 --hint='hd0,msdos8'  0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589
else
  search --no-floppy --fs-uuid --set=root 0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589
fi
Found background image: /usr/share/images/desktop-base/desktop-grub.png
insmod png
if background_image /braiam/.cache/gnome-control-center/backgrounds/14fb12e1345ca2dfd3807e7f7b1122b0d6015d9453ed5742de72b988a9cffded; then
  set color_normal=white/black
  set color_highlight=black/white
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
Found linux image: /boot/vmlinuz-3.10-2-686-pae
Found initrd image: /boot/initrd.img-3.10-2-686-pae
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
    load_video
    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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    echo    'Loading Linux 3.10-2-686-pae ...'
    linux   /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1
    echo    'Loading initial ramdisk ...'
    initrd  /initrd.img-3.10-2-686-pae
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
    menuentry 'Debian GNU/Linux, with Linux 3.10-2-686-pae' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10-2-686-pae-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
        load_video
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        echo    'Loading Linux 3.10-2-686-pae ...'
        linux   /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.10-2-686-pae
    }
    menuentry 'Debian GNU/Linux, with Linux 3.10-2-686-pae (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10-2-686-pae-recovery-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
        load_video
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        echo    'Loading Linux 3.10-2-686-pae ...'
        linux   /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.10-2-686-pae
    }
Found linux image: /boot/vmlinuz-3.8.0-19-generic
Found initrd image: /boot/initrd.img-3.8.0-19-generic
    menuentry 'Debian GNU/Linux, with Linux 3.8.0-19-generic' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-19-generic-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
        load_video
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        echo    'Loading Linux 3.8.0-19-generic ...'
        linux   /vmlinuz-3.8.0-19-generic root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.8.0-19-generic
    }
    menuentry 'Debian GNU/Linux, with Linux 3.8.0-19-generic (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-19-generic-recovery-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
        load_video
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        echo    'Loading Linux 3.8.0-19-generic ...'
        linux   /vmlinuz-3.8.0-19-generic root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.8.0-19-generic
    }
}

### 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+ ###
Found memtest86+ image: /memtest86+.bin
menuentry "Memory test (memtest86+)" {
    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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    linux16 /memtest86+.bin console=ttyS0,115200n8
}
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
menuentry "Memory test (memtest86+, experimental multiboot)" {
    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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    multiboot   /memtest86+_multiboot.bin
}
menuentry "Memory test (memtest86+, serial console 115200, experimental multiboot)" {
    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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    multiboot   /memtest86+_multiboot.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
Found Ubuntu 13.04 (13.04) on /dev/sda1
menuentry 'Ubuntu 13.04 (13.04)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-bf554a2f-a035-4c22-bca8-162def35a03c' {
    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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1
    initrd /initrd.img-3.10-2-686-pae
}
submenu 'Advanced options for Ubuntu 13.04 (13.04)' $menuentry_id_option 'osprober-gnulinux-advanced-bf554a2f-a035-4c22-bca8-162def35a03c' {
    menuentry 'Debian GNU/Linux (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10-2-686-pae--bf554a2f-a035-4c22-bca8-162def35a03c' {
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1
        initrd /initrd.img-3.10-2-686-pae
    }
    menuentry 'Debian GNU/Linux, with Linux 3.10-2-686-pae (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10-2-686-pae--bf554a2f-a035-4c22-bca8-162def35a03c' {
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1
        initrd /initrd.img-3.10-2-686-pae
    }
    menuentry 'Debian GNU/Linux, with Linux 3.10-2-686-pae (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10-2-686-pae-root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz-bf554a2f-a035-4c22-bca8-162def35a03c' {
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz
        initrd /initrd.img-3.10-2-686-pae
    }
    menuentry 'Debian GNU/Linux, with Linux 3.8.0-19-generic (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.8.0-19-generic--bf554a2f-a035-4c22-bca8-162def35a03c' {
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        linux /vmlinuz-3.8.0-19-generic root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1
        initrd /initrd.img-3.8.0-19-generic
    }
    menuentry 'Debian GNU/Linux, with Linux 3.8.0-19-generic (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.8.0-19-generic-root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz-bf554a2f-a035-4c22-bca8-162def35a03c' {
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        linux /vmlinuz-3.8.0-19-generic root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz
        initrd /initrd.img-3.8.0-19-generic
    }
    menuentry 'Ubuntu 13.04 (13.04) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10-2-686-pae--bf554a2f-a035-4c22-bca8-162def35a03c' {
        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=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1
        initrd /initrd.img-3.10-2-686-pae
    }
}

Found Windows 7 (loader) on /dev/sdb1
menuentry 'Windows 7 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-AA64B45A64B42AC9' {
    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=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 --hint='hd0,msdos1'  AA64B45A64B42AC9
    else
      search --no-floppy --fs-uuid --set=root AA64B45A64B42AC9
    fi
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### 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 ###
done

I could edit the entry at hand, but the fine "DO NOT EDIT THIS FILE" that the grub.cfg has at the start held me back. Should I edit this entries by hand, create a custom script, or I'm just doomed?

ls /boot of the main disk:

ls /boot/
abi-3.8.0-19-generic       initrd.img-3.8.0-19-generic  System.map-3.8.0-19-generic
config-3.10-2-686-pae      iso                          vmlinuz-3.10-2-686-pae
config-3.8.0-19-generic    lost+found                   vmlinuz-3.8.0-19-generic
extlinux                   memtest86+.bin               vmlinuz-3.8.0-19-generic.efi.signed
grub                       memtest86+_multiboot.bin
initrd.img-3.10-2-686-pae  System.map-3.10-2-686-pae

ls /boot of the disk where I installed Ubuntu:

ls /media/braiam/bf554a2f-a035-4c22-bca8-162def35a03c/boot/
grub  initrd.img-3.8.0-19-generic.new

blkid

blkid
/dev/sda1: UUID="bf554a2f-a035-4c22-bca8-162def35a03c" TYPE="ext4" #here Ubuntu
/dev/sda2: UUID="7cb917ba-babb-42cd-897e-2070d540eda4" TYPE="swap" 
/dev/sdb1: UUID="AA64B45A64B42AC9" TYPE="ntfs" 
/dev/sdb2: UUID="F66E431C6E42D551" TYPE="ntfs" 
/dev/sdb3: UUID="75a0854b-8b6b-453f-8aec-2a081a1f19e3" TYPE="swap" 
/dev/sdb5: UUID="279a18da-130b-46dd-8b54-84da48eb445f" TYPE="ext4" #Here boot
/dev/sdb6: UUID="393cd35e-b827-4dea-acb5-2a66f2369dce" TYPE="swap" 
/dev/sdb7: UUID="cead26d6-08f4-4894-ac78-a9a4ce59f773" TYPE="ext4" #here Debian
/dev/sdb8: UUID="0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589" TYPE="ext4" 

fdisk -l:

sudo fdisk -l
[sudo] password for braiam: 

Disk /dev/sda: 13.7 GB, 13701316608 bytes
255 heads, 63 sectors/track, 1665 cylinders, total 26760384 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: 0x8e48c4c5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1         2104515    26749046    12322266   83  Linux (here is Ubuntu)
/dev/sda2              63     2104514     1052226   82  Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 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: 0x1549f232

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63   223629311   111814624+   7  HPFS/NTFS/exFAT
/dev/sdb2       225724416   336437306    55356445+   7  HPFS/NTFS/exFAT
/dev/sdb3       223629312   225724415     1047552   82  Linux swap / Solaris
/dev/sdb4       336439294   390721535    27141121    5  Extended
/dev/sdb5       336439296   338391039      975872   83  Linux (here is boot)
/dev/sdb6       338393088   339390463      498688   82  Linux swap / Solaris
/dev/sdb7       339392512   368687103    14647296   83  Linux (here is Debian)
/dev/sdb8       368689152   390721535    11016192   83  Linux

Ubuntu's and Debian fstab are the very same, except for the / entry.

sudo os-prober 
[sudo] password for braiam: 
/dev/sda1:Ubuntu 13.04 (13.04):Ubuntu:linux
/dev/sdb1:Windows 7 (loader):Windows:chain

cat /boot/grub/device.map:

cat /boot/grub/device.map 
(hd0)   /dev/disk/by-id/ata-Maxtor_6L200M0_L40WL3VH
(hd1)   /dev/disk/by-id/usb-Sandisk-Curzer

(I'm taking this info from my mind since I ran sudo grub-mkdevicemap which changed the entries)

share|improve this question
    
What do you get when you run os-prober from your Debian installation? What partition is reported for Ubuntu? The os-prober utility is what grub uses to determine where each OS is installed. –  Joseph R. Sep 18 '13 at 21:14
    
My guess is, you ran update-grub from Ubuntu while you should have run it from Debian. –  Joseph R. Sep 18 '13 at 21:20

1 Answer 1

up vote 1 down vote accepted

I set the installer to reuse my /boot

I haven't used a dual-boot setup myself yet, but this seems like a mistake to me. update-grub uses grub-probe to determine on what device your current root filesystem is located and then appends this device as the root= argument to the linux line in /boot/grub/grub.cfg. This is probably the reason why your Ubuntu entry is booting Debian - you may be using Ubuntu's kernel and initramfs, but your grub.cfg instructs it to mount your Debian partition and then to continue booting from this partition.

I'd try to relocate Ubuntu's /boot to its own root filesystem (that shouldn't be too hard and then you don't have to repartition which would probably require the reinstallation of Ubuntu). Then set up Debian's grub to chainload Ubuntu's grub; it should work fine then.


EDIT: small howto on how to setup Ubuntu's /grub. Note that I'm typing this from memory, so be careful ;)

  1. Yes, move *3.8* from Debian's /grub to Ubuntu's /grub.
  2. Open a root shell.
  3. chroot into Ubuntu's filesytem:

    cd /media/braiam/bf554a2f-a035-4c22-bca8-162def35a03c
    for i in proc sys dev; do mount --bind /$i $i; done
    chroot /mnt /bin/bash
    

    You are now inside the Ubuntu system (Ubuntu's root filesystem is now /, at least in this shell), almost as if you had booted it.

  4. If you have debsums installed on Ubuntu, you can now check for missing files (in case you forgot something in Debian's boot), but this may take a while:

    debsums -s
    
  5. If you require Internet access in the chroot, for example to reinstall a damaged package, editing /etc/resolv.conf inside the chroot should do the trick. Just point the nameserver line to the same DNS server that Debian is using.

    vim /etc/resolv.conf
    
  6. Run grub-mkdevicemap. Not sure if this is important, but it probably won't hurt.

    grub-mkdevicemap
    
  7. OK, I have to admit, I'm now really unsure how to install grub on Ubuntu's /boot or if it's even necessary. grub-install expects a device, but we don't want it to write an MBR... :/

    I'll have to look into this a bit more.

    I realized only now that your Ubuntu is in fact living on a separate hard disk. Just install it to the MBR of this hard disk then:

    grub-install /dev/sda
    
  8. Update grub and rebuild the initramfs:

    update-grub
    update-initramfs -u
    
  9. Leave the chroot:

    exit
    

You still have to figure out how to tell Debian's grub that it should chainload the grub2 MBR that is now living on the Ubuntu hard disk; I don't know if it will figure that out on it's own. Maybe add a chainloader section to /etc/grub.d/40_custom on the Debian filesystem?

share|improve this answer
    
@Braiam: yes. I've updated my answer with details. –  Martin von Wittich Sep 18 '13 at 22:17
    
Just remembered that Debian is 32-bit and Ubuntu is 64 so I can't chroot. –  Braiam Sep 18 '13 at 23:20
    
@Braiam: if my suspicion that the "Ubuntu" grub entry actually booted the Ubuntu kernel with Debian's root filesystem, you'd have a 64 bit kernel. Just copy the *3.8* files back into Debian's /boot, try to boot the "Ubuntu" entry and check uname -a. –  Martin von Wittich Sep 18 '13 at 23:22
    
No dice with the chainloader, it boots Windows... I will try to boot directly with the BIOS option and see what comes up. –  Braiam Sep 19 '13 at 2:00
    
You probably need to tell the chainloader somehow which hard disk you want to boot from. –  Martin von Wittich Sep 19 '13 at 9:16

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.