22

Note: Before you mark it as duplicate, please read the question fully.

I've been using Ubuntu 12.04 normally, but today when I turned my laptop on, and selected Ubuntu out of two options: Windows and Ubuntu, the following screen appeared:

enter image description here

I searched this a lot on here, but couldn't find a working solution.

One solution suggested me that I should do first ls in different partitions and see where the file vmliuz or initrd resides. But I found no where these files.

I also played with the brightness of my laptop, which may be a cause of this stuck screen.

Edit 1:

I'm still unable to find the directory that contains the initrd.img file.

grub> ls 
(memdisk) (hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)
grub> set pager=1
grub> ls (memdisk)/
wubuilder.cfg
grub> ls (hd0)/
error: unknown filesystem.
grub> ls (hd0,3)/
$AttrDef $BadClus $Bitmap $Boot $Extend/ $LogFile $MFT $MFTMirr $RECYCLE.BIN/ $Secure $UpCase $Volume ./ Code School/ Downloads/ Movies/ System Volume Information/ ubuntu/ wubuilder
grub> ls (hd0, 2)/
Programming Files (x86)/ Users/ $AttrDef $BadClus $Bitmap $Boot $Extend/ $LogFile $MFT $MFTMirr $RECYCLE.BIN/ $Secure $UpCase $Volume ./ Documents and Settings/ hiberfil.sys Intel/ MSOCache/ pagefile.sys PerfLogs/ Program Files/ ProgramDAta/ Recovery/ Setup/ swsetup/ System Volume Information/ Windows/ wubildr wubildr.mbr
grub> ls (hd0, 1)/
$AttrDef $BadClus $Bitmap $Boot $Extend/ $LogFile $MFT $MFTMirr $RECYCLE.BIN/ $Secure $UpCase $Volume ./ Boot/ bootmgr BOOTSECT.BAK System Volume Information/

Edit 2:

Also, please note that I've installed Ubuntu 12.04 and Windows 7. And my Ubuntu resides at the following location; I checked it by booting up Windows OS:

grub ls (hd0,3)/ubuntu/
install/ uninstall-wubi.exe winboot/ 
1
  • Yes, I used / at the end. But my format was ls (hdx,msdosy)/, and x and y being numbers. Should I do ls /boot/ as well to see that the mentioned files exist there or not.
    – Arslan Ali
    May 1, 2015 at 11:05

2 Answers 2

17

If you have installed without Wubi.exe:

At the grub prompt try these commands:

set pager=1
ls

Now, suppose the output of ls is: (hd0) (hd0,msdos2) (hd0,msdos1), in order to find the linux root filesystem run:

ls (hd0,1)/ which should give you all the files/folders in / such as bin/ boot/ cdrom/ dev/ etc/ home/ lib/ etc.

Once this is done continue with:

set root=(hd0,1)
linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
initrd /boot/initrd.img-3.13.0-29-generic
boot

Of course replace vmlinuz-3.13.0-29-generic and initrd.img-3.13.0-29-generic with what you find in your /boot

/dev/sda1 is the location of the root system. You may have to change it if /dev/sda1 did not work.

If you have installed using Wubi.exe:

If you have installed Ubuntu using Wubi, perform following steps as given in the WubiGuide:

  1. boot into Windows, run chkdsk /r from Windows on the same drive where you installed Ubuntu, shutdown cleanly and then try to boot into Ubuntu again.

  2. if still not good, check that you have a C:\ubuntu\disks\root.disk file. If this file is missing, boot on Windows, open the Windows Explorer, set it to be able to see hidden folders, then look for a hidden folder called C:\found.000 or dir0000.chk . Move the files from found.000 to their original location inside the \ubuntu\disks directory. You may have to rename it into root.disk.

7
  • I followed your steps, but I'm unable to find /boot/ so far. I've updated my question, please review it.
    – Arslan Ali
    May 1, 2015 at 11:54
  • How did you install Ubuntu? Did you use wubi installer
    – Ron
    May 1, 2015 at 13:51
  • Yes @Ron, I installed it through wubi installer. I did it a long time ago.
    – Arslan Ali
    May 1, 2015 at 14:51
  • Oh man! It worked finally. I followed the same instructions as you wrote in your edit but form somewhere else. Could you please change the order, and move the last written instructions related to \disks\root.disk to upward - that seems right - this way it will benefit mostly, and I'm gonna accept your answer. Really thanks.
    – Arslan Ali
    May 1, 2015 at 15:34
  • Please note that the most probable cause of this problem was to force shutdown the OS.
    – Arslan Ali
    May 1, 2015 at 15:35
14

Run those commands

grub> linux  (hd0,1)/vmlinuz root=/dev/sda1
grub> initrd  (hd0,1)/initrd.img
grub> boot

Replace hd0 with your hdd number and /dev/sda1 with your partition holding the /boot mainly the dafult will work if you don't have more than one hdd and with default installtion

check this for more info

When you can boot again you should fix your problem

sudo update-grub
sudo grub-install /dev/sda
4
  • Shouldn't I use (hd0,msdos1) instead of (hd0,1)?
    – Arslan Ali
    May 1, 2015 at 11:07
  • It works either
    – Maythux
    May 1, 2015 at 11:08
  • Sorry, I'm unable to find that partition. What I'm getting is: I've updated in the question, please review it.
    – Arslan Ali
    May 1, 2015 at 11:53
  • 1
    @Maythux I did sudo update-grub but after restart, it happend again
    – Hameda169
    Mar 4, 2020 at 13:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .