Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
hello, I have XP and Ubuntu on a laptop. I just bought an external drive. I installed Ubuntu on it so I can boot on other computer with Ubuntu. The ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Location
    Angers, France
    Posts
    91

    Error 21 with Grub


    hello,
    I have XP and Ubuntu on a laptop. I just bought an external drive. I installed Ubuntu on it so I can boot on other computer with Ubuntu.
    The problem:
    I installed Ubuntu on the external drive. When I disconnect it from the computer and start the computer it gives me ERROR 21, something with the GRUB. It most probably has something to do with the installation on the External Drive. when I plug in the External drive, it is all fine.
    What can I do so it works without the external drive plug in???

    Thanks.

    Emmanuel

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    It sounds like you have installed grub to the MBR or your internal hard drive during the Ubuntu install to the external hard drive. Plug in the external hard drive and post the output of
    Code:
    sudo fdisk -l

  3. #3
    Just Joined!
    Join Date
    Apr 2008
    Location
    Angers, France
    Posts
    91
    Thanks. Here is the report

    Disk /dev/sda: 40.0 GB, 40007761920 bytes
    255 heads, 63 sectors/track, 4864 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xf2cff2cf

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 1188 9542578+ 7 HPFS/NTFS
    /dev/sda2 1189 4864 29527470 f W95 Ext'd (LBA)
    /dev/sda5 1189 3426 17976703+ 7 HPFS/NTFS
    /dev/sda6 3427 3548 979933+ 82 Linux swap / Solaris
    /dev/sda7 3549 3913 2931831 83 Linux
    /dev/sda8 3914 4864 7638876 83 Linux

    Disk /dev/sdb: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0008ba5b

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 365 2931831 83 Linux
    /dev/sdb2 366 9729 75216330 f W95 Ext'd (LBA)
    /dev/sdb5 1276 9729 67906723+ 7 HPFS/NTFS
    /dev/sdb6 366 535 1365462 82 Linux swap / Solaris
    /dev/sdb7 536 1275 5944018+ 83 Linux

    The external drive is the one with 80Go

    Manu

  4. #4
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    Not sure if linux boot/root is located on sda7 or sda8, assuming its sda7 then type
    Code:
    sudo grub
    root (hd0,6)
    setup (hd0)
    quit
    this should install grub correctly for the internal hard drive again. Try shutdown and restart system without external drive connected.

    Let us know if that works.

    Ed: if that does not work assume it is sda8 so replace (hd0,6) with (hd0,7) in above.

  5. #5
    Just Joined!
    Join Date
    Apr 2008
    Location
    Angers, France
    Posts
    91
    Thanks.
    I did the above and I disconnected the external Hard Disk. I then started the system. I had the option to start on Ubuntu and XP as usual. Then I enter for Ubuntu but nothing and it said "ERROR 17". I then put the External Hard Drive again but it is not recognize and no option coming up to start on the OS from the External Drive.
    I then put the installation disk for Ubuntu to try to repair or start on Ubuntu from the Computer hard drive. same thing Error 17. I plugged in the External Hard drive but nothing showing up.
    I managed to start on XP. I can then access the External Hard Drive as there is a partition on NTFS.
    So I will try again with the CDs and try to fix something but otherwise what shall I do as I can't access Ubuntu and can't go back to the Terminal to do the other actions as you mentioned.

    Thanks
    Emmanuel

  6. #6
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    Boot from the live cd again, open a terminal and type
    Code:
    sudo -s
    grub
    find /boot/grub/menu.lst
    then post output here. When you have finished in grub type
    Code:
    quit
    to exit grub then
    Code:
    exit
    to return to normal user access.

  7. #7
    Just Joined!
    Join Date
    Apr 2008
    Location
    Angers, France
    Posts
    91
    grub> find /boot/grub/menu.lst
    (hd0,6)
    (hd1,0)

    grub>

    Hello
    above is the output

    manu

  8. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    How many Linux OSes you have installed? Both internal and External disks have Linux partitions.

    XP is not booting without External disk because installer has installed GRUB in MBR of Internal disk but conf files of GRUB are in External disk.
    I would suggest you to remove GRUB from MBR of Internal disk and re-install it in MBR of External disk.
    Or
    Create a 102MB /boot partition in Internal disk and keep GRUB in MBR of internal disk.

    Does your machine's BIOS support booting up from External Device?
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #9
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    Quote Originally Posted by emanjamin2002 View Post
    grub> find /boot/grub/menu.lst
    (hd0,6)
    (hd1,0)

    grub>

    Hello
    above is the output

    manu
    From the output you should be able to run
    Code:
    sudo -s
    grub
    root (hd0,6)
    setup (hd0)
    root (hd1,0)
    setup (hd1)
    quit
    This will install grub to the MBR of each drive and should allow you to boot from either hard drive. After you have run the above commands do you get a grub menu when you reboot the system?

  10. #10
    Just Joined!
    Join Date
    Apr 2008
    Location
    Angers, France
    Posts
    91
    Thanks. I will follow the instruction from Jonathan as I have been working with him so far. And I don't really understand what I have to do with 102 MB. yes I can start from both. It is recognized from the BIOS.
    Thanks for your help.

    Manu

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •