0

Gist: I am trying to add a Ubuntu instance which is on the secondary hard drive to grub which is on the primary hard drive running CentOS. grub version is GNU GRUB 0.97.

The primary hard drive contains CentOS release 6.8 (Final), x86_64 Linux 3.8.8. The grub entry item for the kernel I am running is

title CentOS (3.8.8)
 root (hd0,0)
 kernel /vmlinuz-3.8.8 ro root=/dev/mapper/vg_sakplab100-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_sakplab100/lv_swap rd_NO_MD rd_LVM_LV=vg_sakplab100/lv_root SYSFONT=latarcyrheb-sun16 crashkernel=128M  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
 initrd /initramfs-3.8.8.img

I was given another hard drive that has Ubuntu on it (not sure which version). If I run fdisk -l the secondary hard drive info is:

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          32      248832   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2              32       60802   488134657    5  Extended
Partition 2 does not end on cylinder boundary.
Partition 2 does not start on physical sector boundary.
/dev/sdb5              32       60802   488134656   8e  Linux LVM

After mounting /dev/sdb1 I was able to view the /grub/grub.cfg file. There are a number of menu items though I think the relevant entry is the following (the other ones had recovery in their title:

menuentry 'Ubuntu, with Linux 4.4.0-31-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-31-generic-advanced-07c9c822-a9c3-4df5-8965-81b5af4e5dff' {
            recordfail
            load_video
            gfxmode $linux_gfx_mode
            insmod gzio
            insmod part_msdos
            insmod ext2
            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  5ff7efa5-1a24-4e42-bba0-c3b1a4b86fd3
            else
              search --no-floppy --fs-uuid --set=root 5ff7efa5-1a24-4e42-bba0-c3b1a4b86fd3
            fi
            echo    'Loading Linux 4.4.0-31-generic ...'
            linux   /vmlinuz-4.4.0-31-generic root=/dev/mapper/dhcp--10--33--42--96--vg-root ro  
            echo    'Loading initial ramdisk ...'
            initrd  /initrd.img-4.4.0-31-generic
    }

I have tried creating a few menu items, but it doesn't boot the Ubuntu instance. Does anyone know how I would create a new menuitem in grub so I can boot the Ubuntu instance? Thanks

0

Okay, after a great number of failures and days trying to make it work, I did find one solution. So, this is the menuitem I have. I am sure it isn't complete, but at least Ubuntu is booting.

title Ubuntu
        root (hd1,0)
        kernel /vmlinuz-4.4.0-59-generic root=/dev/mapper/dhcp--10--33--42--96--vg-root ro
        module /initrd.img-4.4.0-59-generic

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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