Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
ls on grub rescue - unknown filesystem
Grub rescue - error: unknown filesystem

I was trying to dual boot Windows with Linux (linux installed first).

I read that it was easier to do so if windows was installed first. So I tried to install windows, by creating a partition for it.

There wasn't enough room on the drive so I tried changing the filesystem of my existing partition to support windows. Now whenever I try to start my computer I get the grub rescue screen.

I've tried booting from CD and USB with ubuntu and also with windows, but nothing happens.

I ran ls in grub rescue and got hd0, (hd0,msdos5), cd (with an install disc inserted), fd0, and fd1. However if I run ls on any of these I receive the error: unknown filesystem.

Can anyone help me out?

share|improve this question

marked as duplicate by jokerdino, Mik, devav2, belacqua, Ringtail Nov 1 '12 at 2:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Please explain exactly what you did when you "tried changing the filesystem of my existing partition to support windows."? I also do not understand what you mean when you say that you are unable to boot Ubuntu or Windows using either your optical drive or USB. If this does not work how did you ever install Ubuntu or Windows in the first place? –  irrational John May 27 '12 at 1:30
    
Your partitions are nuked. There's only a logical partition container left. Try using TestDisk to do an attempt on retrieving them back. –  Cumulus007 Jul 22 '12 at 12:48
add comment

2 Answers 2

When you changed the file-system, GRUB couldn't load into it. There's your problem right there. Your going to need to re-install it or find a way to reinitialize the partion with the right file-system without harming the files.

share|improve this answer
add comment

Well, if you have Ubuntu lying somewhere on your hard disk, you can re-install GRUB and everything will work fine. Otherwise, GRUB needs its own configuration files and stuff which are by default stored in Ubuntu. So you need to install Ubuntu.

And its not a big problem to install windows after installing Ubuntu. The only thing that will happen is your GRUB will be over written by Windows boot loader and you will directly boot into windows. So in that situation too, what you have to do is to re-install GRUB.

The following are the steps to re-install GRUB:

  1. Boot using a live CD of Ubuntu.

  2. Open a terminal and run the command

    sudo fdisk -l
    

    It lists the complete partition table of the hard disk. In there, identify which partition you have got your linux installed on. You can identify it using the drive size you had allocated for it and looking at the last column of the output which will be ‘extended’ for all of your linux partitions. The partition will most probably be something like /dev/sda5 or something. Remember this partition.

  3. Create a temporary folder in your home directory (Note: You can make the temporary folder anywhere you want. I’m using the home folder just for the sake of explanation). I’m calling it ‘temp’ for now. So that ‘temp’ folder’s path will be /home/ubuntu/temp.

  4. Mount your linux partition there. That is, assuming that you found your linux partition to be /dev/sda5, you mount that at the ‘temp’ folder by doing the following command

    sudo mount /dev/sda5 /home/ubuntu/temp
    
  5. If you want to check whether you have mounted the correct partition, go to your home folder and open temp. You will be in the ‘/’ directory. In there you will find ‘home’, in which your home folder’s name will be there. Once you’ve confirmed you have mounted the correct partition, do step 6.

  6. You have to install grub by showing the system where to read the data from the hard disk at the beginning. Don’t worry, just run the following command

    sudo grub-install --root-directory=/home/ubuntu/temp /dev/sda
    

    The /dev/sda corresponds to your hard disk name. Replace it by whatever the command sudo fdisk -l command showed you.

  7. You’re done. You may restart your system.

Hope this works for you!

share|improve this answer
    
grub-probe: error: cannot find deice for /home/ubuntu/temp (is /dev mounted?) –  Manish Sinha May 28 '12 at 16:43
    
When did you encounter that? –  harisibrahimkv May 28 '12 at 16:47
    
When running grub-install –  Manish Sinha May 29 '12 at 9:26
    
A few things to check. 1. Did you properly mount your root partition at /home/ubuntu/temp? 2. Is your hard disk's name /dev/sda itself? It could be /dev/sdb or sdc. "Fdisk -l" should tell you that. –  harisibrahimkv May 29 '12 at 10:06
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.