I have windows 7 and ubuntu installed on my hp pavilion. I partitioned the c: drive by shrink volume and created a simple volume in windows 7 . Then i shut down the laptop. After few minutes i started it and a black window appeared showing grub rescue>. What should i do to save both OS and all my data. Please help.
2 Answers
modifying your partition size also caused your partition ID to change. This means grub doesn't know from which partition to boot. Let's say, your /boot directory is on your 2nd partition, aka sda2, then, if your system has traditional BIOS (not UEFI):
in the grub rescue do: linux (hd0,2)/boot/linux-image-
and hit Tab for autocomlete (since I assume you don't know your kernel version) and enter, then initrd (hd0,2)/boot/initr
and again hit Tab and enter. After that enter boot
.
once booted, edit /etc/fstab as root and replace the old UUID with the correct UUID for each partition, which you get from the output of blkid
. After that run update-grub
as root.

- 422
-
Its not working. Actualy it is showing " error: no such partition grub rescue". What should i do ? What should i type ? – puneet Jul 01 '16 at 09:11
-
-
try other disk and partition numbers such as (hd0,3), (hd1,1), etc – spacelander Jul 02 '16 at 15:02
0h thank god ! The problem is solved by the following commands:- grub rescue>ls (hd0,msdos3) error: bad filename grub rescue>set boot=(hd0,msdos3) grub rescue>set prefix=(hd0,msdos3)/boot/grub grub rescue>insmod normal normal [ hit enter after each command ]. Now after this i expanded c drive by deleting partition and now its working properly.

- 1
ls -l /dev/disk/by-uuid/
– dadexix86 Jul 01 '16 at 07:09