Glam Prestige Journal

Bright entertainment trends with youth appeal.

I replaced my old laptop drive which was win7 and ubuntu dual boot with an SSD.

Now I connected the old drive through a USB adapter and I want to boot from it.

But this comes up:

unknown filesystem
grub rescue>

As i need the programs from old drive I have to boot from it time to time and I don't want to install those software on the new drive. It takes so time to exchange the drives so I want to boot from USB.

how can I fix this?

10

4 Answers

The most expedient way would be, I think, to... copy the old drive onto the SSD. Virtualization also might be a way, converting the USB disk to a "raw" image and running it full screen (it works well with USB3).

Otherwise, you have to boot from grub. You can add a menu entry for that, if you can do it at all.

Polyshell's problem

To test the following, I installed a Windows 7 Home Premium (I hadn't any other license available, alas) as single operating system.

Then (from Windows 7) I shrank the partition to free enough space for Fedora 18.

At that point I booted from the Fedora 18 DVD (Desktop, Xfce), and installed to the hard disk. The installer found "plenty of space to install Fedora!", I used the automatic partitioning, and defaulted to dual boot.

Both systems did boot correctly.

At that point, I deleted the F18 partition (from Windows), and formatted the free space.

Upon reboot, I got:

GRUB loading.
Welcome to GRUB!
error: unknown filesystem.
Entering rescue mode...
grub rescue> _

Running

ls

found three Windows partitions (the first one was created by Windows 7 and is a 100Mb service partition of some kind. Don't know if boot should be msdos1 or msdos2; the one I created is now msdos3).

(hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (fd0)

So, the Linux partition where the necessary GRUB2 code resides is lost. And Grub2 apparently can not do "blind boot" (i.e. chainload to the bootloader on an existing partition at sector level). So now we need the original GRUB2 files to be able to do anything; which means, we need another GRUB2 installation.

So from another computer, we download this tool, which is in fact a GRUB2 recovery installation: (it is a 12 Mb ISO) and put it onto a bootable USB, or burn onto a CD.

And we boot from it. The menu comes up, we go to "Detect Any Operating System"; it should see the Windows partition and be able to boot into it.

Unfortunately the full Windows OS would also lock the system disk and prevent its modification, so we need to boot into Windows and immediately press F8 to enter maintenance mode with disk unlocked.

A quicker way at this point, of course, would be to still have the original Windows DVD, or get a friend to burn a Windows Recovery CD, boot from it instead of the Grub2 recovery CD, and follow these steps (for Windows 8, there's Automatic Repair).

Once at the Windows 7 boot menu, the first menu item ("Boot Repair", I think - my installation wasn't English) automatically looked for whatever might prevent Windows from booting ("No data or documents will be lost", it said). I was then also offered the option to perform a System Restore, which I declined: the system is fine, it is the boot loader that has to be recovered, and that is not even in the System Restore.

After some minutes, the Boot Repair option failed miserably (hope that Windows 8 gets better).

So I booted again into graphics mode and googled for bootsect.exe (the first two links tried to make me download spyware - the good file was around 95 Kb), downloaded it to the disk, rebooted again with F8 into Recovery Tools, and after opening a Command Prompt I located the BOOTSECT.EXE binary I had downloaded. So I ran

BOOTSECT /nt60 SYS /mbr

and then rebooted (after removing the recovery CD).

The system entered the Windows 7 original GUI without problems (except a lengthy wait at the beginning with lots of disk activity, while CHKDSK was being silently run, I guess)

Booting from USB

This is not guaranteed to work, because it depends on how the USB device is "seen" at GRUB boot time. Being able to boot from USB from the BIOS prompt may not be enough.

At the very least, the grub loader will have to be modified, because when the USB disk was hd0, it "saw" itself as hd0. Now it still does, but hd0 is now another disk, so grub's looking for things in the wrong place.

The above commands might yet work, except that now it is not hd0 but hd1, 2... et cetera. Not guaranteed at all, though. But you might get lucky.

root (hd2,1)
chainloader +1
boot

Depending on what's on the SSD, you might need a much more complicated setup, swapping the disks at the BIOS level (hardware EFI support required) and maybe even hiding the SSD itself.

As a first attempt I'd try locating the image on the USB mount point and boot the image from there, hoping that USB is seen as hd2:

root (hd2,1)
find / <-- press "Tab"
kernel <path to kernel>
initrd <path to initrd>
boot 

You can find a small tutorial for the above here.

5

1st you can try to :

grub rescue> ls
(hd0) (hd0,1)
grub rescue> insmod ext2
grub rescue> insmod msdos
error: unknown filesystem.

then you have to investigate

--

first to boot into Ubuntu from iso.

1.Locate the Ubuntu partition and the folder containing the Grub modules.

The Grub folder containing the modules must be located so the correct modules can be loaded. This folder would have been created during the initial installation of Ubuntu and should be located in the Ubuntu partition. This folder would normally be located at either (hdX,Y)/boot/grub or (hdX,Y)/usr/lib/grub/i386-pc Find your existing Ubuntu partition and the module folder.

ls # List the known drives (hdX) and partitions (hdX,Y)
ls (hdX,Y)/ # List the contents of the partition's root
ls (hdX,Y)/boot/grub # Normal location of the Grub 2 modules.
ls (hdX,Y)/usr/lib/grub/i386-pc # Alternate location of the Grub 2 modules.
  • ls - should return all known drives (hdX) and partitions (hdX,Y)
  • ls (hdX,Y)/ - should show the contents of the root directory of the partition.
  • If you get an "error: unknown filesystem" this is not your Ubuntu partition.
  • If this is the Ubuntu partition, you will see the Ubuntu folders, including lost+found/, home/, boot/ and vmlinuz and initrd.img. Use this address as the first part of the next command.
  • ls (hdX,Y)/boot/grub - should display several dozen *.mod files. This is the folder you are looking for.
  • If you don't find the modules, try the alternate location: ls (hdX,Y)/usr/lib/grub/i386-pc

2.Load the modules.

set prefix=(hdX,Y)/<path to modules>
  • This command must correctly point to the folder containing the Grub modules. The address should be the one in the previous section which displayed the modules.

Examples:

set prefix=(hd0,5)/boot/grub
set prefix=(hd1,1)/usr/lib/grub/i386-pc
  • Load modules:

    insmod linux insmod loopback insmod iso9660 insmod fat # If ISO is located on fat16 or fat32 formatted partition. insmod ntfs # If ISO is located on an NTFS formatted partition. insmod nftscomp # If NTFS compression is used on the partition. Load if you aren't sure.

  • A "file not found" error means that the path in the prefix is incorrect or the specific module does not exist. The prefix setting may be reviewed with the set command. Rerun the "set prefix=" command with the proper path.

3.Locate the Ubuntu ISO file.

  • Using the combinations of ls commands, locate the Ubuntu ISO image.

4.Create the loopback device. loopback loop (hdX,Y)//

  • Example:

    loopback loop (hd1,1)/path/to/ubuntu-10.04.1-desktop-i386.iso

5.Load the Linux kernel and initrd image.

set root=(loop)
linux /casper/vmlinuz boot=casper iso-scan/filename=/<ISO-name.iso> noprompt noeject
initrd /casper/initrd.lz
  • If the path to the ISO or filename is not correct, the boot will halt at the BusyBox screen and produce a message stating "can't open /dev/sr0: No medium found".
  • Note: If the ISO file is not in the / folder, include the path in the iso-scan/filename= entry. See second example.

  • Examples:

    linux /casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-10.04.1-desktop-i386.iso
    linux /casper/vmlinuz boot=casper iso-scan/filename=/my-iso/ubuntu-10.04.1-desktop-i386.iso

6.Boot.

  • That should be it. If the commands ran without any messages/errors, the commands were accepted as entered. It's now time to boot:

boot

further info here

Now do this after booting ::

here is post with same problem and is solved as below,

1.sudo mount /dev/sdaX /mnt

here sdaX is your boot partition. you can get list with sudo blkid like this,

/dev/sda1: LABEL="Windows XP" UUID="96A4390DA438F0FB" TYPE="ntfs"
/dev/sda3: LABEL="Ubuntu 11.04" UUID="b61fcae3-7744-45b4-95b9-7528d50a3652" TYPE="ext4"
/dev/sda5: LABEL="Se7en" UUID="A2DC9D71DC9D4109" TYPE="ntfs"
/dev/sda6: LABEL="Development" UUID="DEB455A1B4557CC9" TYPE="ntfs"
/dev/sda7: LABEL="EXTRA" UUID="D8A04109A040F014" TYPE="ntfs"
/dev/sda8: LABEL="SONG" UUID="46080FCD080FBAC7" TYPE="ntfs"
/dev/sda9: LABEL="BACKUPS" UUID="766E-BC99" TYPE="vfat" 

note: sdaX must be linux partition.

2.sudo grub-install --boot-directory=/mnt/boot /dev/sda

3.sudo update-grub

You can use Ubuntu and Lilo to restore the MBR on that drive. I wrote a tutorial on how to do this at thenewtech.tv

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy