Linux install from partition
Linux makes more effective use of PC hardware than MS-DOS, Windows or NT, and is accordingly less tolerant of misconfigured hardware. There are a few things you can do before you start that will lessen your chances of being stopped by this kind of problem.
First, collect any manuals you have on your hardware — motherboard, video card, monitor, modem, etc. — and put them within easy reach.
Second, gather detailed information on your hardware configuration. One easy way to do this, if you’re running MS-DOS 5.0, or up, is to print a report from the Microsoft diagnostic utility msd.exe (you can leave out the TSR, driver, memory-map, environment-strings and OS-version parts). Among other things, this will guarantee you full and correct information on your video card and mouse type, which will be helpful in configuring X later on.
Third, check your machine for configuration problems with supported hardware that could cause an un-recoverable lockup during Linux installation.
It is possible for a DOS/Windows system using IDE hard drive(s) and CD ROM to be functional even with the master/slave jumpers on the drives incorrectly set. Linux won’t fly this way. If in doubt, check your master-slave jumpers!
Is any of your peripheral hardware designed with neither configuration jumpers nor non-volatile configuration memory? If so, it may require boot-time initialization via an MS-DOS utility to start up, and may not be easily accessible from Linux. CD-ROMs, sound cards, Ethernet cards and low-end tape drives can have this problem. If so, you may be able to work around this with an argument to the boot prompt; see theLinux Boot Prompt HOWTO for details).
Some other operating systems will allow a bus mouse to share an IRQ with other devices. Linux doesn’t support this; in fact, trying it may lock up your machine. If you are using a bus mouse, see the Linux Bus Mouse HOWTO , for details.
If possible, get the telephone number of an experienced Linux user you can call in case of emergency. Nine times out of ten you won’t need it, but it’s comforting to have.
Budget time for installation. That will be about one hour on a bare system or one being converted to all-Linux operation. Or up to three hours for a dual-boot system (they have a much higher incidence of false starts and hangups).
(This step is only needed if you can’t boot from a CD-ROM.)
Your Linux CD-ROM may come with installation aids that will take you through the process of building boot, root, and rescue disks with interactive prompts. These may be an MS-DOS installation program (such as the Red Hat redhat.exe program) or a Unix script, or both.
If you have such a program and can use it, you should read the rest of this subsection for information only. Run the program to do actual installation — its authors certainly knew more about the specific distribution than I, and you’ll avoid many error-prone hand-entry steps.
More detailed information on making bootdisks, see the Linux Bootdisk HOWTO .
Your first step will be to select a boot-disk image to fit your hardware. If you must do this by hand, you’ll generally find that either (a) the bootdisk images on your CD-ROM are named in a way that will help you pick a correct one, or (b) there’s an index file nearby describing each image.
Next, you must create floppies from the bootdisk image you selected, and optionally from the rescue disk images. This is where the MS-DOS program RAWRITE.EXE comes into play.
Next, you must have two or three high-density MS-DOS formatted floppies. (They must be of the same type; that is, if your boot floppy drive is a 3.5″ drive, both floppies must be high-density 3.5″ disks.) You will use RAWRITE.EXE to write the bootdisk images to the floppies.
Invoke it with no arguments, like this:
Answer the prompts for the name of the file to write and the floppy to write it to (such as A:). RAWRITE will copy the file, block-by-block, directly to the floppy. Also use RAWRITE for the root disk image (such as COLOR144). When you’re done, you’ll have two floppies: one containing the boot disk, the other containing the root disk. Note that these two floppies will no longer be readable by MS-DOS (they are «Linux format» floppies, in some sense).
You can use the dd(1) commands on a UNIX system to do the same job. (For this, you will need a UNIX workstation with a floppy drive, of course.) For example, on a Sun workstation with the floppy drive on device /dev/rfd0 , you can use the command:
$ dd if=bare of=/dev/rfd0 obs=18k
You must provide the appropriate output block size argument (the `obs’ argument) on some workstations (e.g., Suns) or this will fail. If you have problems the man page for dd(1) may be be instructive.
Be sure that you’re using brand-new, error-free floppies. The floppies must have no bad blocks on them.
Note that you do not need to be running Linux or MS-DOS in order to install Linux. However, running Linux or MS-DOS makes it easier to create the boot and root floppies from your CD-ROM. If you don’t have an operating system on your machine, you can use someone else’s Linux or MS-DOS just to create the floppies, and install from there.
On most used systems, the hard drive is already dedicated to partitions for MS-DOS, OS/2, and so on. You’ll need to resize these partitions in order to make space for Linux. If you’re going to run a dual-boot system, it’s strongly recommended that you read one or more of the following mini-HOWTOS, which describe different dual-boot configurations.
Even if they are not directly applicable to your system, they will help you understand the issues involved.
Boot the MS-DOS system floppy.
Run FDISK , possibly specifying the drive to modify (such as C: or D:).
Use the FDISK menu options to delete the partitions which you wish to resize. This will destroy all data on the affected partitions.
Use the FDISK menu options to re-create those partitions, with smaller sizes.
Exit FDISK and re-format the new partitions with the FORMAT command.
Restore the original files from backup.
Note that MS-DOS FDISK will give you an option to create a «logical DOS drive». A logical DOS drive is just a logical partition on your hard drive. You can install Linux on a logical partition, but you don’t want to create that logical partition with MS-DOS fdisk. So, if you’re currently using a logical DOS drive, and want to install Linux in its place, you should delete the logical drive with MS-DOS FDISK, and (later) create a logical partition for Linux in its place.
The mechanism used to repartition for OS/2 and other operating systems is similar. See the documentation for those operating systems for details.
After repartitioning your drive, you need to create partitions for Linux. Before describing how to do that, we’ll talk about partitions and filesystems under Linux.
Linux requires at least one partition, for the root filesystem , which will hold the Linux kernel itself.
You can think of a filesystem as a partition formatted for Linux. Filesystems are used to hold files. Every system must have a root filesystem, at least. However, many users prefer to use multiple filesystems—one for each major part of the directory tree. For example, you may wish to create a separate filesystem to hold all files under the /usr directory. (Note that on UNIX systems, forward slashes are used to delimit directories, not backslashes as with MS-DOS.) In this case you have both a root filesystem, and a /usr filesystem.
Each filesystem requires its own partition. Therefore, if you’re using both root and /usr filesystems, you’ll need to create two Linux partitions.
In addition, most users create a swap partition , which is used for virtual RAM. If you have, say, 4 megabytes of memory on your machine, and a 10-megabyte swap partition, as far as Linux is concerned you have 14 megabytes of virtual memory.
When using swap space, Linux moves unused pages of memory out to disk, allowing you to run more applications at once on your system. However, because swapping is often slow, it’s no replacement for real physical RAM. But applications that require a great deal of memory (such as the X window system) often rely on swap space if you don’t have enough physical RAM.
Nearly all Linux users employ a swap partition. If you have 4 megabytes of RAM or less, a swap partition is required to install the software. It is strongly recommended that you have a swap partition anyway, unless you have a great amount of physical RAM.
The size of your swap partition depends on how much virtual memory you need. It’s often suggested that you have at least 16 megabytes of virtual memory total. Therefore, if you have 8 megs of physical RAM, you might want to create an 8-megabyte swap partition. Note that there are platform-dependent limits on the size of swap partitions; see the Partition-HOWTO if you want to create a swap partition larger than 1GB.
You can find more on the theory of swap space layout and disk partitioning in the Linux Partition mini-HOWTO (http://www.linuxdoc.org/HOWTO/mini/Partition.html ).
Note: it is possible, though a bit tricky, to share swap partitions between Linux and Windows 95 in a dual-boot system. For details, see the Linux Swap Space Mini-HOWTO .
Gotcha #1: If you have an EIDE drive with a partition that goes above 504MB, your BIOS may not allow you to boot to a Linux installed there. So keep your root partition below 504MB. This shouldn’t be a problem for SCSI drive controllers, which normally have their own drive BIOS firmware. For technical details, see the Large Disk Mini-HOWTO .
Gotcha #2: Are you mixing IDE and SCSI drives? Then watch out. Your BIOS may not allow you to boot directly to a SCSI drive.
Besides your root and swap partitions, you’ll want to set up one or more partitions to hold your software and home directories.
While, in theory, you could run everything off a single huge root partition, almost nobody does this. Having multiple partitions has several advantages:
It often cuts down the time required for boot-time file-system checks.
Files can’t grow across partition boundaries. Therefore you can use partition boundaries as firebreaks against programs (like Usenet news) that want to eat huge amounts of disk, to prevent them from crowding out file space needed by your kernel and the rest of your applications.
If you ever develop a bad spot on your disk, formatting and restoring a single partition is less painful than having to redo everything from scratch.
On today’s large disks, a good basic setup is to have a small root partition (less than 80 meg), a medium-sized /usr partition (up to 300 meg or so) to hold system software, and a /home partition occupying the rest of your available space for home directories.
You can get more elaborate. If you know you’re going to run Usenet news, for example, you may want to give it a partition of its own to control its maximum possible disk usage. Or create a /var partition for mail, news, and temporary files all together. But in today’s regime of very cheap, very large hard disks these complications seem less and less necessary for your first Linux installation. For your first time, especially, keep it simple.
The first step is to boot the bootdisk you generated. Normally you’ll be able to boot hands-off; the boot kernel prompt will fill itself in after 10 seconds. This is how you’ll normally boot from an IDE disk.
What’s actually happening here is this: the boot disk provides a miniature operating system which (because the hard drive isn’t prepared) uses a portion of your RAM as a virtual disk (called, logically enough, a `ramdisk’).
The boot disk loads onto the ramdisk a small set of files and installation tools which you’ll use to prepare your hard drive and install a production Linux on it from your CD-ROM.
(In times past this was a two-stage-process, involving a second disk called a `root disk’; this changed when kernel modules were introduced.)
By giving arguments after the kernel name, you can specify various hardware parameters, such as your SCSI controller IRQ and address, or drive geometry, before booting the Linux kernel. This may be necessary if Linux does not detect your SCSI controller or hard drive geometry, for example.
In particular, many BIOS-less SCSI controllers require you to specify the port address and IRQ at boot time. Likewise, IBM PS/1, ThinkPad, and ValuePoint machines do not store drive geometry in the CMOS, and you must specify it at boot time. (Later on, you’ll be able to configure your production system to supply such parameters itself.)
Watch the messages as the system boots. They will list and describe the hardware your installation Linux detects. In particular, if you have a SCSI controller, you should see a listing of the SCSI hosts detected. If you see the message
Then your SCSI controller was not detected, and you will have to figure out how to tell the kernel where it is.
Also, the system will display information on the drive partitions and devices detected. If any of this information is incorrect or missing, you will have to force hardware detection.
On the other hand, if all goes well and your hardware seems to be detected, you can skip to the following section, «Loading the root disk.»
To force hardware detection, you must enter the appropriate parameters at the boot prompt, using the following syntax:
There are a number of such parameters available; we list some of the most common below. Modern Linux boot disks will often give you the option to look at help screen describing kernel parameters before you boot.
hd=cylinders,heads,sectors Specify the drive geometry. Required for systems such as the IBM PS/1, ValuePoint, and ThinkPad. For example, if your drive has 683 cylinders, 16 heads, and 32 sectors per track, enter