Let's get some background info, I am dual-booting Win10 and Ubuntu 16.04 (I believe) on an HP 62 laptop. After the first restart, it gave me the grub rescue screen. I did the ls command and got (hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1). I tried using the ls command with all of them and I have gotten an error. It said unknown filesystem. I do know my files are intact, (as far as windows anyway) and are readable. I don't have a live USB or CD.
Edit: I currently have a live USB booted. After looking at my partition table, I know sda2 is my Windows OS, and sda4 is my Linux OS, but how would I go about fixing them?
Edit:lsblk -f; sudo parted -l
after I input this I got:
NAME FSTYPE LABEL UUID MOUNTPOINT sda ├─sda1 ntfs System Reserved 78746B10746AD104 ├─sda2 ntfs 52CE70B8CE7095C7 ├─sda3 ntfs 32DA13F9DA13B855 └─sda5 swap acf66f09-4c28-4c76-a318-d2f77efaa56a [SWAP] sdb └─sdb1 vfat UBUNTU 16_0 7C9B-EA5B /cdrom sr0 loop0 squashfs /rofs Model: ATA TOSHIBA MK5056GS (scsi) Disk /dev/sda: 500GB 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 388GB 388GB primary ntfs 3 388GB 389GB 844MB primary ntfs diag 4 389GB 500GB 111GB extended 5 494GB 500GB 6229MB logical linux-swap(v1) Model: SanDisk Cruzer U (scsi) Disk /dev/sdb: 15.6GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 15.6GB 15.6GB primary fat32 boot, lba
Edit: This is the GParted picture. (I took it down to allow the other ones.)
Edit: This is my BIOS screen and my Boot Option Menu. There is only the primary drive.
Edit: Thanks so much to everyone to for helping me fix my computer. I have all of my files intact. I really hope this helps someone else who may be having this problem.
How I did it and how it happened: At first, went to use my computer for a school project. Windows decided to install its updates at the time, so I let it. After the first restart, it gave me the grub rescue>
screen. I ran the ls
command to see my partitions, and I got the output of (hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)
Notice that there isn't a (hd0,msdos4)
. That would mean that Windows deleted the Ubuntu partition. I tried setting paths to the grub files, but they were not there. After a bit, I use a different computer to create a Live USB and booted from that. I opened up a terminal and tried installing testdisk
. (Make sure to go into your settings and enable the "universe" option in Software & Updates) When testdisk installed I ran through it and did a deep search on my hard drive. After it was done I labeled the Windows launcher to *. (Primary bootable) I then named the rest P. (Primary)
I opened grub rescue again, after saving the partition table, and ran ls
. The output was something similar to (hd0) (hd0,msdos5) (hd0,msdos4) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1)
I ran ld (hd0,msdos3)
and it gave the result that is is a ext2 drive. Finally! I then ran
set root=(hd0,msdos3)
set prefix=(hd0,msdos3)/boot/grub
insmod normal
normal
and it booted just fine! Hope this helps you, because it definatly helped me.
Best Answer
There are two options you can use. You can use the
grub rescue
console to mount and update/fix grub, or you can use a Live Ubuntu disk/usb for this. Since your question suggest this is a fresh install, you most likely still have your Live DVD/USB handy.Boot to your install media. If you have a
UEFI
capable computer, ensure that you boot to that mode.When you get to the prompt, allowing you to
Try without installing Ubuntu
, choose that option.Open a terminal (type terminal in the Ubuntu Dash search).
Run these commands in the console:
The
XY
in line #1 is a variable. This is the partition where Ubuntu is installed (ie/dev/sda6
). This can be any partition on any drive attached to your computer.The
XY
in line #3 is a variable. Replace this with the partition that hasEFI
installed. This is almost always/dev/sda1
. If your boot drive isn't an EFI drive, skip steps #3 and #10.The
X
in line 6 is your boot drive (a single letter). This almost always is/dev/sda
.Reboot the computer.
Grub Rescue
Outside of having a USB or DVD install disk, these are steps for the Grub Rescue prompt:
More details and definition of the available Grub Rescue commands can be found in the Ubuntu Community Help Docs. That's the source of the Grub Rescue commands above.
I've used it, and find it fairly easy as you get used to it. But it's not as easy to explain to a novice as it is to actually use. As you perform the steps, it'll start to make more sense.
Using Testdisk to recover a lost partitions and Files
If it finds your Ubuntu partition you will see it listed. You can identify it by it's
name
,size
, andtype
(ext4
).Select Ubuntu Partition and press
ENTER
. Then select theWrite
option to recover the partition.IF it has problems recovering the partition use the
Deeper Search
option.If after
Deeper Search
you still can't recover the whole partition, select the option to recover files. Then you can pick the important files you need to recover.If you are going to recover files you'll have to have a drive to recover the files to. Sometimes recovery takes a lot of time and expense. You might have to invest in something similar to a USB to Sata adapter and connect it to your system for recovering the files to. Depending on the amount of files, a 120G USB Pendrive may suffice for the backup medium.
You can review the details for using
Testdisk
at: TestDisk Step By Step.