LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-14-2009, 11:45 PM   #1
Radikll
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Rep: Reputation: 0
Question Grub error 22


Hi, I'm not new to linux, but I'm having a problem with grub. I'm trying to setup a multi-boot between Ubuntu, Windows 7, and 6 other operating systems I haven't installed yet. I'm using an old version of Kanotix. I used System rescue 1.1.6 to set up the boot drive.

I'm trying to make sdb12 my boot partition. It boots into grub, but when I try to boot from any of the options on the menu it gives me grub error 22. It's kinda weired, I think my bios boot order effects the hard number. I have an old IDE drive, it had openSolaris on it. I think openSolaris wanted to be free because the boot order keeps changing so the IDE drive boots 1st. I reformated the old 20gb drive because it was getting annoying.

This is what I did to set up sdb12.

1) formated 1024kb to Ext3

2) copied /boot/grub from ubuntu to /mnt/sdb12

3) changed the menu.lst file in /mnt/sdb12/grub

4) used the following commands:

Code:
grub
grub> root (hd1,11)
grub> setup (hd1,11)
Here's the partition info:
Code:
Kanotix:/# fdisk -l

Disk /dev/sda: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       68368   549165928+   5  Extended
/dev/sda2           68369       77968    77112000    7  HPFS/NTFS
/dev/sda3           77969      182401   838858072+  83  Linux
/dev/sda5            1176       10774    77103936   83  Linux
/dev/sda6           10775       20373    77103936   83  Linux
/dev/sda7           20374       29972    77103936   83  Linux
/dev/sda8           29973       39571    77103936   83  Linux
/dev/sda9           39572       49170    77103936   83  Linux
/dev/sda10          49171       58769    77103936   83  Linux
/dev/sda11          58770       68368    77103936   83  Linux
/dev/sda12  *           1         131     1052163   83  Linux
/dev/sda13            132        1175     8385898+  82  Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdb: 20.0 GB, 20000000000 bytes
255 heads, 63 sectors/track, 2431 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb4   *           1           1           0    0  Empty
Partition 4 does not end on cylinder boundary.
Here's the menu.lst file from grub:
Code:
title		Ubuntu jaunty 9.04 (beth)
root	(hd1,5)
chainloader	+1

title		Winblows 7
root	(hd1,1)
chainloader	+1

title		UNUSED
root

title           sdb5
rootnoverify    (hd1,4)
savedefault
makeactive
chainloader     +1

title           sdb7
rootnoverify    (hd1,6)
savedefault
makeactive
chainloader     +1

title           sdb8
rootnoverify    (hd1,7)
savedefault
makeactive
chainloader     +1

title           sdb9
rootnoverify    (hd1,8)
savedefault
makeactive
chainloader     +1

title           sdb10
rootnoverify    (hd1,9)
savedefault
makeactive
chainloader     +1

title           sdb11
rootnoverify    (hd1,10)
savedefault
makeactive
chainloader     +1
 
Old 04-15-2009, 05:23 PM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
It appears you installed grub to the MBR of the 20GB drive, which is the second drive /dev/sdb. This must also be the drive set to boot first in the bios. In grub language this is (hd1).
All your operating system partitions are on the first drive /dev/sda, or (hd0).
Change the root to (hd0,x) in all entries. Although it is not imperative, you may also want to change the title to reflect the same, ex: sda8 instead of sdb8.

According to the grub manual, error 22 is produced when the partition does not exist.
 
Old 04-15-2009, 05:27 PM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
I take it you created an extended partition first, then Windows 7 (/dev/sda2) and one Linux (/dev/sda3) are in primary partitions.

Keep in mind, the first partition is the fastest partition due to zoned bit recording. If you use swap allot due to small amount of RAM memory, then it is good to have it near the beginning of the drive as you now have it. But for performance reasons, you may want to consider putting your favorite, most used OS towards the beginning also. If it is Linux, use /dev/sda5 for your fave.

EDIT:
Take a look at "The mother of all booting schemes - Grub in a data-only partition" in this thread for setting up the grub partition.

Last edited by Junior Hacker; 04-15-2009 at 05:49 PM. Reason: Added a/some notes
 
Old 04-16-2009, 03:26 AM   #4
Radikll
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I fixed error 22 and I can now boot into Windows 7, but I still can't boot into Ubuntu. I get error 13 now.

Code:
Error 13: Invalid or unsupported executable format
I'm not really sure what it means, but at least I can boot into windows. It only happens when I try to boot into Ubuntu or one of the blank drives.

ps
I formatted my drive with gparted; for some reason it messed up the partition names.

This is how it's really organized (according to Gparted):
Code:
/dev/sda1               1       68368   549165928+   5  Extended
/dev/sda12  *           1         131     1052163   83  Linux
/dev/sda13            132        1175     8385898+  82  Linux swap / Solaris
/dev/sda5            1176       10774    77103936   83  Linux
/dev/sda6           10775       20373    77103936   83  Linux
/dev/sda7           20374       29972    77103936   83  Linux
/dev/sda8           29973       39571    77103936   83  Linux
/dev/sda9           39572       49170    77103936   83  Linux
/dev/sda10          49171       58769    77103936   83  Linux
/dev/sda11          58770       68368    77103936   83  Linux
/dev/sda2           68369       77968    77112000    7  HPFS/NTFS
/dev/sda3           77969      182401   838858072+  83  Linux
Windows deleted all my partitions (except swap) when I tried to put it in my extended partition. So, I had to give it's own primary partition. The sda3 is going to be my main storage drive once I can figure out how to encrypt it. Right now sda3 is formatted in Ext4, but I think I'm going to use truecrypt to format it to encrypted Ext2, Ext3, or NTFS(maybe). I plan on using symlinks to link directories in sda3 to directories in my /home.
If you guys know of any other encryption programs that will work on Windows and Linux, tell me.
 
Old 04-16-2009, 01:03 PM   #5
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,617

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
You are booting from /dev/sda12 [in grub this will be (hd0,11).

Boot to a LiveCD and pull up the terminal and as root;
Code:
sudo (or whatever to get root status)grub
grub find /boot/grub/stage1
this will give you a list of where there is a grub boot. From your info above it should be;
Code:
(hd0,2)
(hd0,4)
(hd0,5)
(hd0,6)
(hd0,7)
(hd0,8)
(hd0,9)
(hd0,10)
(hd0,11)
seeing how you want to be able to get to sda3 - pick (hd0,2) for;
Code:
grub root (hd0,2)
grub setup (hd0)
grub quit
If this lets you boot to there you can edit (with gedit, kate, krite, vi, vim - some text editer) your /boot/grub/menu.lst to have all the others listed.

Usually the last OS that you install has that menu.lst to include all OSs. You could just try installing some more and seeing what happens. If you have problems try the grub stuff above using the partition for the last installed for root and setup. Should work.

HAVE FUN
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
install kubuntu 8.10 with lilo rather than grub (because of grub error 18) dukeinlondon Ubuntu 7 12-27-2008 07:53 PM
Loading Grub 1.5 Please Wait...... Grub Failed Error 18 2words4uready Linux - Newbie 5 06-12-2008 06:37 PM
Grub error 17, and wont reinstall using grub-install! chiefreborn Linux - General 6 06-06-2007 11:29 AM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 09:33 AM


All times are GMT -5. The time now is 08:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration