Thursday, 28 January 2016

Grub rescue in Ubuntu 14.04 (LTS)

My title
If you have a multi-boot machine with Ubuntu 14.04, and mistakenly you have deleted the any partition. Normally your boot loader (Grub generally) goes into rescue mode. And you can not boot your system for any other OS installed on your system.

When you boot your system you get a black screen with grub rescue command prompt like grub rescue> .

Don't worry if you get screen like this.

Just type

grub rescue > ls
output will be like this
(hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1)
then type
grub rescue > ls (hd0,msdos1)
output may be
Unknown filesystem

try above command with all partitions until you get output like 
file system is ext4 or any other valid linux file type

grub rescue > ls (hd0,msdos2) # let's assume this is the linux partition
grub rescue > set root=(hd0,msdos2)
grub rescue > set prefix=(hd0,msdos2)/boot/grub 
grub rescue > insmod normal 
grub rescue > normal

Noe you system will boot in normal grub boot mode. You will have to run these commands on every boot up until you repair or reinstall your grub boot loader.

Change image source dynamically on hyperlink

 Changing image source dynamically using JQuery. Here in this example I have created there hyperlink and stored all images in the same folde...