0

I currently have a Windows 10 and Ubuntu 16.04 dual boot on my PC. This issue happened because i have installed windows after Ubuntu.

I have tried to boot from a live-USB and reinstalling Grub using the terminal following this link http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd

Also using the grub repair tool but with no success!

And now I am stuck in this grub2 command line screen:

Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file completions.
grub>

I got this output after running lsblk; sudo parted -l

Model: ATA WDC WD3000HLFS-0 (scsi)
Disk /dev/sda: 300GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  525MB  524MB  primary  ntfs         boot
 2      525MB   300GB  300GB  primary  ntfs

Model: ATA WDC WD3000HLFS-0 (scsi)
Disk /dev/sdb: 300GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  300GB  300GB  primary  ext4

Model: ATA Samsung SSD 840 (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  8002MB  8001MB  primary   linux-swap(v1)
 2      8003MB  500GB   492GB   extended
 5      8003MB  28.0GB  20.0GB  logical   ext4
 6      28.0GB  28.5GB  500MB   logical   ext4
 7      28.5GB  43.5GB  15.0GB  logical   ext4
 8      43.5GB  58.5GB  15.0GB  logical   ext4
 9      58.5GB  88.5GB  30.0GB  logical   ext4            boot
10      88.5GB  500GB   412GB   logical   ext4

Model: JetFlash Transcend 16GB (scsi)
Disk /dev/sdd: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  15.8GB  15.8GB  primary  fat32        boot, lba
TheOdd
  • 3,012
  • Will you append the output of lsblk; sudo parted -l to your question? – L. D. James Oct 04 '16 at 13:25
  • @L.D.James Done, i have appended the output to the question. – Osama Ahmaro Oct 04 '16 at 13:50
  • Is sdc6 the /boot-partition? If so you should have mounted the partition as well during your repair-attempt. After the first command (following your link) sudo mount /dev/sdXY /mnt you would have to mount the boot-partition sudo mount /dev/sdc6 /mnt/boot and then go on with the other commands in the link. We can't see what sdc6 is, but looking at the size it could be a /boot-partition, you are the one who knows... – mook765 Oct 04 '16 at 14:40
  • When you performed the steps in the link, what did you specify for /dev/sdaXY and /dev/sdX? Also when you performed the steps, did you get any errors at all? And finally, do you know for sure which partition has your Ubuntu insalled? – L. D. James Oct 04 '16 at 14:59
  • @mook765 Yes! sdc6 is my boot partition, and mounting the boot partition didn't solve the problem! – Osama Ahmaro Oct 04 '16 at 15:12
  • @L.D.James for the /dev/sdxXY : /dev/sdc5 which is my root directory, and for the /dev/sdX : /dev/sdc. and yes i did get warning after updating grub that says : Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. mkdir: cannot create directory ‘/var/lib/os-prober/mount’: No such file or directory – Osama Ahmaro Oct 04 '16 at 15:25
  • Most likely your boot device is /sda. You repaired a boot configuration that may not be used. There are two options. Set your BIOS to boot to /dev/sdc or update the grub in /dev/sda. Follow the steps in the link again. And let me know the outcome. – L. D. James Oct 04 '16 at 15:28
  • OK, but it is the way it should have be done during your first repair-attempt. Look at this answer. The first attempt may have created some file or folders in the /boot-folder on the system-partition. Normally this folder should be empty, it is the folder which is the mount-point for your boot-partition. Check it out and empty that folder, then try to repair again with mounting the /boot-partition during repair, could work, but I can't promise... – mook765 Oct 04 '16 at 15:32
  • @L.D.James I think /sda is the partition for windows boot, and i have just tried updating grub on that partition and still same problem with the same warning when updating, i checked gParted and it shows that its an ntfs partition , i never created this partition i think it was created on windows installation! – Osama Ahmaro Oct 04 '16 at 15:40
  • Then that should resolve it. There's one more key factory that you might have to check. Take a look at: http://askubuntu.com/a/832626/29012 . The steps are very similar to the ones you did. So far those specifics has never failed. The key factor (if you have problems with the /dev/sda) is to ensure that you have UEFI enabled if your computer is capable. If your computer was booting before and stopped it might be that you may have inadvertently disabled UEFI. Thanks for the update. By the way, you shouldn't make any manual changes to the drive... Allow Grub to fix the problem. – L. D. James Oct 04 '16 at 15:46
  • @L.D.James i don't understand what i should be doing next, please explain more, how can that resolve it ? and yes my system was always able to boot until i have installed windows after ubunut! and i don't recall disabling UEFI and also i am not sure if i was using UEFI in the first place, how do i know if my system was using EUFI before? – Osama Ahmaro Oct 04 '16 at 15:55
  • Two things... the /dev/sda isn't a partition. It's the physical drive. Run the steps in the link you posted with this as the replacement for /dev/sdX. In your command you have /dev/sdXY correct. But you have /dev/sdX as /dev/sdc. It should be /dev/sda. Also insure you have UEFI enabled. I'll put the steps in a formatted answer to make it easier to follow. – L. D. James Oct 04 '16 at 15:59
  • @mook765 I have emptied that folder and reinstalled grub with the boot partition mounted, and still same problem! – Osama Ahmaro Oct 04 '16 at 16:06
  • The answer I just posted should fix the problem that may have been created by emptying the folder. The later computers use a partition for the boot manager. grub-install and update-grub modifies that partition, leaving it compatible for both Windows and Grub. You might have to reinstall Windows or Reinstall Grub to fix that partition that you emptied out. I'll empty out a partition on a machine in my shop and see what the best way to handle it. – L. D. James Oct 04 '16 at 16:10
  • All your hard-drives have msdos-partition-table, that means everything is installed in legacy-mode. Windows will not install in UEFI-mode on MBR(msdos)-partitioned drive. – mook765 Oct 04 '16 at 16:36

1 Answers1

1

From your Question and comments the resolution will be the following:

Boot to the live disk and run these steps. the /dev/sdXY is replaced for the specifics of the information you have provided.

The c6 in step 1 and the a in step 4 are variables. The c6 should be replaced with the partition of your Ubuntu install. The a should be replaced with the default boot that you have set in your bios.

The prefix :$ and :# are the command prompts you see on the terminal.

1:$ sudo mount /dev/sdc6 /mnt
2:$ for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt/$i"; done
3:$ sudo chroot /mnt
4:# grub-install /dev/sda
5:# update-grub
6:# exit
7:$ for i in /sys /proc /run /dev; do sudo umount "/mnt/$i"; done
8:$ exit

Reboot.

Ensure that you have UEFI enabled in your BIOS if is a later model computer with that feature.

L. D. James
  • 25,036
  • i get this problem : mount: special device /dev/sda6 does not exist, i have checked gparted and it only shows that i have sda1 and sda2 i don't have sda6!, and i don't recall that my bois have EUFI feature, its an old motherboard! – Osama Ahmaro Oct 04 '16 at 16:09
  • Sorry... that should be /dev/sdc6. I'm modifying the answer. The last is correct... the /dev/sda. So you have two parameters... /dev/sdc6 and /dev/sda to put in the commands above. – L. D. James Oct 04 '16 at 16:15
  • running the 2nd line causes the following error mount: mount point /mnt//sys does not exist mount: mount point /mnt//proc does not exist mount: mount point /mnt//run does not exist mount: mount point /mnt//dev does not exist

    I don't know what is happening i think it was working before!

    – Osama Ahmaro Oct 04 '16 at 16:21
  • From the error output it appears that you have a double slash "//" in that line. Can you verify that it's only a single slash "/"? – L. D. James Oct 04 '16 at 16:23
  • even with single line it give me this error mount: mount point /mnt/sys does not exist mount: mount point /mnt/proc does not exist mount: mount point /mnt/run does not exist mount: mount point /mnt/dev does not exist – Osama Ahmaro Oct 04 '16 at 16:26
  • After the first line what is the output of ls /mnt – L. D. James Oct 04 '16 at 16:29
  • sudo mount /dev/sdc5 not 6, because my root folder is at sdc5 this is what causes the errors! – Osama Ahmaro Oct 04 '16 at 16:31
  • sdc6 is the/boot-partition and should be mounted at/mnt/boot`. All hard-drives have MBR, so why should UEFI be enabled? – mook765 Oct 04 '16 at 16:50