Originally Published: Saturday, 25 September 1999 Author: Mike Chan
Published to: news_learn_firststep/Firststep News Page: 1/1 - [Printable]

Partitioning

Partitioning is the next step after selecting which version of Linux you are installing. Partitioning is akin to planning a yard. You have to decide where everything goes. If you are planning a server for web pages, you will want to allocate more room for web pages. If you are using it as a home server, you want to allocate more user space.

   Page 1 of 1  

Partitioning is the next step after selecting which version of Linux you are installing. Partitioning is akin to planning a yard. You have to decide where everything goes. If you are planning a server for web pages, you will want to allocate more room for web pages. If you are using it as a home server, you want to allocate more user space. For most purposes though, just fencing off a part of your yard (or hard drive) is all you need to do. An even easier way is to set aside a whole hard drive dedicated to linux. This solves a lot of problems and makes it easier to install.

Every operating system has its own way of storing files onto a hard drive. Partitioning is done so that an OS is able to store files in an orderly manner and retrive them, without stomping on someone else's turf. Different operating systems require different types of partitions and file systems. DOS and Windows 9x use variations of FAT; most unixes use a variation on UFS (unix file system), Windows NT uses NTFS, and Linux uses EXT2. What is also important to note, is that Linux uses a separate partition for its swap space. While most operating systems get by fine with one partition (to use as swap and for storing files), Linux uses two partitions. One to hold files, and the other to use as swap space if you don't have enough RAM. Linux also has the ability to read (and sometimes write) to other file systems.

Before partitioning, you will want to know how much space you want to set aside for linux. For a full installation with a graphical user interface, office productivity software, and a little spare room, you will want at least 1gB set aside for Linux. Anything less and your experience of Linux will be limited. Swap space is usually set at 127mB and should be sufficient for most users. If you are running a server, you may want to create more than one swap partition. Linux is limited to 127mB as the maximum size for a swap partition, so in order to get 512mB of swap, you will need to create 4 swap partitions. Also keep in mind that an IDE drive is limited to 4 primary partitions, so you may have to create extended partitions if you plan on dividing your hard drive into more than 4 chunks of space.

Most modern distributions will have specialized software to help you partition your hard drive. Caldera ships with partition magic, while redhat comes with fdisk and disk druid. If you are installing Linux onto a hard drive that is already inhabited by another operating system, you will need to resize existing partitions (moving fences in your yard) to make room for linux. Partition magic can resize hard drives, and most distributions have a program called FIPS which let you resize FAT partitions. My recommendation however is to use a new hard drive and avoid all these problems, or if you have to resize partitions, use partition magic. In any case, it can never hurt to create a backup of all your important information. Moving or resizing partitions is inherently risky.

If you are interested in the fine tuning your hard drive, fdisk allows you the most control, but also requires the most technical knowledge. In my experience, partition magic is well worth its cost. Caldera includes a special version of partition magic that makes partitioning especially painless.

Once you have created a root partition for linux to keep its files on, and a swap partition for Linux to use, you can let your respective distribution format the partition, and copy the files over onto your hard drive.

There are many pitfalls that can occur if you are not installing Linux onto a fresh hard drive. Older motherboards my not triangulate modern hard drives correctly, and if you are using LILO to launch linux, the linux root partition must be near the front of the hard drive (it must start beforer the 1024th cylinder), there are also special considerations when installing on SCSI. Again, you generally do not have to worry about these quirks if you install linux onto a new hard drive.

If you are having problems partitioning linux, don't fret. Read up on the specifics of partitioning using fdisk in the HOWTO docs, post a few questions to your local LUG, or buy a new hard drive to install Linux on. Mastering the art of drive partitioning can make future maintenance and capacity planning eaiser in the future.

Michael Chan





   Page 1 of 1