LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help After Ghosting, Please (https://www.linuxquestions.org/questions/linux-newbie-8/help-after-ghosting-please-628787/)

tlhaz 03-17-2008 06:04 PM

Help After Ghosting, Please
 
Hello,
I've never used Linux before and I'd appreciate some help. I'm going to walk through my problem step by step and hopefully someone will have some input. I have a machine with a 30 gig Windows drive and a 120 gig Red Hat Linux 2.4 drive. The Red Hat drive was the master and the Windows the slave. I used Ghost 7.5 to copy the contents of the 120 gig drive into a new 500 gig drive. After the Ghosting was done Grub came up correctly once, but now I just get the message "Grub Loading 1.5.... Error 2". I got a Linux disk and I try to do Linux rescue but it says "Error mounting file system on hda3" and drops me to shell. If I do fdisk -l /dev/hda I get the following:
Disk /dev/hda: 500.1 GB 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225380 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 4 32098+ de Dell Utility
/dev/hda2 5 108 835380 82 Linux Swap
/dev/hda3 * 109 7590 60099165 83 Linux
/dev/hda4 7591 60801 427417357+ f Win 95 ext'd LBA
/dev/hda5 7591 8409 6578586 82 Linux swap
/dev/hda6 8410 60801 420838708+ 83 Linux

I tried to do "mount /dev/hda3" but it says
mount:
Cannot read /etc/fstab: no such file or directory

What's going on? How do I get grub back onto hda3?

jschiwal 03-17-2008 07:20 PM

Did you replace the 120 GB drive with the 500 GB drive?

Explore the drives installed using the grub shell. Changing hardware or repartitioning can cause device assignments to change in the bios. The change occurs after rebooting. What was once /dev/hda might be something else now. You may also have a boot drive select shortcut that would allow you to quickly select the drive to boot to. Grub uses (hd<disk>,<partition>) drive notation instead of /dev/hd<disk><partition> notation. Grub counts from 0 instead of one as well. A drive /dev/hda1 usually corresponds to (hd0,0); /dev/hdb1 to (hd1,0), etc.

It is possible that the kernel's view of which is the first drive differs from what grub says before booting. Even if you can boot up by entering the kernel and intrd files in the grub shell, this conflict will prevent updating with grub-install. The solution is to explicitly map grub style device names to kernel style device names by editing /boot/grub/device.map.

http://www.gnu.org/software/grub/man...evice-map.html

---

I am not certain when RHEL 2.4 came out, or did you mean that you run Red Hat with a 2.4 kernel? If you have a very old distro with an old kernel, using an old version of ext2, maybe a 500 GB partition could cause problems if 32 bit addressing is used. In short, I don't know what you meant by "Red Hat Linux 2.4".

tlhaz 03-17-2008 08:26 PM

Yes, I took the 120 gig drive out.

The full version of Linux listed on grub when the computer did work was:
Red Hat Linux 2.4.20-28.7. It probably is really old.

Where can I find instructions on exploring with the grub shell?

jschiwal 03-18-2008 03:37 AM

In the grub shell, you can enter in three lines to boot up. One line starts with the word kernel followed by the location of the kernel to load. Another line starts with the word initrd followed by the location of the intrd file. Lastly the "boot" command is given on the third line to start the boot process.

Also, most distro's will have vmlinuz & initrd symbolic links that you can use as shortcuts to the most recent kernel. So you don't even need to know that, or have to type in a long name.

The exploring part is done using TAB completion. You press the TAB key at any point to see what options you have. So if you had (hd entered and press tab, you might see (hd0 and (hd1 indicating that yo u have two disk drives. If you have "(hd0," entered, pressing tab will show you the partitions available on the drive.
If you have "(hd0,1)/" entered, pressing tabs will show you the directories available on the filesystem of the first disk, 2nd partition. You can add a directory name followed by a slash to enter the directory. Pressing TAB again will then show you the files and subdirectories in that directory.

Imagine that the first drive's first partition is the boot partition. is mounted over /boot:
kernel (hd0,0)/vmlinuz
initrd (hd0,0)/initrd

You can enter just "kernel (hd" and then hit tab. The possible hard drives will be listed.
"kernel (hd0," Now the partitions on the first drive will be listed.
"kernel (hd0,0)/" Now pressing tab will show the directories and files on this partition. Do you see either the kernel or initrd filenames

If what you are looking for isn't in this directory, just backspace, press the next partition number, such as "kernel (hd0,1)/" and see if they are in that one.

If your /boot directory isn't in it's own partition, then locate the root (/) directory and enter the /boot directory:
E.G.
"kernel (hd1,1)/[TAB]" shows directories like boot/, home/, etc/, usr/ etcetera. Enter the boot directory now:
"kernel (hd1,1)/boot/"

--

Pressing tab to complete the possible options, and backspace to back out of the wrong selection, and trying then next one allows you to locate the kernel and initrd file without even knowing your drive structures ahead of time.

--

I hope you can follow my instructions. It is one of those things that is very easy once you try it.


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