-->
Previous Table of Contents Next


Setting Up Partitions

Because the versions of fdisk in DOS, OS/2, UNIX, and Linux all differ, we won’t bother explaining all the steps. The fdisk utility is very easy to use, so if you have used PC machines for a while, this will not be a problem for you. Remember that fdisk destroys existing data on your disk! You can set up your Linux disk partitions either from DOS or from within Linux. It really doesn’t matter which approach you use, although the DOS fdisk program is a little easier to use than Linux’s. If you are using DOS’s fdisk to repartition a DOS area on your drives, you might as well use it to set up the Linux swap space and filesystem partitions, too.

To set up partitions for Linux, remove any existing partitions first (unless you want to keep them as they are). If you intend to use DOS on the same system as Linux, DOS should be the first partition on the disk so it can boot. (There are a few ways to get by this using LILO, but it is still a good rule to leave DOS as the first partition.) If you are keeping an existing DOS partition, leave at the first partition as DOS.

You should create a DOS boot disk, which can reformat and transfer the DOS kernel to the hard drive, regardless of whether you are leaving an existing DOS partition or creating a new one. To create the boot disk, use this DOS command (assuming A: is the drive the disk is in):


format a: /s

The /s option transfers the operating system kernel. Next, copy the utilities FDISK, FORMAT, SYS, and CHKDSK to the boot floppy. You should also copy an editor, such as EDIT, as well as your existing CONFIG.SYS and AUTOEXEC.BAT files (although you could rename them). This disk lets you format any new DOS partitions. Alternatively, if you are starting from scratch with a new DOS partition, you can simply reload DOS from the original disks when you’re ready to format the DOS partition.

If you are removing an existing DOS partition and re-creating a smaller one (as you would if your entire disk were DOS before Linux came into your life), follow these steps (after making a backup of your DOS data):

1.  Remove the existing DOS partition.
2.  Create a new primary DOS partition as the first partition.
3.  Make the DOS partition active.
4.  Reboot the system from your boot floppy (or DOS disks).
5.  Format the DOS partition and transfer the DOS kernel (COMMAND.COM).
6.  Restore your backup files to the DOS partition (this can be done at any time).

Next, set up the Linux swap space partition by creating a partition of the proper size. You can do this step either from DOS or when you have booted Linux from the boot and root floppies. For the sake of this chapter, it is assumed that you are setting up the partitions from DOS, although the process is the same either way.

Most versions of fdisk allow you to enter the size of the partition in megabytes, with the utility calculating the sector numbers that apply to it. Set the size of the Linux swap space to whatever size you decided, to a maximum of 16MB. Don’t make the partition active or format it! You can set up the swap space partition in an extended disk partition, but a primary partition is a better choice if your disk can support it.

Finally, create the Linux filesystem partition to be whatever size you want, or the rest of the disk if that’s the only partition missing. Again, don’t activate or format the partition. When you are running the Linux installation routine, you will identify and format the swap space and filesystem partitions properly.

Using UMSDOS

UMSDOS enables you to use an existing DOS partition to house your Linux system (not all versions of Linux support UMSDOS; in fact, most recent versions do not but older versions do). Because you are forcing Linux to use the DOS disk layout, you suffer some performance limitations compared to creating a dedicated Linux partition. On the other hand, UMSDOS lets you keep your disk drive the way it is, preventing the hassle of repartitioning and reformatting your drive. It is also a fast and easy way to install Linux if you only want to experiment for a while before installing a full system.

It is important to realize that UMSDOS does not let you run DOS and Linux at the same time. UMSDOS (UNIX in MS-DOS) only creates the Linux filesystem under the DOS formatted partition, although it is modified to allow long filenames, Linux file permissions, and more. When you start the system, you still have to choose between booting Linux or DOS as the operating system. If you start DOS, you can’t use the extended Linux filenames, although you are able to snoop around the directories. Filenames may not make much sense because of the contraction from long Linux filenames to DOS-compatible filenames, though.

The only limitation about UMSDOS, as we’ve already mentioned, is that the DOS filesystem is not designed as well as the Linux filesystem, and this causes some performance degradation. This isn’t really a major problem because most people do not notice the difference unless they are running a file-intensive application, such as X or compiling programs. You can always start with UMSDOS, and if you decide you like Linux enough, you can back up the Linux data and repartition the drive to create a true Linux filesystem.

If you want to use UMSDOS, you have to perform a few extra steps when setting up the disk. You must still create the boot and root disks, although you need a root image that supports UMSDOS. Most distributions have the root images umsds144 and umsds12 for this purpose.

When you boot Linux and it asks which partition to use for the filesystem, specify the DOS partition. UMSDOS then initializes the filesystem for you. After that, the procedure for installing the rest of Linux is the same as a dedicated Linux partition.


Previous Table of Contents Next