Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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
Cannot read /etc/fstab: no such file or directory
What's going on? How do I get grub back onto hda3?
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.
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".
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:
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:
"kernel (hd1,1)/[TAB]" shows directories like boot/, home/, etc/, usr/ etcetera. Enter the boot directory now:
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.