# Solved: GRUB: Error 22



## RootbeaR (Dec 9, 2006)

Short story:
From PuppyLiveCD, where do I go to tell grub to load hda10, root partition of installed OS, instead of hda7 which I think is my music partition in NTFS? (Unless that is grub terms, then it is my home folder, ext3.)
I think I also need to tell it the home and swap partitions as well, hda8 and hda9 respectively, but I figure they'll be handy to the other.

Long story, or, the hadigot (haddygot = details of what I had, what I did and what I got):
I came up with the bright idea of deleting hda5, using PCLinuxOS, to make it available for a new distro.

It renumbered the partitions, which I am sure I have done b4 OK when I merged partitions. (Starting to think I didn't hit save to ....fstab?.....)

Fire up machine this am, GRUB: Error 22
Tried again with the same result.

So I booted up to my PCLinuxOS LiveCD and formatted hda5 in ext3 to put it back. Saved changes.

In HD terms, not grubs
Home should be hda8
Swap should be hda9
Root should be hda10

Grub now loads but, from screen:
No volume groups found
Invalidating stale software suspend images...done.
Enabling /etc/fstab swaps: swap on: /dev/hda8: invalid argument [Failed]If this is grubs hda8 then it should be my swap hda9
Checking filesystems
fsck.ext3: Bad magic number in super-block while trying to open /dev/hda7 not sure if next line was a continuation of this one or not
/dev/hda7:
The superblock could not be read or does not describea correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem ( and not swap or ufs or something else), then the superblock is corrupt, and you might tryrunning e2fsck with an alternate superblock: e2fsck -b 8193 <device> [Failed]
Error occurred during the filesystem check
Dropping you to a shell; the system will reboot when you leave the shell.
Give root password for maintenance
(or type Control -D to continue):

Ctrl D reboots with the same result

Tried numerous times to use e2fsck, but I have ext3 not ext2. Should I try e3fsck? But I personally think I just need to straighten out a couple of lines for grub.

I can get to my log-on screen for XP and grub now loads...

Ask for any more info needed.

Thank-you people
RootbeaR


----------



## RobLinux (Nov 7, 2007)

Boot Live CD.

Get the list of partitions - fdisk -l /dev/hda
Figure out where your /boot files and /etc /files are on the disk, mount the partitions needed onto temporarly mount point, like /mnt (or /tmp/root if Pupply uses /mnt). One Live CD I used, had unionfs defined for obvious mount points which confused things considerably, you can check that by listing the mounts.

Fix, whatever you did, so it may work. Repeat until you have a clean boot.

Learn about setting filesystem labels with mkfs, and the fstab entries like "LABEL=OS10.3-Usr /usr ext3 data=writeback,noacl 1 2" to prevent confusion in future.

Altering partitions on disks which are used, you might find problems unless you reboot, as the partition table is held by the kernel driver, it can be re-read but I don't think fdisk(8) forces that.


----------



## RootbeaR (Dec 9, 2006)

timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,9)/usr/share/gfxboot/themes/pclinuxos/boot/message
default 0

title linux PCLinuxOS
kernel (hd0,9)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/hda10 acpi=on resume=/dev/hda9 splash=silent vga=788
initrd (hd0,9)/boot/initrd.img

title linux-nonfb
kernel (hd0,9)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=/dev/hda10 acpi=on resume=/dev/hda9
initrd (hd0,9)/boot/initrd.img

title failsafe
kernel (hd0,9)/boot/vmlinuz BOOT_IMAGE=failsafe root=/dev/hda10 failsafe acpi=on resume=/dev/hda9
initrd (hd0,9)/boot/initrd.img

title windows XP Recovery
root (hd0,0)
makeactive
chainloader +1

title windows1 XP
root (hd0,1)
makeactive
chainloader +1

#this was added to the current menu by grubmenugen.rb
title	Dreamlinux Old DreamLinux part. The 1 I deleted
kernel	(hd0,4)/boot/vmlinuz-2.6.18.1-kanotix-1 root=/dev/hda5 ro quiet vga=791 splash=silent
initrd	(hd0,4)/boot/initrd

hda1= XPSP2 recovery partition Fat32
hda2= XPSP2 NTFS
hda5= Old DreamLinux Partition EXT3
hda6 & 7= my files and music NTFS
hda8= Home partition EXT3
hda9= Swap partition Swap
hda10= Root Partition EXT3
This is how it was b4 I screwed up and it is how I have it now as well.

If it is absolutely necessary, I can sort out hda6 & 7, otherwise there is no confusion as to what is where. hda10 or hd0,9 is PCLinuxOS, the only installed Linux distro at the moment. (My confusion was forgetting grub is hd0, I was thinking hda).


----------



## RobLinux (Nov 7, 2007)

And the fdisk -l output? You removed a partition, and when it boots you're getting into the file system maintenance single user mode. The devices are off by one. so it looks like the /etc/fstab file and the partition table are out of agreement.

I had this boxes partition table over-written last week, but I recovered everything thanks to gpart(8) and sfdisk(8) which lets you specifies things down to sector level.

BTW Rather than deleting partitions, simply using mkfs to re-initialise them suffices, which the next installer would do for you anyway.


----------



## RootbeaR (Dec 9, 2006)

I put my experience level at beginner for a reason, and that was when I was using MS XP.
Compare me to the guy who can drive a vehicle pretty good but hasn't a clue as to how to change oil, tire...I can use a few programs, to an extent, and that is it.

I just had another look at my hd architecture and think I may have found the problem.

hda10 is my root, yet mount point says /mnt/hda10, I believe mount point should be "/"

Except when I try to change it I get:

Directory / already contains data
(.autofsck, swap, mnt, var, usr, ...)
You can either choose to move the files into the partition that will be mounted there or leave them where they are (which results in hiding them by the contents of the mounted partition)

I'm not clear on these two options and which one I should take.
"Move the files into the partition that will be mounted there" I thought it said that that is where they are from?


----------



## RobLinux (Nov 7, 2007)

You *must* work with Live CD, so you can fsck/mount/umount root disk partition on disk installation with a "memory" copy of the OS, which won't be interfered with by the changes you make.

fsck /dev/hda10
mkdir /tmp/root
mount /dev/hda10 /tmp/root

So you mount /dev/hda10 onto /tmp/root, then you hack /tmp/root/etc/fstab to have /dev/hda10 be /. Prepare everything how it should be on hard disk boot.

If you had had to re-install an rpm (say an old version of kernel to boot after a bad upgrade) then the --root option of rpm comes in handy, it'll alter the root to your disk root mount point, and put the software onto the disk, just like an OS installer.


----------



## RootbeaR (Dec 9, 2006)

Thanks for the help RobLinux.
This just isn't the time for me to try to understand this OS,or any other.
I am just going to re-install.
Back in about 15 minutes, need to log out and install.


----------



## RootbeaR (Dec 9, 2006)

Installed.
I can do that faster than I can type ten words.


----------



## RootbeaR (Dec 9, 2006)

What is the best way to Link my old home partition to this new install?
Shortcut on desktop?


----------



## RootbeaR (Dec 9, 2006)

I am going to update OS and all installed software now, in case anyone is interested in the time it takes, I'll post back when done.


----------



## RobLinux (Nov 7, 2007)

Have it mounted via an entry in /etc/fstab
A link as you suggest into it is fine.


----------



## RootbeaR (Dec 9, 2006)

Perfect.
Thank-you
All done updating


----------



## RootbeaR (Dec 9, 2006)

I have heard people say that they can re-install MS this fast or faster.
I took two hours to get online with a brand new computer, Vista _already installed_.
So if someone cares to explain the cost and time to do this with MS?
$ invested in software?
Time? Assume six months since I last did this. With MS, that is at least 6 new images to create (updates). How long does it take to make an image?

My time line is in the posts.
That is including logging in and out of TSG and yahoo.


----------

