The Beginner's Guide to Linux, Part 2: Installation

norman

Part 1: Finding the Right Distro

Part 2: Partition and Installation

Part 3: The Linux GUI

Part 4: Introduction to the Terminal

In part one of our guide , we walked you through the process of finding a distro that is right for you. By now, you hopefully have become more familiar with the distros that are out there and have at least one that you would like to try. This chapter is going to walk you through downloading and burning a CD image of your chosen distro(s), the traditional way of partitioning and setting up a dual-boot system, and another way to dual-boot without repartitioning. Instead of providing a step-by-step tutorial for a specific installation process, our goal is to educate you on the underlying concepts in a more generalized way that you will be able to apply towards many different Linux distros. You should also read our previous guide to installing Ubuntu for further instructions.

Acquisition and preparation

Before you can install and play around with Linux, you have to acquire it first. While some computers come pre-equipped with Linux through the OEM, (certain Dell models and various netbooks, for instance) most of you will have to download it from the internet. The most considerate way to do this is through Bittorrent, since peer-to-peer eliminates the bandwidth strain on servers that conventional downloads create. All you have to do is find a torrent file of the distro you want and start the download. (assuming the torrent is still being seeded) We advise you to follow proper etiquette and seed as much as you download (at least a 1:1 ratio) so other people can benefit from the torrent like you did.

For some of you, Bittorrent is not a good option. Several internet service providers throttle (artificially limit the speed of) all torrent download speeds because they have oversold their lines and there is not enough bandwidth to allow everyone to torrent at full speed. Bittorrent is a huge drain on providers, and they often use piracy as an excuse for throttling.

Fortunately, you can still fall back on old-fashioned FTP. Very few providers limit FTP download speeds, so your download will go as fast as the server on the other side or your own connection will permit. Most Linux distros are mirrored on several servers, so there is a good chance that at least one of them will be fast at any given time. However, if you try to acquire a new version of a distro on the same day it came out, Bittorrent may be a far better option (even if you are being throttled) since all FTP servers are likely to be  very slow or even non-responsive as a result. (many people are trying to download at once and the server can only handle a finite load)  Bittorrent is not prone to that type of slowdown problem due to its decentralized nature, and your download will actually go faster as more people start seeding.

If you're still stuck on dial-up, downloading Linux may take up to several days. Rather than having to tie up your phone line for that long, you have the option of ordering pre-made Linux installation media from several different suppliers. ( distrowatch.com has links to these providers) Most of the media acquired in this way comes on professionally pressed discs and is much more durable than typical burned CD or DVD media. Many of these discs are very reasonably priced.

Some big-box electronics stores also sell boxed copies of various distros in their software section; these discs are also professionally made. Alternatively, many books on specific distros include a disc  with the full operating system on it. The downside to this last method is that the included  version may be slightly out of date by the time you buy the book.

If you download Linux yourself, you are going to end up with one or more ISO files. An ISO file allows you to replicate a CD or DVD without requiring an existing disc to copy from; it is essentially a container file for everything on the original disc. These days, it is common for distros to come on more than one CD, (although some distros like Ubuntu still manage to fit on only one) so make sure you download the ISO files of all the discs that are required for installation. Alternatively, many distros have a DVD version as well, (larger download size in exchange for the convenience of one disc) so choose which one you want.

If you've never burned an ISO image before, it is rather different than making a normal CD or DVD. Burning the ISO file to a blank disc like you would with any other file will not work. (it would only waste a disc)  The object here is to extract the contents of the ISO file to recreate the original disc. Most CD/DVD burning utilities (even low-end ones) have an image burning utility built into them, so look for a “Burn Image” feature or something similar. If your burning software doesn't support this, you can still use isoburn to make your installation media.

Testing the distro

Once you have created or otherwise acquired your Linux install discs, you may have an opportunity to test the distro on your system prior to conducting the actual installation. Many modern distros incorporate LiveCD functionality , essentially the ability to run a temporary yet fully functional session of the operating system from the CD or DVD instead of from the hard drive.  The LiveCD session will make no permanent changes to your computer. (unless you choose to install)

LiveCD functionality is useful because it gives you a change to experiment with the distro without making any real commitment and lets you determine whether or not it will be a good fit for your system. The LiveCD has most (if not all) the software that will be in the installed system available for use, so it will give you a good idea of what the distro is capable of out of the box. In part one of this series, we mentioned that some distros have better hardware support than others.

Judging by how well the LiveCD works, you will have a fairly good idea of how well your particular hardware configuration is supported. Keep in mind that certain specialized hardware like wireless devices (especially the Broadcom 43xx devices) or graphics  cards/chipsets (ATI or Nvidia) may require additional drivers or firmware to work, and the LiveCD may not support them out of the box. The last part of this article will tell you how to deal with this problem should it arise. Fortunately, hardware support on Linux is currently better than it has ever been before, and most of your hardware will work fine.

In any event, you should treat the LiveCD functionality as a test run or a preview of the real thing.  Also remember that some distros (like CentOS) do not have LiveCD functionality.

<< Back to Part 1: Finding the Right Distro

Partitioning

Each operating system you install requires its own partition on your hard drive. Partitioning effectively splits your hard drive into one or more distinct areas that operate independently of each other. If you build your own boxes, you have the luxury of determining your partition structure before you install any operating systems at all, and this allows you to set aside space for both Windows and Linux if you decide to dual-boot.

Most people do not have that luxury; computers with OEM copies of Windows usually have a large Windows partition and a small recovery partition taking up the entire hard drive. In such a situation, some space must be freed on the hard drive before Linux can be installed. Free space on a hard disk  is not the same thing as free space in a partition's filesystem, and most hard drives are completely “full” from a partitioning viewpoint.

There are many ways to handle partitioning, but some carry more risk than others. The easiest and safest way to set up a dual-boot system is to install a second hard drive if your system can accommodate it and install Linux to that. In addition to insuring that your Windows partition and any OEM recovery tools remain untouched, this method also provides the greatest possible amount of disk space for your Linux installation.

Furthermore, it becomes easier to transfer your Linux installation to a new computer every time you upgrade. (You would only have to change the bootloader on the new machine after installing the Linux hard drive) If you choose this method, you should always use an internal hard drive. An external hard drive may be more convenient, but the USB interface present on most devices is not fast enough to provide the best performance. (external SATA would probably work fine, but we have not tested this)

Another way to accommodate Linux is to resize a partition on your existing hard drive to free up space. This is generally the most dangerous  installation method since it presents the greatest chance of data loss. However, it is possible to do it safely. Windows Vista has a built-in tool to manage partitions, and this tool will allow you to  shrink your Vista partition to free up some space. The amount of space the Vista tool will be able to reclaim will vary widely between systems and cannot be predicted beforehand with any certainty. However, the tool is  reliable from our experience and we have yet to run into any problems from using it.

The process of shrinking a Windows XP partition is much more complicated since it has no built-in tool for the purpose like Vista does. The process requires several different tools and must be done in a specific order. Before resizing an NTFS partition on a Windows XP or older NT-based system, it should be thoroughly defragmented to ensure that all files are grouped together in the filesystem. It is critical that you resize the filesystem before you resize the partition because the sizes of these are determined separately. If you resize the partition first, you will accidentally chop off part of the filesystem and you will not be able to boot from the partition.

Fortunately, practically every Linux distro has a partition resizing tool in its installation utility that will handle this delicate procedure for you and will safely perform all the steps in the correct order. All you have to do is decide how much you want to shrink the existing Windows partition and then have the setup utility do it. Obviously, you will not be able to shrink the partition to a size that is smaller than the sum of the data it contains, including any space set aside for swapping.

Shrinking a NTFS partition in Fedora setup

Also, keep in mind that the filesystem resizing utility may refuse to work under certain conditions, such as any instances where Windows wasn't shut down properly or if the filesystem needs to be checked for errors. You must resolve any such problems before the resizing utility will let you continue; this is a deliberate design feature meant to keep you from resizing a filesystem that is not able to handle the procedure in its current state and causing further damage as a result.

The new Linux partition should always be located at the “end” of the drive. Many OEM recovery tools are hard-coded to boot from a specific partition.  The recovery tool will not work if it expects to find its partition in a certain place on the hard drive but finds Linux there instead, and you will be unable to fix your Windows installation as a result. Since the recovery partition is generally the second partition on most OEM machines, (Windows is the first one) the new Linux partition should be third.

Once your partitions are resized, the newly freed space is typically allocated to the “end” of the drive anyway, so this is seldom something you will have to manually adjust. However, it pays to make  sure that your partition order is set correctly so you will not suddenly find out you have a broken recovery tool in an emergency. Furthermore, if you install Linux on a separate hard drive, you do not need to worry about this particular issue at all.

For a well-rounded desktop system, you should set aside at least 10 gigabytes at the bare minimum. Although you might be able to get by with less, we really don't recommend it.  Make sure you have enough space for what you need to do on your Linux partition, because it is very dangerous to  mess with the partitions again if you run out of space. Remember that Linux is only able to install software to its own partition  and that some of that partition must be reserved for swapping (even if you have plenty of RAM) if you want features like hibernation to work.

The installation procedure is summarized here in the Ubuntu installation wizard.

Installation

Although the installation process on Linux is fairly straightforward, there is one important thing to remember: If you want to prepare a dual-boot system, Windows must always be installed first after you prepare your partitions. Each operating system will install a bootloader, which is a program that tells the computer which operating systems are installed and gives you a list to choose from when you turn on your computer. Most modern Linux distros will install a bootloader called GRUB. The main issue here is that some bootloaders handle dual-booting better than others do.

GRUB on Fedora Linux

If you install Linux first and then install Windows, Windows will replace GRUB with its own bootloader. This bootloader can also boot into Linux systems, but it will not look for them by default like GRUB does. In such a situation, you would not be able to boot into your Linux installation, and to remedy this you would have to reconfigure the Windows bootloader to include a Linux boot option or reinstall GRUB. Neither option is very beginner-friendly, so it is far easier to do things the right way to begin with.

A dual-boot system with Ubuntu 8.10 and Windows XP, utilizing the GRUB bootloader

If Windows is already installed when you run a Linux setup utility, (as it would be if you resized a Windows partition) GRUB will automatically find Windows and create an entry for it and its related utilities (like OEM system recovery tools) in the boot menu. That way, you will be able to boot into any operating system you have on your computer. The same is also true if you are triple or even quad-booting; GRUB will attempt to add an entry for every operating system it finds on your computer, be it Windows, Mac OSX, BSD, or another Linux  distro.

Windows NTFS and Linux partitions shown in a dual-boot configuration on a virtual hard disk in the Gparted utility.

Installing Linux is very simple compared to many Windows systems. The old text-based installers are mostly a thing of the past; since many distros have LiveCD functionality, they also have easy-to-use setup utilities that incorporate a GUI.  These installers walk you through a step-by-step process of choosing your time zone, partitioning, setting up user accounts, configuring your bootloader, etc.  Since Linux is free software, you will not have to provide any serial numbers/product keys and you will not have to worry about activation. In most instances, you will not even have to consent to a license agreement.

Other installation methods

In recent years, there have been several different ways of dual-booting Linux without resorting to the traditional method discussed in the previous sections of this guide. Although virtualization software allows you to run a fully functional installation of Linux, that is technically not dual-booting since the virtualized operating system is not running independently. However, several utilities were formed that  allow you to install Linux without repartitioning your hard drive and replacing your bootloader.  The most famous of these tools is called Wubi, which installs Ubuntu. Similar programs include win32-loader (installs Debian) and Instlux. (installs OpenSUSE)

The Wubi installation utility running on Windows XP

Wubi and the other tools like it work by creating a large file in your Windows partition. This file acts like a partition within a partition, and Wubi installs Ubuntu to this location. Wubi also modifies the Windows bootloader to include an option to boot to the simulated Ubuntu partition file, so there is no need to install GRUB. (the other programs act similarly) Furthermore, these special Linux installations may be easily removed like any other program through Windows and your computer will go back to how it was before. The main drawback of Wubi and similar tools is that there is no hibernation functionality and improper shutdowns can cause significant damage to the Linux filesystem.

Post-installation

After you get your new Linux system installed, there may be a few additional things you have to do to get it fully functional, depending on your hardware and your dual-boot situation.

After installation, Windows will probably detect the partition changes and will run a disk check. This is normal and you should not worry about it

As stated earlier in this article, certain types of hardware may require additional drivers or firmware (software that interacts directly with the device, which in turn works with a driver from the operating system)  to function. Many of these additional packages have some proprietary aspects and are considered “restricted”. (while they may be free to acquire, they may not be fully open source) Some of these packages are from the hardware manufacturer while others have been reverse-engineered by the open source community due to a lack of manufacturer support. Because of licensing and intellectual property issues, they cannot be included in the main distribution. Quite often, your distro will detect the need for this software (Ubuntu in particular has a restricted drivers manager) and will offer to install it for you.

If you are dual-booting, you will probably want write access to your NTFS partitions.  Linux can read NTFS partitions out of the box, but to write data to them you will need to install NTFS-3g from your distro's repositories. It can safely write to NTFS volumes from all versions of Windows.

Once you go through these final steps, you should have a usable Linux installation. In part three of this guide, we will cover the basics of using your new Linux system.

Next, Part 3: The Linux GUI >>

Around the web

Comments