Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
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.
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.
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.)
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.)
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.
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.)
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.