-->
Previous Table of Contents Next


Installing the Linux Partitions

The Linux installation process starts when you boot your system from the boot floppy. After the kernel has loaded, you are prompted to remove the boot floppy and insert the root floppy. When the root filesystem has been read, you are either sent directly to an installation script or presented with the login prompt. Log in as root. No password is required because none has been added to the system.

The first step is to set up the disk partitions using fdisk, if you haven’t already done so. If you have more than one hard drive, you can place your Linux partitions on either drive. If you are planning to keep a DOS partition, though, make sure it is the first partition on the first drive. Linux isn’t so picky. If you want to boot Linux cleanly, place a Linux filesystem on the first drive. You can also create Linux filesystems on the second drive. Linux swap partitions can be on either drive, although it is a good idea to keep it on the first drive with the first filesystem.

Linux’s fdisk

Linux’s fdisk program is different from the one in DOS, so you should check the menus frequently to determine the proper commands. You invoke Linux’s fdisk in the same manner as DOS’s. If you don’t specify a drive, fdisk assumes the first one in the system. Otherwise, you can specifically indicate which disk drive to partition by giving the device name on the command line, as in the following, which invokes fdisk for the second drive:


fdisk /dev/hdb


Warning:  
You should not use Linux’s fdisk utility to create partitions for operating systems other than Linux. If, for example, you want a DOS partition on your disk, create it with DOS’s fdisk. Linux does not write the partition table properly for other operating systems!

If your system has IDE, ESDI, or RLL drives, the first is /dev/hda and the second /dev/hdb. SCSI drives are /dev/sda, /dev/sdb, and so on. Because seven SCSI drives can be supported on a single controller, you could have up to /dev/hdg. (You can go even higher with another controller card, but few Linux systems require this!)

As mentioned earlier, Linux’s fdisk commands are different than the fdisk commands for DOS. Essentially, the commands you need to run Linux’s fdisk utility are as follows:

  d   Deletes an existing partition
  l   Lists all known partition types
  n   Creates a new partition
  p   Displays the current partition table
  q   Quits fdisk without saving changes
  t   Changes a partition’s type code
  v   Verifies the partition table
  w   Writes current partition table to disk and exits

The process for setting up a partition is to first examine the partition table to make sure any existing partitions are correct. If you have a DOS partition on your drive, it should show in the partition table. If you created Linux swap and filesystem partitions when you were in DOS’s fdisk, they should appear in the partition table, too, although the partitions types will be incorrect.

Setting Up Linux Partitions

To create the Linux swap space, use the n command and give the starting sector number. Usually, this is immediately after any existing DOS partition (or other operating systems you have installed). Linux’s fdisk lets you specify the size of the partition either by supplying an end sector number or by giving a size in megabytes. The latter is much easier to work with, so just enter the size in megabytes that you want to set your Linux swap space partition to be (remember there is a maximum of 16MB for the swap space size). The format is usually +XXM, where XX is the number of megabytes (such as +16MB). You can also specify kilobytes, but you don’t want to create a swap partition that is less than 1MB.


Tip:  
Most older PC BIOSs cannot handle more than 1,024 cylinders on a disk drive. You may not be able to create DOS or Linux partitions or filesystems that go beyond the 1,023rd cylinder (numbering starts at zero). Some other operating systems, such as SCO UNIX, enable you to use anything beyond the 1,024 limit. Linux can use partitions beyond the 1,024 limit, but can’t boot from them. If you have a disk drive that has more than 1,023 cylinders, make sure your primary Linux partition ends before 1,023. You can create extra partitions following that cylinder and mount them as second filesystems.

The fdisk program asks you whether you want to create a primary or an extended partition. If you are creating a primary partition, it wants the number (one to four—remember a DOS partition has to be number 1 to boot). In most cases, you should create only primary partitions, unless you have a large disk drive. Extended partitions can be used to add logical drives inside them, as DOS creates logical drives. In Linux, extended partitions are not the same as extended filesystems!

After you have created the Linux partition, you should assign its type. Some versions of fdisk prompt for this right away; others let you select the option to assign filesystem types from the fdisk menu. In either case, the letter l displays all known filesystem types. Choose the one that designates a Linux swap space (number 82) and check the partition table. Your Linux swap space partition should have the correct size and partition type displayed. Actually, Linux doesn’t care about the partition type numbers and ignores them completely. Some other operating systems do note them, however, so it’s a good practice to label them correctly to prevent future problems. It also helps you keep the partition table nicely organized.


Previous Table of Contents Next