Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze games gaming hard drive hardware hdmi internet laptop malware memory monitor motherboard netgear network printer problem ram random registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Grub problem on cloned dual boot disk

Reply  
Thread Tools
jkoshi's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Apr 2007
Experience: Advanced
09-Apr-2007, 06:34 PM #1
Grub problem on cloned dual boot disk
Hi all,

I have a problem with the grub bootloader, as follows: I have a laptop
with an 80G disk, with Windows XP on the first half of the disk (NTFS),
and Fedora core 4 (LVM) on the rest. Dual boot is managed by grub, which
was installed with the Fedora install.

I wanted to clone this disk, so I don't lose hours of setup and install
effort on both OS's, and more hours of my work, in case of a disk crash.
So, I did the following:

1) Cloned the entire 80G disk to a 120G USB disk.
2) Restored from that clone onto a new 80G disk of the same geometry,
and replaced the existing disk with the newly cloned one.
3) On start-up, got a grub hang at "GRUB", so I did the following:
a) Boot from Fedora core 4 rescue CD
b) chroot /mnt/sysimage
c) grub-install /dev/hda
4) Now the grub hang went away, and gave me the OS selection menu, and
Windows booted fine, but selecting the Linux installation gave me
"Error 17: Cannot mount selected partition". So I did the following:
a) Boot from Fedora core 4 rescue CD
b) chroot /mnt/sysimage
c) grub-install /dev/hda
d) Enter grub -> grub<CR>
e) grub> find /grub/stage1 -> gave me (hd0,3)
f) grub> root (hd0,3)
g) grub> kernel /vmlinuz-2.6.17-1.2142_FC4 ro root=/dev/hda4
h) grub> initrd /initrd-2.6.17-1.2142_FC4.img. -> gave me:
"Error 16: Inconsistent filesystem structure".
5) Then I exited grub, repeated steps (a) and (b) above, and rebuilt the
initrd: "mkinitrd -v -f initrd-2.6.17-1.2142_FC4.img 2.6.17-1.2142_FC4",
6) Repeated from step 4(a), and got the same error at step (h).

Is this a known problem in grub, or am I doing something wrong in these
steps? Thanks in advance for a fix to this very frustrating problem.

regards,
John
saikee's Avatar
Senior Member with 3,409 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
10-Apr-2007, 12:46 PM #2
I don't think it is a problem with Grub.

The error indicated it was "Inconsistent filesystem structure".

My guess is your LVM doesn't like the step

2) Restored from that clone onto a new 80G disk of the same geometry,
and replaced the existing disk with the newly cloned one.


which could be the reason causing the trouble to the filing structure of the LVM.

I would have just used the cloned disk right away. When I got both systems working to my satisfaction I then boot up Gparted and expand my two systems to take up the extra hard disk space provided by the 120Gb disk. I don't use the LVM myself but it may need LVM own utility for expansion.

When properly cloned, say using the dd command, your 120Gb hard disk should have the same geometry as the 80Gb and there should have been no need to fiddle its geometry. At least that is my experience of cloning the 2.5" laptop hard disks.

My suggestion is go back to clone it again as it is easier and quicker that way.
jkoshi's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Apr 2007
Experience: Advanced
10-Apr-2007, 04:28 PM #3
Hi Saikee,

Thanks for your feedback.

I can boot the system with a Linux rescue CD, with the
restored disk in place, and see ALL my directories and
files when mounted. If any of the LVM file or data
structures were corrupted, this would not be possible.

Grub is complaining about the initrd image, with the
message "Error 16: Inconsistent filesystem structure".
But again, it complains even with a rebuilt initrd.

John
vtel57's Avatar
Senior Member with 803 posts.
 
Join Date: Jul 2004
Location: Tampa, Florida, USA
Experience: Intermediate to Advanced
10-Apr-2007, 05:04 PM #4
Don't know if this will help you at all, but here it is:

http://www.gnu.org/software/grub/manual/grub.html

I tend to agree with Saikee here. GRUB is not seeing what it expects to see when looking at your file system.
saikee's Avatar
Senior Member with 3,409 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
10-Apr-2007, 08:29 PM #5
Well how about putting the matter to the test

You have Grub in Fedora. Pressing the "c" key drops you into a Grub prompt. In a Grub prompt you can boot FC4 line by line manually and Grub issues a warning only on the line it cannot cope. So how about typing these lines at Grub prompt and report which line Grub refuses to work with?
Code:
root (hd0,3)
kernel /vmlinuz-2.6.17-1.2142_FC4 ro root=/dev/hda4
initrd /initrd-2.6.17-1.2142_FC4.img
boot
I think you have to remember at run time and before the kernel is booted Grub has no intelligence to read a LVM. It is the kernel and initrd that actually know how a LVM works and able to go inside to get files.

All Grub does is go to the hard disk address as indicated by "root (hd0,3)" and "root=/dev/hda4" to load the vmlinuz and initrd into the memory. At the moment it can't execute the menu.lst because it can't cope with the filing structure.

There is another possible explanation and that is Grub can only find the root partition if you specify the address in the hard disk by a "label" instead of a device name, as a standard Fedora using LVM should have root=Lablel=/123 for example. Altering root=/dev/hda4 will work only if you haven't got a LVM. Grub is known to be unable to read a LVM. If you don't believe it you can type "geometry (hd0)" at the Grub prompt to see Grub reports the LVM partition, with type No 8e, having an unknown filing system.

Also your specification of "root=" parameter in the menu.lst may not match that in the /etc/fstab and that is another cause for Grub to fail.

Lastly your root=/dev/hda4 may be incorrect. It appears your hda4 is the /boot partition. The "root=" parameter should normally point to the "/" partition.
jkoshi's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Apr 2007
Experience: Advanced
11-Apr-2007, 12:08 PM #6
Saikee,

Thanks for the follow-up. I did the following, on the laptop, with the original hard
disk in place:

1) Enter "c" at the grub OS selection menu
2) grub> root (hd0,3) -> gave me "Filesystem type unknown, partition type 0xf"

Of course, I could not proceed further.

Then I booted the system normally into FC4, and noted the console output:
==========================================================
root (hd0,2)
FIlesystem type is extfs, partition type 0x83
kernel /vmlinuz-2.6.17-1.2142_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet acpi=noirq
[Linux-bzImage, setup=0x1e00, size=0x1b659c]
initrd /initrd-2.6.17-1.2142_FC4.img
[Linux-initrd @ 0x37e51000 0x19ed3a bytes]
==========================================================

So it looks like the "root (hd0,3)" could be the problem, as you noted. I'm not yet
clear as to why the "grub> find /grub/stage1" gave me "(hd0,3)". But I'll try with
the cloned disk, with "root (hd0,2)" to see if it'll work. I'll post the result of this
after I get some time, later, to switch in the cloned disk, etc, and to test this.

By the way, I had already tried "root=/dev/VolGroup00/LogVol00", but since the
"root (hd0,3)" was probably wrong to begin with, this may not have been relevant.

John
saikee's Avatar
Senior Member with 3,409 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
11-Apr-2007, 04:33 PM #7
The partition Type 0xf or f is the extended partition created within Win95.

You must have made a mistake in recording the result from the Grub command "find /grub/stage1".

The new information indicates the /boot partition is in (hd0,2)
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:39 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.