LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 11-05-2009, 08:18 PM   #1
rip
Member
 
Registered: Apr 2003
Location: Ohio
Distribution: PCLinuxOS
Posts: 93

Rep: Reputation: 15
cannot get past grub error 22


I distro-hop frequently and must have done something wrong during a recent install. I now get a grub error which stops the boot process with "error 22". The only way I can get booted up is to use systemrescuecd to boot then use the 'DISK1" boot option.

I have tried to wipe the drove totally clean using gparted, ranish, fdisk, cfdisk, and whatever repartitioning apps on various distro install disks. Nothing fixed what I believe is a MBR problem. I loaded Sidux, Mint, PCLinuxos, Puppy, Mepis, etc, and every time the same grub error 22 happens. And I have tried running grub-install on most of these installs.

I searched these forums for similar problems. Most posts are about repairing boot problems with disks having windows and Linux partitions. My system has never had a windows partition.

Is it possible that I have a problem with the hard drive, or am I overlooking something? Over the past year or three I have loaded probably 15 distros without a hitch.

this is starting to really frustrate me. Any suggestions?
 
Old 11-05-2009, 09:44 PM   #2
aus9
Senior Member
 
Registered: Oct 2003
Location: Australia
Posts: 4,258

Rep: Reputation: Disabled
hi

what is current distro that is installed?

mbr needs to link to files in a distro that have not been deleted.

are such files still in existance?

2) boot up any good live cd...you mention sidux first so that will do

Code:
su
root (hdx,y)
setup (hd0)
quit
where hdx,y is grub legacy speak for boot partition for current distro that you want to keep..pretend it Mepis...eg hd0,0

so where is Mepis?

IN LIVE cd mode

pls show the output of

fdisk /dev/sda
fdisk /dev/sdb or other drives as needed
 
Old 11-06-2009, 09:08 AM   #3
rip
Member
 
Registered: Apr 2003
Location: Ohio
Distribution: PCLinuxOS
Posts: 93

Original Poster
Rep: Reputation: 15
Ok, I currently am running PCLOS v2009.1 . It was installed yesterday to try to further isolate the problem. It didn't change anything. I allowed the installer to use the entire drive (/dev/hda) and put grub onto the MBR.


Here's the fdisk output:
(running now in Sidux LiveCD mode)

Code:
root@sidux:~# fdisk /dev/sda

The number of cylinders for this disk is set to 59582.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 30.8 GB, 30750031872 bytes
16 heads, 63 sectors/track, 59582 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x000d522a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       16253     8191480+  83  Linux
/dev/sda2           16254       59582    21837816    5  Extended
/dev/sda5           16254       24379     4095472+  82  Linux swap / Solaris
/dev/sda6           24380       59582    17742280+  83  Linux
I have a 2nd HD hooked up, but I only use it for data that I like to keep from install to install (distro-hopping junkie that I am.)
Here's the fdisk for that:

Code:
root@sidux:~# fdisk /dev/sdb

The number of cylinders for this disk is set to 9964.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00074b26

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        9964    80035798+   7  HPFS/NTFS

Command (m for help):
And here's the grub command output you wanted:
Code:
grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  17 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... succ
eeded
Done.

grub>quit
It all looks ok to me but after staring at it through all the installs I tried maybe there's something obvious I am missing.
 
Old 11-06-2009, 09:39 AM   #4
rip
Member
 
Registered: Apr 2003
Location: Ohio
Distribution: PCLinuxOS
Posts: 93

Original Poster
Rep: Reputation: 15
FWIW, I just rebooted after taking the steps I just posted and received the same "Error 22".

Is it possible that the MBR is messed up somehow and needs to be redone? I am not concerned about preserving the installation, I'm just getting tired of having to boot from a CD every time.

I have seen a situation in the past where an older HD lost it's 'disklabel' and I could not rewrite it, even after trying some low-level utilities whose names elude me now. And the drive I am trying to use now is an older 30gb drive, so if it is screwed up it is not a big deal. I'm just doing this out of curiousity more than necessity.

Last edited by rip; 11-06-2009 at 09:40 AM.
 
Old 11-06-2009, 10:08 AM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 3,664

Rep: Reputation: 204Reputation: 204Reputation: 204
Could you post a copy of your GRUB configuration file? AFAIK "Error 22" is "Partition not found" and usually related to an incorrect root (hd0,?) value.

When you get the error, do you get a GRUB> prompt? Can to try a root (hd<tab> to see which hard drives are available for GRUB? (The tab-completion feature of the GRUB editor is quite hand for investigating what GRUB actually sees.)

Consider unplugging the cable to you secondary HD. Perhaps you BIOS has decided that the secondary drive should be your boot drive. (A change in the boot order can cause GRUB to fail. That's one reason that GRUB2 added the uuid directive to the new command set.)
 
Old 11-06-2009, 10:25 AM   #6
luck.anshu
LQ Newbie
 
Registered: Jan 2009
Location: India
Posts: 11

Rep: Reputation: 0
Quote:
Originally Posted by PTrenholme View Post
Could you post a copy of your GRUB configuration file? AFAIK "Error 22" is "Partition not found" and usually related to an incorrect root (hd0,?) value.

When you get the error, do you get a GRUB> prompt? Can to try a root (hd<tab> to see which hard drives are available for GRUB? (The tab-completion feature of the GRUB editor is quite hand for investigating what GRUB actually sees.)

Consider unplugging the cable to you secondary HD. Perhaps you BIOS has decided that the secondary drive should be your boot drive. (A change in the boot order can cause GRUB to fail. That's one reason that GRUB2 added the uuid directive to the new command set.)

Try this:

grub-install --root-directory=/boot/grub/ /dev/sda1
 
Old 11-06-2009, 12:47 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 3,664

Rep: Reputation: 204Reputation: 204Reputation: 204
Quote:
Originally Posted by luck.anshu View Post
Try this:

grub-install --root-directory=/boot/grub/ /dev/sda1
Did you read his second post? In the last block, he showed us that he did the grub-install by hand, to no avail.

And why did you quote my post in your reply?
 
Old 11-06-2009, 05:32 PM   #8
rip
Member
 
Registered: Apr 2003
Location: Ohio
Distribution: PCLinuxOS
Posts: 93

Original Poster
Rep: Reputation: 15
Solved, thanks to PTrenholme's suggestion to unplug the 2nd HD ! Booted right up after I did that. Thinking that maybe I had one of the 2 HDs jumpered wrong, I pulled the disks out. They were both jumpered ok. Then I swapped the drives position on the cable to put the primary at the end connector (I do not use CS jumpering), but that didn't help. So I pulled the power on secondary, worked fine after that. I might add that this pairing of drives (and vidcard, etc) was new as I rebuild this PC from spare parts taken from 2 other PCs last month. Darn thing never acted right after that. Hmm...

And thanks to the other replies posted, they made me refresh myself on troubleshooting boot problems.

Looks like I need to try grub2 if I want to put the 2nd HD back towork.
 
Old 11-07-2009, 09:45 AM   #9
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 3,664

Rep: Reputation: 204Reputation: 204Reputation: 204
CAUTION: Unless the newer drives are different, pulling the power plug on a drive while leaving the drive connected to the drive cable can blow the drive or your mother board. That's because there may exist a live current path through the drive cable that would not be taken if the power plug is connected.

(Note that my "knowledge" may be outdated - I learned it at least 20 years ago when a m/b was quite expensive - but it's a simple thing to do, and can't do any harm.)
 
Old 11-07-2009, 02:15 PM   #10
rip
Member
 
Registered: Apr 2003
Location: Ohio
Distribution: PCLinuxOS
Posts: 93

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by PTrenholme View Post
CAUTION: Unless the newer drives are different, pulling the power plug on a drive while leaving the drive connected to the drive cable can blow the drive or your mother board. That's because there may exist a live current path through the drive cable that would not be taken if the power plug is connected.
I assume that drive cable = data cable.

Not a problem, the data cable was also disconnected. My poor choice of words made it sound like I just yanked out the power connector and nothing else.

But in the past I have left a drive connected by only the data cable several times, and nothing bad ever happened.



But I won't do it again...
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
grub error 17 cannot mount selected partition (past posts checked still deosn't work) jieyunfu Linux - General 1 05-06-2008 01:14 AM
Can't get past grub> TAS Red Hat 3 01-29-2007 08:37 PM
Error 21 from GRUB bootloader, can't get past BIOS Load snowake Linux - Newbie 7 10-19-2006 08:27 PM
Installed But Won't get past GRUB dfego Slackware - Installation 11 07-04-2006 09:45 PM
GRUB won't past Stage 2~ "Error 2" ~ FC3+XP stevie_velvet Fedora 4 03-29-2005 07:58 AM


All times are GMT -5. The time now is 10:10 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration