Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux+ Certification Bible.pdf
Скачиваний:
48
Добавлен:
15.03.2015
Размер:
3.78 Mб
Скачать

146 Part II Installation

Package selection and installation

Finally, select only those packages that are required for the machine to provide the desired service. By limiting the number of installed packages, the number of potential security vulnerabilities will also be limited. Therefore, when installing a workstation, don’t install everything because doing so opens the systems to the security risk of a Web server — even if the workstation is not using the software to provide Web pages.

A Dual-Boot Installation of Linux

Linux can accomplish most tasks quite easily, but some software programs will only run on a different operating system. In these situations, you may want to create a system that will be able to use two operating systems. This is called a dual-boot system, which Linux supports very well. You will probably encounter some issues when creating a dual-boot system, but planning can resolve these issues. The most important rule to follow when creating a dual-boot system is to use a method that doesn’t destroy the data already existing on the HDD. The best way to accomplish this is to create an installation path. Some systems work extremely well with Linux, but others are not so Linux-friendly. The ability to establish a dual-boot system is a growing need and a skill that any installer should consider learning.

Linux with Microsoft Windows

Linux can be installed with most Microsoft products fairly easily, which is due to the ability of Linux to use the FAT16 and FAT32 partition types.

Linux does not support FAT32 before the 2.0.34 kernel release. If you are using an older version of Linux, verify that the kernel is at least at this level if you want FAT32 support. This level of support allows operating systems to share files.

These types of partitions are used for Microsoft Windows 9x, ME, DOS, and Windows 3.1, and allow LILO to be installed with options to boot both Linux and these Microsoft products. The task of creating a dual-boot system on a PC with Microsoft Windows 9X already installed is fairly straightforward:

1.Begin installing Linux on a Microsoft Windows 9X system.

2.When prompted, place LILO in the MBR or in the Linux root partition’s boot sector.

3.If LILO is installed in the MBR, it will read the existing operating system partition(s) and create a DOS or Windows menu item.

Chapter 5 Advanced Installation 147

4.If it is installed on the root partition of Linux, the root partition of Linux must be set as the active partition to boot from.

Before attempting to create any dual-boot system (or before installing or using another operating system, partitioning software, or boot manager), be sure to back up all data on the existing operating system. If the configuration fails or is done improperly, the existing operating system may be rendered useless and all data may be lost.

The LILO menu item allows the previously installed version of Microsoft Windows to be selected when booting the system. Sometimes, however, this fails to work, so the root user in Linux — the file /etc/lilo.conf — must be edited. The file looks something like this:

boot=/dev/hda

map=/boot/map

install=/boot/boot.b prompt

timeout=50

message=/boot/message linear

default=linux

image=/boot/vmlinuz-2.4.2-2 label=linux

read-only root=/dev/hda7

You will need to add lines to the file to enable the ability to boot a separate Windows partition. Before adding these in, you will need to ascertain which hard drive and partition contains Windows. Table 5-2 outlines the way that Linux identifies the various hard drive types.

Table 5-2

Linux HDD Identification

 

 

Disk Locations

Linux Disk Identification

 

 

Primary IDE controller-drive 0 or Master

/dev/hda or hda

 

 

Primary IDE controller-drive 1 or Slave

/dev/hdb or hdb

 

 

Secondary IDE controller-drive 0 or Master

/dev/hdc or hdc

 

 

Secondary IDE controller-drive 1 or Slave

/dev/hdd or hdd

 

 

SCSI Controller-SCSI ID 0

/dev/sda or sda

 

 

SCSI Controller-SCSI ID 1

/dev/sdb or sdb

 

 

SCSI Controller-SCSI ID 2

/dev/sdc or sdc

 

 

148 Part II Installation

This hard drive identification table is an excellent place to start when you are attempting to determine hard drive naming in Linux. This table is only a basic one, however, because it only takes into account single IDE or SCSI controllers. The partitions contained on the disk are numbered 1-X, where X is the total number of partitions. Therefore, in the preceding example of the /etc/lilo.conf, the hard drive is /dev/hda or the master Primary IDE controller. Microsoft Windows 9X is installed on the first partition of this drive, or hda1. To add Microsoft Windows to the LILO menu, simply add the following lines:

other=/dev/hda1

label=windows

You can boot Microsoft Windows from LILO by typing windows at the LILO boot prompt. This method also works if Microsoft Windows 9X has been added to a Linux PC. You may have to reinstall LILO to be able to boot the system, but this is a situation that you are prepared for if you created the bootable diskette during the installation of Linux. From this diskette, you are capable of restoring LILO if it was damaged during the installation of Microsoft Windows.

Linux with Microsoft Windows NT and 2000

Dual booting with Windows NT and 2000 is more complicated. If you use a FAT16 or FAT32 partition for the Microsoft Windows NT or 2000 operating system, then the method used for Microsoft Windows 9X should work. If, however, NTFS is the file system that you use, the NT boot loader is not compatible with LILO in the MBR. This means that LILO must not be installed in the MBR or the Microsoft operating system won’t boot. To get around this situation, install LILO in the root partition of Linux and on a diskette. Complete the installation of Linux and reboot the system with the diskette that you used to boot Linux. After you are in Linux, use the following commands to copy a binary image of the boot sector to a blank diskette:

mount -t msdos /dev/fd0 /mnt/floppy

dd if=/dev/hda5 bs=512 count=1 of=/mnt/floppy/linux.bin

Then, remove the floppy and reboot the system into Microsoft Windows NT or 2000. You will need to edit the file boot.ini at this point. Open boot.ini in a plain text editor, such as notepad, and add the following line:

c:\linux.bin=”Linux”

Save the file boot.ini and exit the text editor. Then, copy the file linux.bin from the floppy to the HDD in the root directory of the Microsoft Windows HDD. This allows the startup menu of Microsoft Windows NT or 2000 to display the Linux line and gives it the linux.bin file, which contains directions detailing where to boot this operating system. This should allow Linux to dual-boot with Microsoft Windows NT or 2000.

Chapter 5 Advanced Installation 149

Linux and Solaris

You can easily dual-boot Linux with Solaris. To create a dual-boot between Linux and Solaris:

1.Install Linux on the system. Create partition 8 for Linux root, and partition 7 for Linux swap, leaving partition 1 for SunOS root and partition 2 for SunOS swap.

2.Install SILO (Sparc Improved Boot Loader), which is the LILO equivalent in the Sun platform world, in the Linux root partition.

3.Allow SILO to create an entry in nvalias to allow the system to boot.

4.Boot the system to verify that the Linux installation was successful.

5.Halt the system and proceed to install Solaris. When the Solaris installer asks if data should be preserved, do so to save the Linux partitions.

6.Continue to install Solaris in partition 0 (the first partition that was created).

7.Answer “yes” when the installation program inquires about making the new root partition the default boot in NVRAM. Then continue the installation as usual. After the installation is complete, the system prompts you to be rebooted into Solaris. Do this to verify the installation of the Solaris operating system, and then halt the system.

8.Enter the “show-disks” to list the disk paths that are needed to dual-boot the system. You also need the path formats for the disk, which you can obtain with the “devalias” command. With this information, enter the following to allow the system to dual-boot on an IDE system with one disk:

nvalias linux <disk_path_from_above>@0,0:h nvalias solaris <disk_path_from_above>@0,0:a

(to boot Solaris by default) setenv boot-device disk:a

(to boot Linux by default) setenv boot-device disk:h

This configuration allows Linux to dual-boot with the Solaris operating system.

Linux and other operating systems

Linux can be configured in many ways to dual-boot with other operating systems. The one major responsibility to keep in mind is to always back up the data on the existing operating system to protect it — just in case anything goes wrong. Dualbooting a system with Linux and other operating systems allows you to run multiple operating system on one computer. This is helpful if you have certain applications or tools that only can run in one particular operating system.