0

I already had RHEL 7 on my HDD(I have only one) and now recently installed Ubuntu 14.04. I am unable to create Grub2 entry so that I can use both OS, currently I can only use Ubuntu.

The result for #fdisk -l is :

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x00098227

 Device    Boot   Start       End         Blocks    Id  System
/dev/sda1   *   314574848   524290046   104857599+  83  Linux
/dev/sda2       524292094   976771071   226239489    f  W95 Ext'd (LBA)
/dev/sda5       524292096   874369023   175038464    7  HPFS/NTFS/exFAT
/dev/sda6       875397120   976771071    50686976   8e  Linux LVM 

Disk /dev/mapper/rhel-swap: 4043 MB, 4043309056 bytes
255 heads, 63 sectors/track, 491 cylinders, total 7897088 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: 0x00000000

Disk /dev/mapper/rhel-swap doesn't contain a valid partition table

Disk /dev/mapper/rhel-root: 47.9 GB, 47857008640 bytes
255 heads, 63 sectors/track, 5818 cylinders, total 93470720 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: 0x00000000

Disk /dev/mapper/rhel-root doesn't contain a valid partition table

  • Did your run sudo update-grub? – Ron Dec 10 '15 at 15:39
  • That's it. It will check what OSes are installed. – Tung Tran Dec 10 '15 at 15:39
  • Ya I did that. The result is ...........

    Found initrd image: /boot/initrd.img-3.16.0-53-generic Found linux image: /boot/vmlinuz-3.16.0-51-generic Found initrd image: /boot/initrd.img-3.16.0-51-generic Found linux image: /boot/vmlinuz-3.16.0-30-generic Found initrd image: /boot/initrd.img-3.16.0-30-generic Found memtest86+ image: /boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin Found FreeDOS on /dev/sdb1 Found Red Hat Enterprise Linux Server release 7.0 (Maipo) on /dev/mapper/rhel-root done

    – nabinGhimire Dec 10 '15 at 15:46
  • Make sure fast boot ans secure boot is disabled in bios- update your grub 'sudo update-grub" – DnrDevil Dec 10 '15 at 15:46
  • @DnrDevil I check my bios, there were not such options like fast bootand secure boot . I did sudo update-grub2 and the result says Found Red Hat Enterprise Linux Server release 7.0 (Maipo) on /dev/mapper/rhel-root. – nabinGhimire Dec 10 '15 at 16:07
  • It says it found the Red Hat install? So does that not boot? Normally you have to install the lvm2 driver and also mount the lvm partitions for grub to find installs inside a LVM. – oldfred Dec 10 '15 at 16:09

1 Answers1

2

Normally Red Hat and related distributions use an LVM configuration in which there's an LVM partition (which you've got) with at least a couple of logical volumes (which you've got) and a separate /boot partition (which you don't seem to have). Without the /boot partition, you won't be able to boot RHEL, since your system won't have a kernel, which is absolutely essential for booting. My suspicion is that you accidentally deleted your RHEL /boot partition when you installed Ubuntu, which I suspect exists on your /dev/sda1. I can't be 100% positive of this diagnosis, though.

There is one small glimmer of hope: Your /dev/sda1 starts at sector 314,574,848, which means there's about 150 GiB of unallocated space at the start of the disk. If /boot was originally in that space, then it may be possible to recover it with TestDisk. You may want to look into that possibility:

A caveat: If I'm right, changing your disk's partition layout runs the risk of creating new problems or making your current problem worse. Doing a low-level backup of the entire disk is a wise precaution. You'd do that with something like:

sudo dd if=/dev/sda of=/path/to/lots/of/space/sda-backup/img

This command is likely to take several hours to complete. You'll need another disk that's at least a little bit larger than your current /dev/sda, mounted somewhere so that /path/to/lots/of/space will reside on that larger disk.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105