Additional Information for the RHCE Exam / What can go wrong with GRUB
Subtitles of the Movie
Perhaps the most problematic issue associated with the boot process comes from the GRUB boot loader. When you install GRUB, it installs a pointer from the master boot record to the GRUB dot conf configuration file, and that's based on the GRUB install command, which you may need to use in rescue mode if that pointer ever goes missing. Conceivably the GRUB configuration file itself could go missing, and yeah, you could also have typos, syntax errors and so on. If the GRUB configuration file ever goes missing and you try booting you get to a GRUB command line. You can also get to that command line by typing Ôc' from a regular GRUB menu. We can learn GRUB from the command line, courtesy of command completion. We can identify the location of the boot directory, identify the file names associated with the kernel and initial RAM disk, and configure the top level root directory. We could do this all from the GRUB prompt. Now, try to remember if you've ever seen a GRUB stanza, you might remember that the first line in such a stanza is a titled something or another, like red hat enterprise linux with some kernel version number. But that doesn't matter. You don't want the comments. You're identifying those directives that actually identify what we need. The first real directive is the root directive. But that could be confusing, because the root directive actually identifies the location, specifically the partition with the boot directory, it's not related to the top level root directory, or the root user. When I type root hd zero comma zero, I'm trying to see what's on the first partition of the first hard drive. And that looks promising, even though that says extended 2, that's the message I get when something's formatted to the extended 3 file system. The partition type is 83, and if you understand fdisk, you'll recognize that partition type as a Linux partition type. In another video we've told you that the boot partition is not installed on a logical volume, so that's right. The root directive could point to other locations. That would point to the first partition of the second hard drive, and nothing's there. Well, type 8e is there, which corresponds to a logical volume. That would point to the second partition on the second hard drive, which is another logical volume partition. We could point to the second partition of the first hard drive, another logical volume partition. See a pattern here? Let's return to the most likely option, the first partition of the first hard drive. And don't let these numbers confuse you. This is a place where zero means one, one means two, two means three. I know that sounds weird, and in technical terms that's known as cardinal numbering. Okay. We've identified the boot directory, and we'll confirm that in a moment. Now that we've identified the partition with the boot directory, we will search for the kernel and initial RAM disk files. Let's search for the kernel file. With the kernel directive the forward slash goes to the top level of the boot directory assuming it has our kernel. And that's a whole bunch of files, but if you know the boot directory, you'll recognize vmlinuz, v-m-l-i-n-u-zed, as the name Red Hat uses for the compressed kernel, which is what you want to load. I pick one specific version number, and I want to pick the same version number for the initial RAM disk, so write down the version number that you choose if needed, but we're not quite done yet. We also need to identify the location of the top level root directory. Since we've already determined that we're dealing with logical volumes, it's going to be on some logical volume device file. We're bound to get for now read-only, until things load and Linux can read the fstab configuration file. And if you know logical volumes, you know that they're part of volume groups. You may have a different name. I'm just using the default for Red Hat Enterprise Linux. And that looks like it's recognized. If you're top level root directory were installed on a regular partition, you could identify the partition by substituting something like root dev sda2, or you could use the label device, if you remember your etc fstab configuration file. But we know, since the other partitions are part of logical volumes, we've properly identified the top level root directory. Next, there is the initial RAM disk which we can identify first with the initial RAM disk directive, we have the forward slash identifying the top of the boot directory, and the initial RAM disk starts with initrd. And we use the same version number that we used for the kernel, and since it's an initial RAM disk, it's an image file. Now, for the real test. Now that you've loaded the kernel, the root directory, and the initial RAM disk, type the boot command and press Enter. It should load your system normally. But there's a lot to learn with respect to the GRUB configuration file, and I could easily go on for hours. If you're working with Xen, many things are different. If Xen were on the RHCE exam, I'd have to explain how that interacts with GRUB in another video, so on your own, try introducing spelling errors in the GRUB configuration file. Reboot your system. What happens? But before making any changes, make sure to make a backup, or at least a snapshot, but introduce as many syntax errors as you can, one at a time, to help you understand what you might actually see on the RHCE exam. If you see an error message and if you've run into it before, you won't panic during your exam.
Tutorial Information
| Course: | Red Hat Certified Engineer |
| Author: | Michael Jang |
| SKU: | 33845 |
| ISBN: | 1-934743-47-X |
| Release Date: | 2008-01-18 |
| Duration: | 6.5 hrs / 94 lessons |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 81,350 Video Tutorials (20,800 free)
- Video Available as Flash or QuickTime
- Over 782 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 