|
楼主 |
发表于 2003-1-12 09:56:47
|
显示全部楼层
1.原英文资料
Creating Diskette Images
These boot diskette image files are supplied on the first CD-ROM of RH6x/RH 7.x and can be created in two ways:
* From any DOS-based system by using the supplied RAWRITE.COM utility (in \DOSUTILS on the first binary installation CD-ROM). (This does NOT work from within a DOS prompt of any Windows 9x system, nor from the CMD.EXE prompt on NT.)
*Assuming your CD-ROM was drive E: on your DOS machine, you could simply enter: E:> \dosutils\rawrite
The RAWRITE program will next ask you for the name of the file to write to the diskette, then prompt you for the target (Enter A: at the second prompt).
You should supply the full path to the filename as shown next.
*E:\images\boot.img?69(All versions of Red Hat)
*E:\images\bootnet.img?69(All versions of Red Hat)
*E:\images\pcmcia.img?69(All versions of Red Hat)
*E:\images\pcmciadd.img?69(Red Hat 7.x)
*E:\images\drivers.img?69(Red Hat 7.x)
You can view the files on this boot.img diskette as they are all DOS-oriented. You also must repeat this entire RAWRITE process for each image file you wish to create, as illustrated in Figure 3-10:
Figure 3-10:
Usage of the RAWRITE utility
The contents of the BOOT.IMG file (after transferring to the diskette) are in DOS format (depicted in Figure 3-11).
Figure 3-11:
The RAWRITE directory listing
Creating Diskette Images with Any UNIX/Linux System
You can also create diskette images by using the dd command from any running UNIX or Linux computer, along with the image files on the CD-ROM.
The supplied IMG (image) files on the diskette can be used from any UNIX/Linux system as well. The dd command to use would be for a typical Linux system:
# mount /mnt/CD-ROM
# assuming the CD-ROM device was already in fstab
# cp /mnt/CD-ROM/images/*.img /tmp
# copy them all over, or use them directly
# dd if=/tmp/boot.img of=/dev/fd0
# replace diskette for each file
You would need to repeat this for each image file you need, as previously stated. A list of these image names is presented in Figure 3-12.
Figure 3-12:
List of IMG (image) files available with RH7.x
Almost Ready to Install
With your system configured to either boot from the CD-ROM directly or from one of the boot image disks (BOOT.IMG, BOOTNET.IMG, or pcmcia.img in the floppy drive and your Red Hat Linux 7.1 CD-ROM (marked with the number 1) in the CD-ROM drive, reboot or power cycle your machine.
Laptop Reboot
If you have a laptop that doesn't really power down, you will need to use the Shut Down and Restart option of that operating system.
This inability to really shut down is a huge frustration for laptop users. You might want to set the hardware to power down by using the Power button (if this is configurable, that is-check the laptop manual). If the laptop does not do this and power management doesn't work, you may have trouble turning off the computer (especially if you have removed Windows entirely from the laptop.)
The author has had many laptops, most of which had a tiny reset button hidden somewhere that you could use to force a reboot. You need to find out if your laptop has one just in case. Most newer laptop models also have the "hold the power button down for 6 seconds or more" option to force a power down. Check your user manual for details on the Power button. Also, be aware that some power saving modes won't operate without special disk partitions-partitions which Linux cannot create. It may be necessary to download software from the computer manufacturer to provide relatively complete power management capabilities.
Win9x/NT Reboot Procedure
For Windows 9x/NT, select Start, then click the first option above Start: Shut Down. An option box should appear. Select the Restart option if it is not already selected, then click OK. You may have to wait a few moments before the screen goes blank and the system BIOS starts rebooting.
Bootable CD-ROM
Most newer systems can be booted from the CD-ROM, which is probably the easiest way to accomplish an installation. Alternatively, you could boot your system from the Linux boot floppies, described earlier. Most systems have a BIOS setting that controls the boot search order, so you should consult your computer manufacturer's documentation for details.
Booting from DOS and Win9x, Not NT
If you already have MS-DOS 6.22, simply boot the machine until you get to a command prompt. If you have Win9x on your machine, reboot the machine into command mode. You cannot do this from NT as it only works from a purely DOS-like command prompt, not from within the DOS PROMPT window of any MS Windows operating system.
Once in command mode, assuming you have access to your CD-ROM drive via an installed driver in the config.sys setup, you can run the file E:\DOSUTILS\AUTOBOOT.BAT ((assuming your CD-ROM drive is E. This will get you to the Installation program.
CD-ROM or Boot Diskette Starts Installation
After the hardware tests, the PC should boot from the CD-ROM or the floppy, whichever you have selected. After a few files are opened and decompressed, a Welcome To Red Hat Linux screen should appear.
You are finally at the first stage of the installation. This is a good time to point out a few things you'll need to know before moving on.
Necessary Information
The installation program uses either a full X-Window Graphical Interface (if it can load X), or it will default to an "almost graphical" text interface. Example figures from both the GUI and text-based interfaces are included in this section. Although the mouse does not work in the text interface specifically, you can move the cursor around using the up- and down-arrow keys, the tab key, and special function keys, as described next. It's not like a real GUI interface, but it's better than just a text command line. If you choose to attempt the graphical install and encounter problems, particularly display-oriented problems, restart the boot process and try the text interface.
Screen Cursor Movement, Selection, and Text Entry
The screens or windows that appear during the installation will have a standardized look and feel. The first screen offers an option to display help. Press the enter key to continue to the next screen. Some keys allow you to move through these screens the way a cursor would. In fact, in this situation, the "cursor" appears as a blinking underline or as a reverse-colored box over an item.
Figure 3-13 is just one of the many screens that appear during installation. Not all screens require cursor movement or force you to select multiple options. This screen shows all these features and is used to illustrate how to move around and select or deselect an option.
Figure 3-13:
An Install screen example
By pressing the arrow keys, you can move up or down through the option selections at the top; in this case, the various mouse types. To get to the next field, press tab to go forward to the next selection (in this case, Emulate 3 Buttons), then choose OK, followed by Cancel, and finally Help. If you tab again, you will find yourself back in the list of mouse devices. When not in a field of multiple selections, you can use the up- and down-arrow keys to jump from one field to the next.
The keys shown in Table 3-2 can be used for navigation.
Key
Function
tab
Go to next element
up- and down-arrow keys
Move up/down through selections or menu items
spacebar
Toggle a selection ON or OFF
f12, enter
Accept entries on current screen
Table 2: Navigation Keys
Assuming you are at the screen depicted in Figure 3-13, and your cursor is on the same option, if you press tab, the cursor will move to the line "[ ] Emulate 3 Buttons?". You could toggle this selection on with the spacebar, and off if pressed again. If you press tab again, the cursor will move to the OK box.
At this point, you could use the arrow keys to move from OK to CANCEL to HELP to the <mouse option>. Once at the <mouse option>, the cursor keys select another <mouse option> line. Using alt-tab reverses the direction of the cursor movement. If you press enter or f12 at any time, it defaults to the OK option (unless you click Cancel), along with all currently selected options.
Quick Overview of Installation
The installation starts after the initial bootup screen.
Part 1: Basic Workstation Installation Steps
For ease of installation, let the install program create the disk partitions as needed, select Continue. HOWEVER, if you do select Manually Partition, the screen in Figure 3-14 appears.
Figure 3-14:
Partitioning with the Disk Druid utility during installation
The Disk Druid utility is the best choice for beginners. (The fdisk tool will be explained later in this section.) The next screen shows the Disk Druid interface. Essentially, you can add if there is free space. This graphic only shows 2000MB free, which could be assigned to a partition. You can edit any partition and change the mount point if all other parameters are already set. If you wanted to change the partition layout, you need to delete unwanted partitions. Simply select the partition with your mouse, then click Delete. You are prompted to confirm; select OK. Assuming there is available space, as illustrated in Figure 3-14, you could add new partitions by selecting Add (shown in Figure 3-15).
Figure 3-15:
Disk Druid: Adding a new partition
Once completed, as depicted in Figure 3-16, you can continue by clicking the Next button at the bottom of the screen.
Figure 3-16:
Finished adding partitions with Disk Druid
At this point, you have only guessed at the sizes of each partition, and if you have been generous and made them big enough, your installation will work fine. If you were tight for space and guessed wrong for any partition size (for example the /usr partition needs lots of space, 512 is not enough for any of these installations), then your installation will fail and you will NOT be able to go back to redo the partitions. As a result, you will be forced to start your installation over and delete the old partitions, changing their sizes as needed. So, plan your partitions carefully and then add more space just in case!
Next, you should select all newly created partitions but skip any data partitions you have saved from a previous Linux installation, such as /home. Figure 3-17 shows all the Linux-oriented partitions you created and that already existed, assuming that you want to format them all. If you were saving the contents of a previous installations' /home directory, you would deselect that partition here so it would not get reformatted during this installation.
Figure 3-17:
Formatting Linux Native partitions
You are next presented with the LILO Configuration screen of options shown in Figure 3-18. If you were doing a text-based installation instead of a GUI interface, there are three separate screens provided for the information presented here.
Figure 3-18:
The LILO options screen includes Bootdisk, Kernel, and MBR setup options
It is always a good idea to create a boot diskette. This boot diskette will contain an MBR and all the files required to boot your system should you install your primary MBR onto the main disk (C and it fails for any reason. Additionally, if there were any options needed to be passed to the kernel at bootup, you can include them here. The final section within Figure 3-18 contains the setup of where to put the boot record. If you already have a Windows installation, as depicted in Figure 3-18, then the installer defaults to the Linux partition and will boot the Windows partition via the label name "dos." You could make the dos bootup option the default by selecting it and then choosing the Default Boot Image option, if desired. By default, the system will boot Linux after five seconds or you can select the dos option to boot the previous Windows OS.
At this point, unless you really want to boot dos/Windows/NT as the default, you would simply select the OK button and your system will be configured to boot Linux by default after five seconds (the timeout is not configurable at this point; once Linux is booted, you could change the timeout value by updating the text file /etc/lilo.conf and running LILO)
The next step is the assignment of the network information (as depicted in Figure 3-19). You can either use DHCP, if DHCP is available on your network, or provide the unique IP address and associated network mask values as a minimum to get started, along with the host name. Optional information includes the DNS server IP address and the Gateway IP address, also shown in Figure 3-19.
Figure 3-19:
Network configuration and host name setup
After network and host name configuration information, the Firewall Configuration option appears as depicted in Figure 3-20. It defaults to medium security but if you are paranoid like most superusers should be, select the High option and then click Next to continue.
Figure 3-20:
Firewall configuration during installation
If you select the Customize option, assuming you already understand the network services listed, you can then select which services to allow in and which to block (as shown in Figure 3-21).
Figure 3-21:
Customized firewall configuration
Both Telnet and FTP are considered insecure and should NOT be allowed through a firewall defense. Figure 3-21 shows them as not selected, while all the others are. You should configure the SSH (Secure Shell) service instead of FTP and Telnet. (This will be covered in a later chapter.)
The next screen provides the mouse selection, as shown in Figure 3-22.
Figure 3-22:
Mouse configuration
Most PC mice are two-button, but Linux/UNIX assumes you have a three-button device, so you must change the selection to the two-button option and verify that the box marked Emulate 3 Buttons (at the bottom) is selected. Normally, it will automatically select the Emulate 3 Buttons for you, which you should accept.
Technically, you can support multiple languages, if so desired. The default is simply USA English. Figure 3-23 shows you the many options available. Be aware that each additional language requires a significant amount of disk space.
Figure 3-23:
Language support selection
The time configuration (shown in Figure 3-24) has plenty of bizarre locations you may never have heard of, so check it out, especially the GUI interface. It is quite an amazing application for just one little screen.
Figure 3-24:
Time zone configuration
You must put in a valid password for the root account. Figure 3-25 shows the Account Configuration screen. The password itself is not echoed back to the screen. Instead, the asterisk character appears for each character typed in. A combination of letters, numbers, and shifted non-alphanumeric characters is the best choice. You must use at least eight characters as well.
Figure 3-25:
Account configuration
The lower half of Figure 3-25 allows you how to add additional user accounts. All workstations should have one user account that is unprivileged. The root account should be left for administrative duties only.
This first screen requires that you add at least one user. You can add more than one user, as depicted with the next screen.
The next screen provides Authentication Configuration and encryption standards. All these services are explained in other sections and not discussed here. Simply accept the defaults for now.
The next screen lets you choose package groups to be installed. All of these groups are displayed at the beginning of the chapter, in Figures 3-6, 3-7, 3-8, and 3-9. A few package groups have been already picked for you by default. You can unselect them if desired. Notice the system keeps track of the size of the packages you have picked; add 50 percent to this size after decompression for what you probably need in real disk space. Unfortunately, the size shown does not indicate which directory structures (and hence, which file systems) require free space. This is makes for a lot of trial and error when you are tight on space.
The final option on the package screen (depicted in Figure 3-9) is an option to select Individual Packages. This allows you to select specific packages out of any group, for a much finer customization level. This should not be done by beginners and is typically used when space is very limited and package selection is critical.
With this finely-tuned package selection option afforded by Individual Package selection comes the requirement that you know exactly what packages require what other packages. If you don't, you may get an error indicating you missed a needed package (like that displayed in Figure 3-26).
Figure 3-26:
Unresolved dependencies in package groups
If a package group you have selected has a dependency that cannot be resolved with already selected packages, an error occurs (as shown in Figure 3-26). Simply go back and select the necessary package and continue until no further complaints appear. You have now completed the software package selection requirements of the installation. The next few screens depict the installation of the X-Window system.
At this point, you are informed that a log file of your installation will be kept in /tmp/install.log. Note also that this is the last point in which you can abort without actually changing your disks in any way. Up to this point, everything is memory resident. When you click Next (as depicted in Figure 3-27), you will have committed the disk partition changes and you will see the formatting of the new partitions and then the installation of the packages.
Figure 3-27:
Ready to install
All selections and question are being recorded to an installation log that is put into the /tmp directory for your perusal after the installation. A few quick screens go by, formatting, copying the image to the disk, and then the actual package installation starts.
Ignore the estimated time required until at least a dozen or more packages have been installed as the estimated time will not be very accurate.
If you're installing from a CD-ROM, the required files are spread over two CD-ROM disks. You will be prompted when it's necessary to change disks.
When all packages are installed, a post-install procedure is completed that includes any package post-install procedures.
The final step is to create a boot diskette (as shown in Figure 3-28).
Figure 3-28:
Create a boot disk
Creating a custom boot disk will allow you to boot the system, even if the traditional Linux boot loader, LILO, becomes corrupt or misconfigured. This is highly recommended! After this is complete, you're ready to reboot, because you're done!
Caveat Emptor on Installation
Do not worry if you make a mistake the first time on a test machine. Just redo the installation, it will be significantly faster and easier than trying to correct a problem. There are so many options and possibilities in the overview just presented, it is not possible to name them all or take them all into account. In most cases, the default is sufficient if you do not understand the question posed. Move on and get it installed, then read the FAQs, HOWTOs, and other related docs once you are up and running. You can always reinstall; the second and third installs are actually a very good thing considering you need to know this very well for the RHCE Exam.
Although you have finished the installation and have worked the concepts of partitioning (and possibly multiple operating system boots), there are still a few more details to note, such as LILO errors, BIOS issues, and others, all described in the following sections.
CERTIFICATION OBJECTIVE 3.04
The LILO Boot Process and Intel Hardware/BIOS Issues
The original Intel motherboard design provided a mechanism to start any operating system. It would load a bootup program, located in the first sector of the first disk starting with A: and followed by C:. This bootup program is located in an area most often called the master boot record, or MBR. This is the first program loaded by the BIOS. This program then loads the real operating system boot control program(s), which, in turn, starts the operating system.
The main issue with this bootup is that the MBR has to be found in the first 1024 cylinders of any disk. This is because the BIOS programs stored on the motherboard would not be able to "see" any value over 1024, a limitation of the original BIOS design. With newer motherboards, they use a mechanism called Logical Block Addressing, or LBA mode, on disks to alleviate this problem. The disk LBA mode reports back "logical" values for the cylinder, head, and sector so that the BIOS can then "see" a larger disk drive. Internally, the drive uses the LBA values to find the real cylinder, head, and sector. One way or another, you must ensure that the boot block for Linux is not past this magical boundary, or the boot will fail.
Usually, Linux opts for the /boot partition if it does not rewrite the MBR. You can put it on any partition available. The MBR is just the most convenient; the system can cascade to any previous OS. My laptop has LILO cascade to NT, which cascades to Win95. I can choose Linux first, or NT second, if I want, or just let it cascade to Win95.
Boot Control of Your System
Linux uses a set of files to boot your system, referred to collectively as LILO, which is short for Linux Loader. During or after installation, you have two options:
*Create a boot disk
*Update a local disk partition with the LILO MBR
The boot disk is an excellent way to hide the Linux system for other users. For development or help desk systems with multiple operating systems, you can create a boot disk that specifically boots just Linux when inserted into the floppy drive.
One major danger with a floppy is the chance of damaging that boot disk. You may want to make multiple copies to minimize possible problems. You can use the dd command to make multiple copies of the disk. Here is an example of the commands needed to create a copy of the original diskette to a local file, and how to create duplicates from this local file:
$ dd if=/dev/fd0 of=diskettebootup.img # stores a copy of diskette
$ dd if=/diskettebootup.img of=/dev/fd0 # makes the copy
There is a utility supplied with Linux that will create a bootup diskette from your running system with the required root and /boot partitions called mkbootdisk. You need to know the name of the running kernel, but you can have the system generate that for you and substitute it onto the command line as follows:
$ # to create a boot disk for the `current kernel number`
$ mkbootdisk /dev/fd0 `uname -r`
Updating /dev/hda MBR
The old MBR, if there was a previous operating system, is moved to a new location and Linux installs its own MBR. This is only the first part of the loading operation required to get Linux started. The second part of the bootup process is contained within the /boot directory structure.
/etc/lilo.conf
You can update or change your bootup options with the lilo configuration file, /etc/lilo.conf, and with the boot loader install utility, /sbin/lilo.
The first part of the loading operation provides a prompt allowing you to enter any valid listed boot option along with any command options for that boot option. All LILO control is maintained by the system file, /etc/lilo.conf. The following listing shows the details of deciphering /etc/lilo.conf.
=======================================================
[root@linux6 /root]# cat /etc/lilo.conf
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=Win95
image=/boot/vmlinuz-2.2.5-15
label=linux
root=/dev/hda8
initrd=/boot/initrd-2.2.5-15.img
read-only
other=/dev/hda1
label=Win95
table=/dev/hda
[root@linux6 /root]#
=======================================================
boot=/dev/hda
map=/boot/map
This is where the system is to look for the bootup and map info: the first hard disk.
install=/boot/boot.b
This is the location for the second part of the LILO program startup routine.
prompt
This forces the lilo: prompt to appear on the console.
timeout=50
This is the default five seconds before the boot process continues automatically.
default=Win95
Normally, the first boot listing (next section) is default. This line supercedes the default action and selects any boot choice via the identifying label.
image=/boot/vmlinuz-2.2.5-15
This is the actual virtual memory compressed kernel (version 2.2.5, with the -15 representing the Red Hat revision number) of Linux.
label=linux
This identifies the "boot option" label that appears if you press tab at the LILO prompt.
root=/dev/hda8
This shows the location of the root, /, directory file system partition.
initrd=/boot/initrd-2.2.5-15.img
This reveals the location of the second stage (RAM disk) load.
read-only
During installation, the RAM disk file system is started in read-only mode. After the second stage is finished with a few tests, the RAM disk is unloaded from memory and the real root partition is mounted from the file system in read/write mode.
The next section is another boot option-in this case, to boot Windows 95 on the first partition, known as C: to users of DOS/Windows 9x (known as /dev/hda1 to Linux).
other=/dev/hda1
label=Win95
table=/dev/hda
The table is the location of the partition table to be used-in this case, the first physical IDE type disk on the system.
What to Do When You See LILO
When you restart the system, after the internal POST (Power On Self Test), the LILO boot block, MBR, is loaded.
You then see a big picture of the Red Hat logo on the left and all your boot options appear in the column on the right.
By default, you have five seconds to enter something; otherwise, the system will automatically continue with the first labeled boot (default) option.
By simply pressing enter, the default entry is selected-in this case, the one known as Linux. If you wanted to select the Win95 option, you would enter the specific label name (case should not matter).
lilo: win95<ENTER>
LILO Parameters
To pass a parameter to LILO, type the parameter after the label name. For example, if you wanted to start your system in rescue mode, you would type rescue at the prompt when booting with the BOOT.IMG or BOOTNET.IMG diskette. If you wanted to start your system in single-user mode, either of the two following commands would provide the same result:
lilo: linux single<ENTER>
lilo: linux 1<ENTER>
Single-user Mode
A common kernel option is the word "single," or alternatively, the number 1. Both of these options change the default behavior of the startup such that the system boots into runlevel 1, also known as single-user mode.
Many more parameters can be added, including how much memory to use, and what device to load as the root device in the case of a broken mirror set. All of these are documented on the CD-ROM in the /usr/doc/LILO subdirectory.
Single-user mode is the most commonly used option. This is the system maintenance mode for experienced Linux administrators. In single-user mode, no file systems other than the root file system are loaded. You are then able to do clean backups and restores to any partitions in this mode. You also have the ability to run administration commands, recover or repair passwd and shadow password files, run file system checks, and so forth.
In some cases, to get out of single-user mode you just have to type exit and your system will go into multi-user mode. Alternately, if you have made changes or repairs to any partitions, you should reboot the machine. Press ctrl-alt-del to reboot from within single-user mode.
LILO Errors
The LILO first stage will also indicate some common and not so common problems:
(nothing) did not get to lilo at all
L first stage loaded and started
LI second stage loaded from /boot
LILO all of lilo is loaded correctly
Occasionally, there may be an error due to partition table changes, bad blocks, and so forth. On these rare occurrences, you will only get partial LILO prompts:
LIL second stage boot loader is started
LIL? Second stage loaded at an incorrect address
LIL- the descriptor table is corrupt
What to Do If /etc/lilo.conf Changes
If /etc/lilo.conf changes, you will first need to log in as root. If you want to add additional kernel options, use a text editor such as vi, pico, or joe to modify the /etc/lilo.conf file. Once modified, the changes must be added to the LILO boot process. This is done by running the /sbin/lilo utility at the prompt. This forces the update of the boot record to include the changed options.
If you have a dual boot system, you may want to change the default to another operating system for a short period of time. You update the /etc/lilo.conf file and then must run /sbin/lilo to force the changes at bootup. This may also need to be done in some rescue situations, in which you will need to rebuild the boot record. In the case of a rescue, you should be aware that this boot record uses a relative offset to point to the files to be loaded. Make sure you mount any extra file systems, after the root file system, in similar locations to normal.
CERTIFICATION OBJECTIVE 3.05
Using Syslinux and loadlin
Although Red Hat Linux uses the LILO boot loader program to manage the initial bootup process, there are alternates that other distributions of Linux use.
During installation, you will see another loader called Syslinux.n.m-x. This is an MS-DOS-based loader and is used on all the installation images because it is small enough to fit on a floppy and boot a basic Linux kernel. You can get more information about Syslinux from http://metalab.unc.edu/pub/Linux/system/boot/loaders/.
Another popular option is called loadlin. The loadlin program is also MS-DOS-based and requires a copy of the Linux kernel, and possibly an initial RAM disk if your drives are SCSI types, to be MS-DOS available. You can read the HOWTO and FAQs on loadlin if you want to use it instead of LILO. You can find out more about loadlin at http://metalab.unc.edu/pub/Linux/system/boot/dualboot/.
Essentially, the loadlin program relies on MS-DOS instead of your system BIOS to load Linux. The advantage is that loadlin can load a kernel beyond the 1024 cylinder boundary, from any file system that is accessible to MS-DOS. Note that loadlin cannot be used from any Win9x or NT DOS PROMPT environment; you must boot into MS-DOS mode.
There are also some commercial boot loaders available, like System Commander, that can create a table of optional boots for almost any other operating system you can install on an Intel-based PC. Some of these commercial products can update the NT boot loader system and provide a direct boot option to Linux from the NT boot prompt. More information on System Commander can be found at http://www.systemcommander.com/products/products.html.
There is a mini-HOWTO document for loadlin being used with Win95 on the documentation CD-ROM at HOWTOS/mini/Loadlin+Win95-98-ME, if further details are needed.
CERTIFICATION OBJECTIVE 3.06
Additional Installation Details
Now that the basic screens from the install have been explained, we can delve into greater detail regarding the more important aspects of Linux you should know before attempting an installation.
Partition Concepts
With either fdisk or Disk Druid utility, you must understand basic partitioning concepts. In Figure 3-29, 16 partitions are displayed. Though 16 partitions are possible, unless you needed them, you would probably not break a disk into this many sections. It is totally up to you, however. Keep in mind, though, that you can only use 15 of the partitions to actually hold any type of file system.
Production- Please pickup Figure 3-35 from ISBN 0-07-212155-6.
Figure 29: A maximum of 16 devices are possible for any one IDE disk, 15 of which are usable
On a SCSI disk, there is no extended disk option, but you can still create 15 usable partitions. In this case, the naming scheme would be sca instead of hda for the first drive, then scb, scc, and so on.
Preparation Details Before fdisk or Disk Druid
You will be introduced to the use of fdisk in full detail in the next section. There have been a few references during the installation about using fdisk and Disk Druid to create partitions, but you still need to know what all these partitions are actually for as there is no one particular answer.
You must decide what to do with your disk space before you begin partitioning it. This is the first, and probably most important, preinstall detail to know. So, what partitions will you need to create? If you have a new machine, you can let the Workstation or Server Installation options do it for you. If you plan to use the Custom option, you must first have a clear idea of your partition scheme.
Getting Started: The Sample Partition Table
As a preliminary step to getting started, you need to have a clear idea of how to separate your file system onto various disks. Table 3-2 can be used as a starting guide to decide how to create your partition scheme.
Improved Performance: Spreading the Load
Performance improvements can be obtained for any system in two simple ways:
*With increased memory
*By spreading the load of read and write operations across multiple disks, or, even better, across multiple controllers
Keep this performance enhancement in mind when deciding what directory structure to put on which partition on each disk. You should try to keep the system files separate from the data files, and preferably on separate disks and controllers.
Another way to "spread the load" is to use software or hardware solutions that use various forms of RAID. On a big server, RAID can be an excellent way to provide better performance and better reliability. Hardware solutions are more expensive and provide better service than software-based RAID solutions should disasters occur. How to set up RAID is discussed in Chapter 5, or you can check the HOWTO documents for more information.
Table 3-3 lists some of the commonly separated file system directories in the left column, and in the right column, contains comments regarding size and why to separate it. You can then fill in the second, third, and fourth columns with the actual information for your system and post it on the machine for easy reference.
Use
Disk
Partition
Size (MB)
Comments
Swap
hda / hdb / hdc / ?
(required) Have to have at least one; two to three times memory is typical
(can split swap space across multiple disks and controllers for better performance)
64MB def.
/boot
Must be within first 1024 "seeable" cylinders on any disk
16MB default
/ (root)
Contains system; typically provides access to all other partitions (required)
No default; 600+ workstations; 256MB server
Note: recommended 1000+MB if no other partitions
(unusable as a file system)
hda / hdb /hdc / hdd
4
IDE-Extended container partition for the logical drives (max 12)
/var
Variable area for system logs, spooling, e-mail, and so on.
256MB default server
/usr
Usually for "user" stuff: binaries, data, games, and so on.
512+MB default server
/home
Home directories, good idea to separate for backup and quota management
512+MB default server
/var/ftp (RH7.x)
Separate if large FTP site
/yourdata
Your specific needs
/opt
Many third party and commercial software packages install to here
Table 3: Getting Started: The Installation Worksheet
CERTIFICATION OBJECTIVE 3.07
Creating Partitions: Details
Now that you have the partition layout for your system, you need to actually create them. For this, you will probably use the fdisk utility, either from a boot diskette or from the running system. The next section details exactly how to use fdisk to create your system partitions.
Why Separate File Systems?
The UNIX, and hence Linux, file system has been historically split up into smaller, more manageable pieces for various reasons: everything started on small disks, small partitions are easier to dump and restore, partition limits can be used to restrict or control disk usage, and so on.
The Linux file system can also be broken up into smaller pieces or left as one large unit, if so desired. When would you use one big partition? When you have a large RAID5 disk farm providing your file system, or when you are creating a small test system.
Linux File Systems: /tmp /boot /usr/local /var /home
The historical separations have been blurred over time, but the following are the Red Hat Linux recommended file system breakouts for the base system of any server:
/tmp
Used by everyone; no need to back up; gets very fragmented; usually has a crontab entry for "cleanup"
/boot
Represents second-stage extras for LILO; must be within first 1024 "seeable" cylinders
/var
The variable area gets written to by memory; often used for mail and spooling; system memory data becomes very fragmented
/home
Home directories of all users; good idea to keep them separate from system files if using quotas; restricts quota management "area"
/usr/local
Specific binaries, data, and setup files for this particular machine
Additional file systems can be created to meet additional or specific needs of related groups of users (for example, /development, /dbms, /financials, /inventory, and so forth).
Possible Target File Systems for Separate File System Placement
Your Linux host may also be supporting a very specific set of applications (such as Web and FTP hosting), any one of the many file and print sharing services (like NFS, Samba, NetWare, and Macintosh), or a third-party application (database management system, financials, Geographical Information System, video, software development, and so forth).
In many cases, you probably want to break up these files into separate, manageable units, perhaps spread over many partitions if they are very large. This disperses the load across the file system, provides better disk management, backup, and recovery options, and allows for a more flexible overall system design.
Swap Space Partition Sizing and Placement
The total memory available to any and all programs is the sum of all RAM and swap space. Linux uses a linear memory model.
Although there is no hard-and-fast format, a good rule of thumb is to create your swap partition so it's two to three times that of small memory systems. This was typical in the early days of UNIX when RAM was very expensive and disk space was cheap. Current systems can easily have large amounts of memory. Is there an upper limit? Not really, especially when you consider it is 64GB for the Enterprise kernel alone. Still, you could have a smaller swap space if you had a huge amount of RAM.
One recommendation is to use two to three times the memory for any system with less than 512MB of RAM. After this point, it might seem wasteful to create a 1GB swapfile that is almost never used on a system with 512MB of RAM. You might opt for a 512MB or, even as low as, 256MB swap partition.
The swapfile is used sparingly for some system information, but is used heavily to page out user processes when more memory is needed. In essence, you never want to swap user processes. Keep in mind, RAM is in nanoseconds of speed, whereas disk is in milliseconds of speed-a million-fold difference. The swap is just there in case you have a sporadic need for lots more virtual memory. If your machine constantly uses swap space, this action will slow it down significantly. In such cases, You should get more RAM for your system, or reduce the workload.
Technically speaking, you can have up to eight swap partitions, totaling a maximum of 4GB. Any single swap partition can be up to 2GB maximum. Swap partitions are only used for virtual memory, acting like additional RAM to your system, and use a different file system than the other partitions. Some high-end RDMS database systems have their own format and file system for partitions, like Oracle, to contain their data, as opposed to an ext2fs.
Supported File System Types
Linux natively supports many other file systems, such as DOS, HPFS, FAT, VFAT, and NTFS . So if you have OS/2, Windows 9x, or a DOS operating system using other partitions on the same machine Linux is installed on, you can access them. The system will be able to "see" the native files.
The most popular Linux file system is called Second Extended File System, denoted by ext2fs or just ext2. Most associated utilities will start with or contain e2, like e2fsck, dumpe2fs, mke2fs, and so on.
In the following code, the first command, df, displays the total, used, and available free space on all currently mounted file systems. The second command, mount, shows the type of file system. In this case, the device /dev/hda1 is mounted using VFAT as /DosC and represents direct access to what would be the C: drive of the Windows operating system on this first partition. Linux can directly access many other native file systems.
==================================================================
[root@linux6 /root]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda8 932833 502478 382162 57% /
/dev/hda7 23300 2588 19509 12% /boot
/dev/hda1 1052064 914784 137280 87% /dosC
/dev/hda6 1052064 111648 940416 11% /dosE
/dev/hdb 556054 556054 0 100% /mnt/cdrom
[root@linux6 /root]# mount
/dev/hda8 on / type ext2 (rw)
none on /proc type proc (rw)
/dev/hda7 on /boot type ext2 (rw)
/dev/hda1 on /dosC type vfat (rw)
/dev/hda6 on /dosE type vfat (rw)
none on /dev/pts type devpts (rw,mode=0622)
/dev/hdb on /mnt/cdrom type iso9660 (ro)
[root@linux6 /root]# ls /dosC
CDsetup.bat boot.ini detlog.old io.sys sbide.sys
Exchange bootlog.prv detlog.txt mscdex.exe scandisk.log
My Documents bootlog.txt digipix msdos.--- setuplog.old
Program Files bootsect.dos drvspace.bin msdos.bak setuplog.txt
RescuedDoc1.txt ca_appsw dswin msdos.dos suhdlog.---
RescuedDoc.txt command.com ffastun.ffa msdos.sys suhdlog.dat
acess command.dos ffastun.ffl mskids system.1st
autoexec.bat config.dos ffastun.ffo netlog.txt temp
autoexec.dos config.sys ffastun0.ffx ntdetect.com w95undo.dat
autoexec.old config.win himem.sys ntldr w95undo.ini
boot.--- dblspace.bin io.dos recycled win95
[root@linux6 /root]#
==================================================================
This listing shows a typical Workstation installation with two additional mount points for the C: and E: drives used by the Win9x and NT operating systems also resident on this machine. Why would you bother to do this: Test machine, help desk machine, development, only have one machine and need to practice, in a classroom, and many more possible scenarios. You would not do this for a typical single-user production machine.
One of the benefits is that you can move and copy files between the Linux partitions and the DOS partitions using standard Linux commands. You cannot, however, run any Windows applications within Linux unless you run a DOS or Windows Emulation package.
The fdisk Utility
The fdisk utility is universally available and should be one of the first tools you get acquainted with. There are many commands, even an expert mode, but you only need to know a few as discussed here.
Though you can modify the physical disk partition layout using many programs, we will be discussing the Linux implementation of fdisk. FDISK.EXE from DOS has the same name, and is also used for creating partitions, but doesn't incorporate any Linux-compatible features. A simple rule to follow is to use whichever fdisk is supplied with an operating system when creating partitions for that operating system.
Using fdisk: Starting, Getting Help, and Quitting
The following screen output shows how to start the fdisk program, how to get help, and how to quit the program.
===================================================
# fdisk /dev/hda
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): q
===================================================
The fdisk utility is all text-based, and as such, displays hard drive parameters at startup.
Using fdisk: In a Nutshell
You should print to screen (p) the current partition table entries. You then create a new (n) partition, either primary (p) or logical (l), partition number (1-4 for primary, 5-16 for logical), starting one number after whatever is the current last-used cylinder number. The size of the partition will depend on disk geometry; do not worry about exact size here. Normally, fdisk defaults to creating a Linux Native type (82) partition. For the swap partition, the partition type has to be toggled (t) to type 82, swap. Repeat these general steps for each required partition. Note that all other partitions should be type 83, Linux Native. Please note that fdisk is memory resident and makes all these changes in memory. You need to write (w) these changes to the disk as the last step, otherwise no changes will be made.
Using fdisk: Deleting and Creating Partitions
In the following screen output sample, you will remove the only partition. The sample output screen first starts fdisk. Then you print (p) the current partition table, delete (d) the partition by number (1 in this case), write (w) the changes to the disk, and quit (q) from the program.
Warning: Last chance to change your mind before deleting the current partition.
===================================================
#fdisk /dev/hdb
Command (m for help): p
Disk /dev/hdb: 255 heads, 63 sectors, 525 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 525 4217031 6 FAT16
Command (m for help): d
Partition number (1-1): 1
Command (m for help): w
===================================================
You did it! Now you can create the partitions you need.
Using fdisk: A New PC with No Partitions
After installing Linux on a new PC, you'll want to use fdisk to configure additional physical disks attached to the system. Create a new partition, type Primary for the first three, and then Extended for the rest of the disk as partition 4 before creating logical drives 5-16 within the extended partition. There is no need to create an extended partition unless you require more than four partitions on the new disk.
Using fdisk: Creating Partitions
The following screen output sample shows the steps used to create (n) the first (/boot) partition, make it bootable (a), and then finally write (w) the partition information to the disk. (Note: Although you may ask for a 16MB partition, the geometry of the disk may not allow that size, as in the example.)
===================================================
# fdisk /dev hdb
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
p
First cylinder (1-256, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (2-256,def 256): 2
Command (m for help): p
Disk /dev/hdb: 255 heads, 63 sectors, 256 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 2 16044 83 Linux
==============================================================
Repeat the commands to create the rest of the partitions. After all are created, you should end up with the final design as illustrated in the following output screen sample:
===================================================
Command (m for help): p
Disk /dev/hdb: 255 heads, 63 sectors, 256 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 2 16044 83 Linux
/dev/hdb2 3 18 64176 82 swap
/dev/hdb3 19 169 1203300 83 Linux
/dev/hdb4 170 250 649782 5 Extended
/dev/hdb5 170 201 248682 83 Linux
/dev/hdb6 202 257 449232 83 Linux
Command (m for help): w
==================================================
The fdisk Write Option
The last option used in the preceding listing, the w option, is actually the most important! Up to this point, you have been changing things in program memory, and have not actually made any changes to the physical disk table at all. The write option, w, actually updates the disk's internal partition table information. This always requires a reboot, as significant changes were just made. The alternate to this option is q, which quits without saving these changes.
Disk Druid
One of the excellent additional programs supplied with the Red Hat Linux installation is the graphical Disk Druid program that provides a more intuitive interface. The actions are similar, but the interface hides the need to know about the partition ID (it just uses a text name ID) and has an option called Growable. This option allows the system to determine how much disk space a partition will take based on available free space. However, Disk Druid is available only at initial installation time.
This Growable option is very beneficial in the kickstart scripts (automated installation scripts) where the target hardware may have varying sized disks. All partition space can be allocated by allowing it to "Grow" to fill the disk during installation. This is something fdisk cannot do.
Hardware Installation Scenarios
You may be given machines which already have operating systems that use all the available disk space, or machines with operating systems that can be completely replaced.
One Operating System Only
If you do not want to save the old OS, you can delete all earlier partitions and start with no partitions on the disk. If the machine will only be used for one operating system, Linux, this is the best option. You then only need to decide whether the workstation or server options will meet your needs. If they do not meet your needs, you can use the Custom Installation option to modify either the workstation or server design to better suit your needs.
Already Have Windows x.xx
If you purchased a basic PC, chances are it was preconfigured with an MS Windows-based operating system. Most likely, the entire disk has been formatted as one big partition, known as the C: drive. This is an unfortunate design for you at this point. If you want to keep the current operating system as is, you can find some software that will shrink the partition down for you. There are commercial versions, such as Partition Magic from PowerQuest Inc. (http://www.powerquest.com), and free versions, such as the FIPS utility supplied on the installation images.
Note: Due to the variance of hardware and software available, neither of these products are guaranteed by Red Hat or the author to be without peril. You need to read the documentation and back up everything twice to be sure, then try this with the assumption that something may go wrong, and if so, you can always rebuild (assuming you know how to do this). Many before you have successfully used these utilities, including the author, but things can still go wrong, so be prepared for the worst.
If you use FIPS, it will create a second partition out of the available space you retrieved from any other partition. You should delete this new empty partition before starting the Linux installation. This will allow the installation script to create the workstation, or server, required partitions from the available space, or allow you to create the partition scheme yourself in the Custom installation.
Real-world Applications-Using Partition Magic
A preconfigured laptop came with 1.5GB of disk space on one IDE disk drive, which was allocated as one Primary partition, and had Windows 95 as the operating system. The first step was to make sure the current set of files on the disk drive was reduced to less than the 1GB boundary. Unnecessary software and files were archived and removed so there was only 800MB of used space on this primary disk. Using Partition Magic Software, the files were shifted to ensure they were within the first 800MB of the disk, then the first primary partition end cylinder value was changed so it ended at 1.0GB. This freed up 500MB for the second OS to be loaded. All of this was done through the Partition Magic Software, as well as with FIPS on a second equivalent PC. Both finished without loss of the original Windows 95 OS.
Changing a Partition Size
You can magically move the partition table boundary without loss of data by using the supplied FIPS program or a commercial product, such as Partition Magic.
You start with a disk that has only one partition, as shown next.
0 Cylinder to cylinder n
All cylinders are used by the single partition table entry. Assuming the actual files on this partition do not use all the disk space, or you can remove some to make unused space available, then you can shrink back the end cylinder for this first partition without affecting the files already contained on the disk.
The following listing shows what the disk might look like after you have changed the end wall of the first partition.
0 a (cyl) n
Using the FIPS program, you can shrink the first partition and make the extra space available for one or more partitions. You can then use fdisk to add additional partitions, as illustrated in the following:
0 a a+1 b b+1 c c+1 (cyl) n
hda1 hda2 hda3 hda5
Primary and Extended Partitions
A partition on a disk is a logical set of cylinders that represent all or part of the entire disk. Each disk can be one big partition or separated into many portions. Due to a design in the early stages of the PC and the DOS operating system, you are restricted to a maximum of four primary partitions, one of which can be a special type of primary partition called an extended partition. Each of the other three primary partitions can represent one logical drive. The extended partition, though, is a special case that allows you to break it up into a maximum of 12 more "logical" partitions. This gives a total of 16 partitions, of which only 15 are usable on an IDE computer.
A SCSI type disk is also capable of 15 partitions total as there is no such thing as an extended partition.
Partition Filenames
All device files are located in the /dev directory. Linux has a standard naming convention for the different hard drive types (IDE or SCSI), the drive ID, and for each partition.
The IDE Partition Filename Convention
With IDE, a PC can have a maximum of four devices, two on both the first and second controllers. The first controller would be denoted as hda, hard disk - "a" or first controller ID. Then the partition number follows as in hda1 for the first partition on the first drive on the first controller. The listing that follows shows a sample of a disk partition table with three partitions on a single disk.
hda1 hda2 hda3
The second drive, first partition would be hdb1, where the full path name is /dev/hdb1.
The third drive, first partition would be hdc1, where the full path name is /dev/hdc1.
SCSI Devices
SCSI is another type of interface for disk drives. It has more devices per controller: seven additional for early SCSI, and 15 for new SCSI implementations. SCSI is generally somewhat more expensive, but may provide a higher data throughput.
For SCSI devices, filenames begin with the letters sda, for SCSI disk on first controller. The partitions on this first drive are sda1, sda2, sda3, and so forth. The second drive partitions are sdb1, sdb2, and so on. And partitions on the sixth drive are sdf1, sdf2, sdf3, and so on. The listing that follows shows the names of the partitions for the third SCSI drive:
sdc1 sdc2 sdc3
Hard Disk Installation
Rather than install from a CD-ROM, you can chose to copy the CD-ROM image to a hard drive, then install from the hard drive. To accomplish this, you must obtain the ISO (CD-ROM) images for the distribution CDs. Rather than burn those images onto CDs, you'd simply place the ISO files into a directory of your choice, then provide that directory name when prompted.
Source Files on the CD-ROM
By far the easiest, this installation assumes a standard ATAPI-type CD-ROM is locally attached. The CD-ROM installation can be selected from a standard BOOT.IMG installation startup disk.
Source Files from Network Installations
Before you can get to any network source files, you need to configure your network card to be a part of the network. You will need to input a valid, unused IP address, the local network mask, the default gateway IP address (if network resource is on another network segment), and optionally, the primary DNS IP, the Domain Name, and the host name to use for this machine.
You are presented with three options during installation for setting up your machine on the network:
Static IP Address
You fill it in; you know the numbers
BOOTP
Dynamically sent to you from a BOOTP server
DHCP
Dynamically sent to you from a DHCP server
The last two options are the easiest. Your machine sends out a BOOTP or DHCP request and these network type services send back all the IP information your machine needs to get on the network. However, they require an existing server on the network, already configured to reply to these requests.
The first option allows you to enter the information directly. If you are on a local network, an IP address and the associated Network Mask is enough information to get you on to your local network with access to a local server. If your network was 206.195.1.0, and your host was number 222, you could use the following information:
IP Address
206.195.1.222
Network Mask
255.255.255.0
You may also need or want to use advanced host name resolution so you don't have to remember the IP address of the servers. DNS can provide this service if it is already configured on your network. DNS is what the Internet uses for host name resolution. If DNS is not configured, you have to use the IP address of any network hosts you wish to get access to. DNS is just a convenience when there are many hosts, considering their names are usually easier to remember than their IP address.
IP Address
206.195.1.222
Network Mask
255.255.255.0
Default Gateway
206.195.1.254
Primary Name Server
192.168.15.1
Domain Name
vaddac.com
Host name
linux56.vaddac.com
The Default Gateway IP is the portal to the rest of the network. In the preceding scenario, the DNS server is on another network somewhere and you will need the Gateway IP address to access it.
Source Files from FTP and HTTP
An FTP or HTTP server can be a convenient source of installation files.
To use either an FTP or HTTP server, you need to know the IP address and the name of the directory structure that contains the /RedHat directory tree.
IP Address
206.195.1.1
or use the full domain name
Directory
/pub/I386
directory containing RedHat/
Source Files from NFS
This installation option allows an NFS server on the network configured as an export server to provide the Red Hat subtree files via a network connection.
This assumes you have NFS running on another host accessible via a network connection on the target machine, and that you have the installation files exported from that host. You will be asked for the NFS server IP address and the name of the exported directory.
NFS Address
206.195.1.1
or use the full domain name
NFS export
/exports/I386
directory containing /RedHat/
Creating an NFS Export Service
To create an NFS install server, you should copy the installation tree from the CD-ROM to a hard drive on the NFS server.
Copying Files and Exporting Local File Systems
The following output sample shows how to make a directory to hold the Red Hat file tree.
=============================================================
# mkdir -p /nfs/exports
#
# mkdir /mnt/cdrom
# # copy to a local file system
# cp -a /mnt/cdrom/RedHat /nfs/exports
# # add the export request
# echo '/nfs/exports (ro)' >> /etc/exports
# # stop and start the nfs service
# /etc/init.d/rc.d/nfs stop
# /etc/init.d/rc.d/nfs start
=============================================================
At the Client
You need to know the IP address of your NFS server as well as the name of the NFS export service, and enter these when prompted. At an NT server, you can use the IPCONFIG /ALL command at a command prompt to see the IP information. At the UNIX or Linux NFS server, to display the IP information for your host, use the ifconfig command as root user (illustrated in the following screen output sample).
=============================================================
[root@linux6 /root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:C0:A8:16:BA
inet addr:206.195.1.222 Bcast:206.195.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
...
[root@linux6 /root]#
=============================================================
Source Files from Samba
Red Hat 6.0 is not able to use Samba services for installation. Red Hat 7.x can, however. Samba services represent the native Windows 9x and NT file-sharing protocol, SMB (Server Message Block). In previous incarnations and the latest versions, you can share the /RedHat directory from any Win9x or NT host as a local SMB share and access it through the network by knowing the name of the server and the share name.
An example share from the server identified as NT4PDCNYC having a share named REDHAT (representing the CD-ROM /RedHat directory) would use the following reference to connect to this resource:
\\NT4PDCNYC\REDHAT
The Installation Log File
During every installation, a copy of the installation options and the related files are written to an installation log file called /tmp/install.log. This information is duplicated to the various console displays during the installation. Be sure to copy this file to a backup before you, or the system, inadvertently deletes the file. You can view most of the information about your installation on one of the other virtual terminals maintained during the installation.
CERTIFICATION OBJECTIVE 3.08
Viewing Boot Time Information
There are actually many processes running and many parts to the installation. The system logs everything to an installation log file and separates related information between four of the five virtual console screens supported during the installation.
The Console Installation Output Screens
When you start the installation, you are on the first virtual console, which can be accessed using alt-f1. A bash shell is on the second, the installation message log is on the third, kernel messages are on the fourth, and the output of mke2fs on each file system is displayed. If you want to see the other screens, you can press the following key sequences in any order at any time:
alt-f1
Installation display (this is what you normally see, all others are FYI)
alt-f2
Bash shell gives you access to limited system information
alt-f3
The Installation message log is displayed
alt-f4
Displays all kernel messages
alt-f5
Installation displays partition formatting
Note: The partition formatting display includes the alternate superblocks. In an emergency situation where a file system disk is corrupt and cannot be repaired by /sbin/fsck, the check program may want to try an alternate superblock. These are usually a multiple of some block size, like 8K. Block 8192 ends the first 8K, so 8193 is the next block and is a duplicate copy of the primary superblock. This alt-f5 virtual terminal will provide the list of alternate superblock numbers. Superblocks contain the inode information and used bit block map, amongst other things. You can also get a listing of the internal file system information using the dumpefs program, as illustrated in the following sample screen output. The first command line lists the file system characteristics of the hda5 partition:
===========================================================
[root@rh6laptop /root]# dumpe2fs /dev/hda5 | head -5
dumpe2fs 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 57a1b50a-6f62-11d3-9656-c2da53691d05
Filesystem magic number: 0xEF53
[root@rh6laptop /root]#
==============================================================
Using page up/page down at the Virtual Consoles
Another nice feature of Linux virtual terminals is that you can go back and forth through previous pages that have scrolled off the screen by using shift-pgup and shift-pgdn. Although only a few more lines are available, the added feature is still very useful and is available at any time during system operation.
CERTIFICATION OBJECTIVE 3.09
The Bootup Messages in dmesg
The file /var/log/dmesg contains boot messages duplicated from the console output as seen during each bootup. These messages contain hardware information, process initialization, and sequencing information to name a few:
=============================================================
[root@linux6 /root]# head -7 /var/log/dmesg
Linux version 2.2.5-15(root@porky.devel.redhat.com)(gcc version egcs-2.91.66 1
9990314/Linux (egcs-1.1.2 release)) #1 Mon Apr 19 22:21:09 EDT 1999
Detected 199964089 Hz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 398.95 BogoMIPS
Memory:62836k/65536kavailable(996k kernel code,412k reserved,928k data,60k init)
VFS: Diskquotas version dquot_6.4.0 initialized
CPU: Intel Pentium MMX stepping 03
?
autorun ...
... autorun DONE.
VFS: Mounted root (ext2 filesystem) readonly.
change_root: old root has d_count=1
Trying to unmount old root ... okay
Freeing unused kernel memory: 60k freed
Adding Swap: 72256k swap-space (priority -1)
[root@linux6 /root]#
=============================================================
CERTIFICATION OBJECTIVE 3.10
Validating the Installation
After the installation is done, the installation script shuts down and reboots the machine. At this point, if a Workstation, Laptop, or Custom installation with X-Window was performed, the system defaults to start in runlevel 5, which is the X-Window login screen. A server installation, meanwhile, defaults to runlevel 3, which does not start X by default.
If your X-Window server is not configured properly, you can press ctrl-alt-f1 to go back to a text-based login screen.
You must log in to the system as root. Then you can force the system to reinitialize back to runlevel 3, the text-based login level, where you can fix the X configuration and then go back to runlevel 5. All three steps are shown in the following screen output sample:
=============================================================
[root@linux6 /root]# init 3 # goes back to multi-user mode, no X
[root@linux6 /root]# Xconfigurator # 'wizard' to set up X,
# NOTE: need video card type, memory and display type
[root@linux6 /root]# init 5 # multi-user mode with X on screen
[root@linux6 /root]#
=============================================================
Your runlevel 5 initial screen will show the Red Hat logo and a login screen. Once you have validated your login with a password, the GNOME system will initialize the desktop environment and display a screen something like Figure 3-30.
Figure 3-30:
The X-Window system GNOME desktop
Alternatively, you might have selected the KDE Desktop, which would give you a display similar to Figure 3-31.
Figure 3-31:
The Kool desktop environment for Red Hat Linux
CERTIFICATION OBJECTIVE 3.11
Logging In as root
In any runlevel, you can log in using the default superuser account known as root. This is the only privileged account on the system after installation and has full privileges to do anything to the system. This account should only be used for system administration, and you should create alternate accounts for users to log in with. Some installations require one alternate account be created.
Part of the installation script includes the setting of the root password. The root user is the normal system administrator or superuser account within Linux and most UNIX systems. There is nothing special about this name; you can change it to anything. Changing it, in fact, is a good security idea. A more devious security idea is to assign the root account a useless UID and GID, like 65535/65535, which has access to nothing. This provides hackers with hours of fun trying to break into a useless login account. Having a backdoor account is also a good idea. This is an alternate root type account with a hard to guess name and password combination.
Caution: Changing the root account name or the root home directory location may break some applications, administration scripts, or future installation scripts. This is part of the price of security: more work on your part to maintain a higher level of security. You must decide which is more important: security or ease of management.
During installation, you can see a copy of the messages going into the dmesg file on the third console. Press alt-f3 to access this terminal session. You can only look at the output. Use shift-pgup and shift-pgdn to page up and down through the text (note: this has a limited number of retained lines, so you may not be able to see everything).
CERTIFICATION OBJECTIVE 3.12
How Do You Know Whether Your Hardware Is Supported?
Chances are, your hardware is supported, somewhere, somehow. Assume it is, and if in doubt, try some of the generic options for the device. A generic option might be a US Robotics or Hayes compatible modem, generic VGA or SVGA video card, a general multisync monitor, and so forth.
When your hardware is not supported directly from the Red Hat CD-ROM, you have a couple of options. You can search the Internet for information, or get different hardware. Rarely does general hardware fail to work since Linux runs on almost every known CPU and on almost all hardware six months older than the release date of the software. Brand new technology is unlikely to be supported, and non-name brand laptops are usually a nightmare.
This should not be a surprise. Most major brand name machines are directly supported, and most of their models from the last year or two should work. The operative word is should. Nothing is guaranteed. However, the many laptops that have Red Hat Linux installed attest to the high probability of it working with your hardware. If you want to see if it has already been tested, check the Red Hat Web site for the latest list of tested hardware.
http://www.RedHat.com/hardware
Keeps an up-to-date compatibility list
Laptops are notoriously full of proprietary hardware. There is a special Web site that keeps track of X-Window setups for all kinds of laptops, both new and old, including top brands, and some not so well-known name brands as well.
http://www.XFree86.org/cardlist.html
Has more complete X information
With all that said, there are a few other locations on the Internet where you can dig up installation and distribution information for funny, new, rare, and noncommercial hardware. There is even a special version of Linux for a Palm Pilot. You just have to do a little hunting on the Internet to find what you need.
Installation Complete
The information in this chapter is all you really need to know to get started. There's not much to know really, unless you have some bizarre equipment, want to customize the installation in funky ways, or have never partitioned a disk before. But if you get through all that, congratulations, you are well on your way to being a guru!
CERTIFICATION OBJECTIVE 3.13
Sample Installation Exercises
The following exercises are meant to provide you with a step-by-step set of progressively more complex installation exercises that cover everything from basic workstations to very specific and advanced server installations.
Warning: You should do these exercises on test machines only.
Introduction to Installation Exercises
All these exercises assume you have a basic PC available at your disposal to work with as a learning station. You do not need a network connection, nor do you need to know how to configure X for these exercises-you can simply select the default answers in most cases.
These exercises are designed to provide progressive development to help further your knowledge about installing Linux. A Workstation and Server installation will do all the disk partitioning for you. In these exercises, you will be asked to configure the installation for a specific usage, and customize the disk partition table to meet the needs of the intended usage. This will require that you do a Custom installation in all but one of the exercises.
These exercises also assume your machine boots from the floppy during a normal reboot, that there is no pertinent information on these test machines, and that you realize all data will be overwritten on these machines. |
|