For this discussion you should understand what a partition is and what a file system is.
It is possible to leave your existing hard drive (almost) unchanged and install Linux onto a second hard drive. If you computer's BIOS understands EIDE drives you may even be able to install Linux onto a third or fourth hard drive. The exact method for doing this varies by distribution, but it is normally done in the setup utility. When given the opportunity to create partitions for Linux, simply create them on whatever drive you want to hold your Linux installation.
The trick to this (you knew there was a trick, didn't you?) is how to get the system to boot your new Linux installation. During Linux Setup, you should be given the opportunity to install LILO, the LInux LOader. LILO is responsible for finding and loading your Linux installation at boot time. It can also be used to launch Windows or another operating system instead. In order to work properly, LILO must be installed on your first hard drive (regardless of where Linux lives). It is not necessary to repartition or alter your existing partitions in order to install LILO. The upcoming article on Configuring LILO should give all the details needed here.
Most factory installed operating system installations take up all the space on your hard drive, leaving no room for installing Linux. The first (and most difficult) thing we must do before installing Linux is to clear some space where Linux can live, because Linux needs to have some partitions of it's own. That's not a problem if you want to just delete your old operating system, but most folks want or need to keep their old files.
Unfortunately, most operating systems do not have the ability to resize their partitions. Ordinarily this would mean that to make room on the drive you would have to backup all your data, delete your existing partition (and everything on it) and then create partitions of smaller sizes and reinstall. You can still do this, but there is an easier way if you are using DOS or Windows.
Most Linux distributions come with a special tool to allow you to resize (or rather, divide) hard drive partitions. It is called FIPS, the First (non-destructive) Interactive Partition Splitter, and it is normally found on your Linux CD in a directory called dosutils. You will also need a blank, formatted floppy disk to use as a boot disk. For most older Windows installations, that should be all. However, if you have Windows 98 or a recent version of Windows 95 with a large hard drive (bigger than 2GB), you may need some additional tools if you are using the FAT32 file system.
To check what type of file system Windows is using, open Windows Explorer, right click on the C: drive and choose Properties. On the General tab, if you see "File System: FAT32" then you are going to need some additional tools to support this newer file system.
To adjust your partitions, you will need version 2.0 or higher of FIPS. If the version included with your Linux distribution is older than this, the latest version is available for download from the FIPS home page at http://www.igd.fhg.de/~aschaefe/fips/ (which seems to have disappeared from the Internet, unfortunately). If you want to share files between Windows and Linux (a very good idea), you will also need to have version 2.0.34 or higher of the Linux kernel. Below is a list of Linux distributions known to support FAT32. If your distribution does not include support, you will need to upgrade your kernel. Upgrading your kernel is well beyond the scope of this article, so check the documentation included with your distribution for information about how to do that.
|
Distribution |
Earliest Version w/FAT32 support in kernel |
|
Red Hat Linux |
Version 5.1 (kernel 2.0.34) |
|
S.u.S.E Linux |
Version 5.3 (kernel 2.0.35) |
|
Debian GNU/Linux |
Version 2.0 (kernel 2.0.34) |
|
Caldera OpenLinux |
Version 1.3 (kernel 2.0.35) |
|
Slackware Linux |
Version 3.6 (kernel 2.0.35) |
Before you can resize/split your Windows partition, there are a few steps you must take to ensure that the process goes smoothly.
First, delete any files from your hard drive that are not being used, for example any old files in the C:\windows\temp folder, and then empty your recycle bin.
Next you must check your file system for errors using Scandisk. To run Scandisk, open Windows Explorer, right click on the C: drive and choose Properties. On the Tools tab you will see a button called Check Now. Press this button and the Scandisk interface should appear. (Alternate method: Click Start -> Programs -> Accessories -> System Tools -> Scandisk.) For "Type of Test" choose Standard. Check the box next to Automatically Fix Errors. Then click "Start" in the Scandisk window.
When it is finished, it would be wise to note how much space is available on the disk. If this number is less than the space required to load Linux (check your distribution's documentation for space requirements), you'll need to delete more files or uninstall some software to make room.
Finally, you must defragment your hard drive.The purpose of this step is to consolidate all your data at the "front" of the drive so that there is room at the "back" of the drive for your new partition. To run Defrag, return to the C: Properties dialog. Here we find another button called Defragment Now. Press this button to run the Disk Defragmenter. (Alternate method: Click Start -> Programs -> Accessories -> System Tools -> Disk Defragmenter.) When it starts, click the Advanced button and make sure the Defragmentation Method is set to "Full defragmentation (both files and free space)". Then press Start to begin the defrag process. Depending on the size of your drive and the amount of fragmentation, this could take a few minutes or several hours.
Before using FIPS you must read the FIPS.DOC text file which accompanies the program. The use of the program is not entirely obvious and you may need the background information the documentation provides. Also, when running FIPS you should carefully read all the messages it displays. They will provide valuable information on the steps you will need to take next. Most importantly, FIPS comes with no warranty. Although it has been used with safety many times, there is always the chance that it could damage the data on your hard drive. If you value your data, back it up before you begin.
For safety, you'll need to create a DOS or Windows boot disk to
work from. To do this in Windows, click Start -> Settings -> Control
Panel. Double click "Add/Remove Programs" and select the
tab called Startup Disk. Press the button and follow the
instructions. If you're working from a DOS prompt, type the command
format /s a:
Then you'll need to copy the working files for FIPS to the floppy. The files FIPS.EXE, RESTORRB.EXE, and ERRORS.TXT are mandatory. You may also want to copy the documentation files included with FIPS. When your data is backed up and you are ready to go, restart your computer and boot from the new floppy.
When you arrive at the A:\>; prompt, type FIPS and press enter. The first thing you will see is a warning about using FIPS in multitasking environments like Windows. Since we booted from a floppy we are safe here, so press enter. Next FIPS will analyze your existing partitions. You may find that it pauses for a long time at "Checking FAT" and "Searching for Free Space". This is perfectly normal, so just wait. The bigger your hard drive, the longer this will take. When FIPS is done with its analysis it will display the results. You may get a warning of something wrong with your FAT. If you read the message carefully, you will find that this is normal with large hard drives and will not prevent FIPS from working properly. (Remember, always read the messages!)
Next FIPS will show you how it plans to split the existing partition and you will have the opportunity to make changes. Do not just hit enter! By default, FIPS will take all of the available free space for the new partition it creates, leaving your Windows partition with no free space at all! Windows will not run if it has no free drive space, so you must adjust the partitions.
Use the Up and Down Arrow keys to make large changes (10 cylinders at a time) and the Left and Right Arrow keys for small adjustments (1 cylinder at a time). The size of the existing partition is shown on the left, and the size of your new empty partition is on the right. In the middle is the cylinder number where the split will take place. I left about 1500MB for my own Windows partition. You should adjust yours based on your needs, but I would recommend using at least 1024MB for for each operating system.
When you are satisfied with your new partition plan, press enter. FIPS displays information about the new partitions and asks permission to write it to disk. Your hard drive has not been altered at this point. You may choose to write this configuration to disk, or to re-edit the partition table, which starts the process over from the beginning. On my machine, when I chose to re-edit I received an error message that said FIPS couldn't find some files it needed. If this happens to you, just press Control-Alt-Delete to reboot from the floppy and start over. This did not cause me any trouble.
When you choose to write the new partitions, FIPS will offer to make a backup of your existing boot sector. Unless you like living dangerously, you should definitely do this. The backup file it creates is only 1k in size, and it will be invaluable if anything goes wrong.
After FIPS completes its work it will display another message instructing you to run scandisk on your old partition. I found that Windows will sometimes miscalculate the used and free space on your drive after using FIPS, and Scandisk will correct this problem. If you choose to restore your original partition scheme using the RESTORRB utility, you should run Scandisk after this as well.
After FIPS was done I received another error, this one said Memory Allocation Error, Unable to Load COMMAND.COM. If you see this, just press Control-Alt-Delete to reboot and all should be well. Your hard drive should be unaffected by this.
At this point you should have two partitions on your hard drive where only one existed before. Both partitions will be designated as "Primary" partitions. We are almost done. The second partition on your hard drive, the one that FIPS created from empty space in your first partition, is now occupying the space where we want to install Linux. The Linux setup utility will want to create its own partitions in this space, so we need to delete this second partition. This can be done now by booting from our DOS boot floppy and running FDISK. Be careful! Do not delete the the first partition. That is where Windows lives. If you delete that partition, all your data and programs will be lost! If you prefer, you can wait and use the Linux setup utility to delete the extra partition, but I find it better to get it out of the way early.
Now you have freed the space you need to install Linux, and you are ready to run Linux setup.
© Copyright 1998-2010 by Vincent Veselosky.
Unless otherwise noted, the text content of this work is licensed under the Creative Commons Attribution-Share Alike 2.5 License.
Please see the Control-Escape License page
for details.