Find the answer to your Linux question:
Results 1 to 8 of 8
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Installed Ubuntu after Windows XP: Grub Error 22


    I'll try to stay short and simple. I have two installations of Windows XP SP2 already on my computer. I have an IDE 80GB drive, a SATA 160GB drive and a SATA 80GB drive. They're set by the BIOS as Primary Master, Second SATA and Fourth SATA devices respectively.

    During the install of Ubuntu and from what I can see in GNOME Partition Editor they're /dev/hda (80GB IDE), /dev/sda (160GB IDE), /dev/sdb (80GB IDE). Weird, as the 160GB drive is the on the fourth sata controller, but anyway.

    So what I did is make some of the free space on the 160GB HDD unallocated, and allowed the Ubuntu installer to take it from there. Installation went fine, but after the first reboot, Grub Error 22.

    If they're any help...

    Device Map:
    Code:
    (hd0)	/dev/hda
    (hd1)	/dev/sda
    (hd2)	/dev/sdb
    menu.lst:
    Code:
    ...
    
    title		Ubuntu, kernel 2.6.20-15-generic
    root		(hd1,1)
    kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=5879351d-505b-4fe2-a24b-98dec8086991 ro quiet splash
    initrd		/boot/initrd.img-2.6.20-15-generic
    quiet
    savedefault
    
    title		Ubuntu, kernel 2.6.20-15-generic (recovery mode)
    root		(hd1,1)
    kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=5879351d-505b-4fe2-a24b-98dec8086991 ro single
    initrd		/boot/initrd.img-2.6.20-15-generic
    
    title		Ubuntu, memtest86+
    root		(hd1,1)
    kernel		/boot/memtest86+.bin
    quiet
    
    ### END DEBIAN AUTOMAGIC KERNELS LIST
    
    # This is a divider, added to separate the menu items below from the Debian
    # ones.
    title		Other operating systems:
    root
    
    
    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/hda1
    title		Windows Vista/Longhorn (loader)
    root		(hd0,0)
    savedefault
    makeactive
    chainloader	+1
    
    
    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/sdb1
    title		Microsoft Windows XP Professional
    root		(hd2,0)
    savedefault
    makeactive
    map		(hd0) (hd2)
    map		(hd2) (hd0)
    chainloader	+1
    Any ideas? Thanks for any answers beforehand.

  2. #2
    SuperMod (Back again) devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,777
    Hi and Welcome !

    Boot up from Ubuntu CD and post the output of sudo fdisk -l command.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Thanks for the welcome. Here's the output:

    Code:
    Disk /dev/hda: 80.0 GB, 80026361856 bytes
    240 heads, 63 sectors/track, 10337 cylinders
    Units = cylinders of 15120 * 512 = 7741440 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1       10337    78147688+   7  HPFS/NTFS
    
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1       18021   144753651    7  HPFS/NTFS
    /dev/sda2   *       18022       19390    10996492+  83  Linux
    /dev/sda3           19391       19457      538177+   5  Extended
    /dev/sda5           19391       19457      538146   82  Linux swap / Solaris
    
    Disk /dev/sdb: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1        9729    78148161    7  HPFS/NTFS

  4. $spacer_open
    $spacer_close
  5. #4
    SuperMod (Back again) devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,777
    Everything is correct but GRUB is not reading correct device list from BIOS. Its a GRUB/BIOS compatibility problem. In this situation, GRUB must be installed in the HD having Linux OS.

    You should re-install Ubuntu. First of all, remove GRUB from Vista Hard Disk. Check this post to re-install Vista Boot Loader.
    Unplug hda ( Vista ) and sdb ( Windows XP ) and plug-in sda ( Linux ) as Primary Disk. Re-install Ubuntu over existing Partitions. Plug-in other disks after successful installation and edit menu.lst for setup multiboot.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #5
    When you say plug it as a "Primary Disk"?

    Also, when I disconnected the other two disks, the GRUB loader was there in all its glory, but could load nothing. Error 21 on the Ubuntu installation, NTLDR missing on one Windows installation, and obviously couldn't boot the one that wasn't on a connected drive either.

    UPDATE: Did it, I'm using my fully working Ubuntu installation. I've plugged in the other two drives back and GRUB didn't complain. Quite some procedure I went through though, bad start. Hope it gets better.

  7. #6
    Now I have another problem. I re-added the listings for the Windows installations, however both give me "Invalid Boot.ini, booting c:\windows", and no matter which one I choose, it boots the same one of the two installations.

    Mind you, choosing to boot from the top one makes Windows believe they're booting from rdisk(1), while choosing to boot from the second one makes Windows believe they're booting from rdisk(2). I don't really get it, but I can't get the Windows boot menu to show. Either of the Windows listings in GRUB gives me the invalid boot.ini error.

  8. #7
    SuperMod (Back again) devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,777
    Are Windows OSes booting without GRUB? Did you check HDs separately?
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #8
    I can't really tell you what fixed the problem, but after doing something that required commenting out the UUID in fstab for /dev/sda and replacing it with "/dev/sda", the first out of two options got me to the Windows boot loader. NTLDR files were missing but I got them back into the partitions from the Windows disk, so all is well now.

Posting Permissions

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