Disk Partitioning

 < Day Day Up > 



The first question you might be asking yourself at this point is: what, exactly, is a disk partition? Partitioning is literally the process of dividing your hard drive into one or more useable segments. Simply put, you can divide your hard drive into several logical drives. A logical drive is simply a part of your hard drive that is treated as if it were a separate drive. In other words, you can treat your hard drive as if it were several different hard drives. This is particularly useful for very large hard drives, and in cases where people wish to organize their computer more efficiently. You might have one partition that is designated for business, and another for home use or entertainment. A partition that is created to look like a separate hard drive is called a logical drive. Your computer might have only one actual hard drive, but several logical drives. Partitions and logical drives are not applicable only to Linux. All operating systems have partitions and can be divided into logical drives. Even if you are not going to partition your hard drive into multiple logical drives, you will still need to partition it. The only difference is that you will partition it into a single logical drive.

This brings us to the topic of partitioning a hard drive that will run Linux. Your hard drive must have at least one main partition. This primary partition is the starting point when your computer turns on. This is called the root partition. It must also have one swap partition. This of course brings us immediately to the question of what is a swap partition and why do you need one? A swap partition is a pretty incredible innovation. Essentially, it is a small segment of your hard drive that is set aside as a sort of backup for your PC’s memory. The way it works is rather simple. As you open up programs, they are loaded into memory. So, as you open more programs, you utilize use more and more of your memory and there is less free memory for other programs to use. When a program has been idle for a while, the program is taken out of memory and moved to this swap file. If you later activate that program, for instance by clicking on it, it is moved from the swap file portion of the hard drive back into memory. By placing it into a special segment of the hard drive, it can be more quickly reloaded into memory than if you simply loaded it off the normal hard drive partition. Thus the name “swap,” since it swaps programs from memory to a special segment of the hard drive.

All operating systems support swap partitions. The swap partition’s size should be at least equal to the amount of RAM your machine has, but no more than two and one half times the RAM. That means if you have 128 megabytes of RAM, your swap partition should be at least 128 megabytes in size but no more than 320 megabytes.

Now that you understand disk partitions, at least in a rudimentary fashion, you are ready to partition your hard drive. You will notice that the Red Hat Linux installation gives you three options. The first is to partition your hard drive automatically. You can choose this option if you have no intention of dual booting your machine.

Caution 

If you choose to automatic partition, all existing partitions will be erased and one root partition, one boot partition, and one swap partition will be created.

The second option is to use Disk Druid. Disk Druid is a graphical disk partitioning program specifically designed for Linux.

The final option is FDisk. FDisk is a program that will be familiar to some Windows users because it is used to partition Windows machines. However, it is rather complicated to use and does not provide a nice graphical interface. For our purposes, we will use Disk Druid.

Note 

While it is certainly possible to dual boot a system with both Windows and Linux, it is much simpler just to have a Linux machine. Less-experienced readers would probably have an easier time using their entire machine for a single Linux partition, using the Automatic Partition option. Those readers who want to dual boot are advised to read the following paragraphs and any documentation that came with their Linux distribution carefully.

When you select Disk Druid, you will be taken to a screen displaying your current partitions. There are two courses of action you might take. First, if you are not going to dual boot your system (have more than one operating system on it), then it is probably best to highlight each partition, one by one, and delete it. Then you can start fresh. Then you will choose the New button, which will take you to a screen where you can set the parameters for this new drive. This is shown in Figure 2.9a.

click to expand
Figure 2.9A: Setting up partitions.

Note 

You also are taken to this screen if you choose to edit an existing partition.

If you are planning to dual boot with an operating system that is already installed—for example, should you wish to install Linux on your Windows machine and keep both operating systems—then you will not delete all the existing partitions. You will delete all partitions except for the one that contains Windows. This means that when we are done you will have one Windows partition and one Linux partition. The important point to remember is that you should leave the partition that has Windows completely untouched.The real question is, how do you know which partition has Windows? Linux and Disk Druid identify partitions differently than Windows does, but both Disk Druid and Windows list the size of the partition. The trick is to boot up your system before you begin the install and use My Computer to note the size of the partition you want to install Linux on. For example, consider Figure 2.9b.

click to expand
Figure 2.9B: My Computer.

Note 

This is one more reason why you were advised to read this entire chapter before attempting to perform the installation.

Here we see there is a single large partition of 13.6 gigabytes, and it is called the C drive. When you start the Linux install and get to Disk Druid, you will not see a drive labeled C, but you will see a drive that is about 56.6 gigabytes in size.

Note 

The best way to do a dual boot with Windows is to have a separate partition created to hold Linux. This partition should be created before you begin the Linux installation. If you are uncomfortable with partitioning your hard drive, you might consider using a commercial product such as Partition Magic, available from www.powerquest.com. If that were present on the machine depicted in Figure 2.9b, you would also see a D or an E drive. Also note that it is much simpler to have one operating system per machine. In other words, it’s easier and simpler to have a separate Linux and Windows PC than to try to install both on one machine.

One significant problem with Disk Druid, however, is that you cannot resize the partitions. If your machine already has two partitions of about the right size to handle Windows and Linux, then this is fine. If it does not, you could be in for a problem. As we already discussed, one of the easiest and relatively least expensive routes is to obtain some utility such as Partition Magic, install it in Windows, and resize your partitions as you see fit. Then when you reboot and install Linux, the partitions will already be set up for you. If you want to repartition your machine manually so that you can dual boot, the best option for you is to follow Microsoft’s recommendations. The Microsoft Web site www.microsoft.com/exchange/techinfo/tips/StorageTip2.asp may be of some help to you.

Another option is to use the FDisk utility, previously mentioned, to repartition your drive. FDisk does not actually allow you to resize your partitions as you need to. However, it does let you delete one partition and create one or more partitions from that freed space. One of the best Web pages on the Internet on the FDisk utility can be found at www.computerhope.com/fdiskhlp.htm. You can also access the Linux FDisk manual at www.die.net/doc/linux/man/man8/fdisk.8.html. FDisk is more versatile, but also more complex. For this reason, this book will focus on Disk Druid. Readers who want to learn more about FDisk are encouraged to use the Web sites previously mentioned and perhaps do a search in their favorite search engine for FDisk for even more resources.

Assuming that you are not dual booting, you will probably want to use Disk Druid to create only two partitions: a swap partition, described earlier, and a single large partition for your operating system. This is the simplest setup and is highly recommended for beginners. Once you have made those selections, you click to tell Disk Druid you are done. You also can select a check box indicating that you want the installation process to check the actual physical disks before creating the partitions. This is a very good idea. It is time consuming, but it ensures that you won’t be installing Linux on a bad hard drive.



 < Day Day Up > 



Moving From Windows to Linux
Moving From Windows To Linux (Charles River Media Networking/Security)
ISBN: 1584502800
EAN: 2147483647
Year: 2004
Pages: 247
Authors: Chuck Easttom

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net