paint-brush
How to Install and Use Linux: A Guide to Get Startedby@goerzenandothman
143 reads

How to Install and Use Linux: A Guide to Get Started

by Goerzen & OthmanOctober 23rd, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

“A journey of a thousand miles must begin with a single step.” —Lao-Tsu Now that you’ve read about the ideas and philosophy behind Linux and Debian, it’s time to start putting it on your computer! We start by talking about how to prepare for a Debian install, then about partitioning your disk, and finally, how to start up the installation system. 2.1 Supported Hardware Debian does not impose hardware requirements beyond the requirements of the Linux kernel and the GNU tools. Rather than attempting to describe all the different hardware configurations that are supported for the PC platform, this section contains general information and pointers to where additional information can be found. There are two excellent places to check for detailed information: the Debian System Requirements[1] list and the Linux Documentation Project Hardware Compatibility HOWTO[2]. For information on video card support, you may also want to look at the XFree86[3] Project web site. [1] http://www.debian.org/releases/slink/i386/ch-hardware-req.en.html [2] http://metalab.unc.edu/LDP/HOWTO/Hardware-HOWTO.html [3] http://www.xfree86.org/ 2.1.1 Memory and Disk Space Requirements You must have at least 4MB of memory and 35MB of available hard disk space. If you want to install a reasonable amount of software, including the X Window system, and some development programs and libraries, you’ll need at least 300MB. For an essentially full installation, you’ll need around 800MB. To install everything available in Debian, you’ll probably need around 2GB. Actually, installing everything doesn’t make sense because some packages provide the same services.
featured image - How to Install and Use Linux: A Guide to Get Started
Goerzen & Othman HackerNoon profile picture

Debian GNU/Linux: Guide to Installation and Usage" by John Goerzen and Ossama Othman is part of the HackerNoon Books Series. You can jump to any chapter in this book here. Getting Started

2. Getting Started

A journey of a thousand miles must begin with a single step.” —Lao-Tsu

Now that you’ve read about the ideas and philosophy behind Linux and Debian, it’s time to start putting it on your computer! We start by talking about how to prepare for a Debian install, then about partitioning your disk, and finally, how to start up the installation system.

2.1 Supported Hardware

Debian does not impose hardware requirements beyond the requirements of the Linux kernel and the GNU tools.


Rather than attempting to describe all the different hardware configurations that are supported for the PC platform, this section contains general information and pointers to where additional information can be found.


There are two excellent places to check for detailed information: the Debian System Requirements[1] list and the Linux Documentation Project Hardware Compatibility HOWTO[2]. For information on video card support, you may also want to look at the XFree86[3] Project web site.


[1] http://www.debian.org/releases/slink/i386/ch-hardware-req.en.html

[2] http://metalab.unc.edu/LDP/HOWTO/Hardware-HOWTO.html

[3] http://www.xfree86.org/

2.1.1 Memory and Disk Space Requirements

You must have at least 4MB of memory and 35MB of available hard disk space. If you want to install a reasonable amount of software, including the X Window system, and some development programs and libraries, you’ll need at least 300MB. For an essentially full installation, you’ll need around 800MB. To install everything available in Debian, you’ll probably need around 2GB. Actually, installing everything doesn’t make sense because some packages provide the same services.

2.2 Before You Start

Before you start, make sure to back up every file that is now on your system. The installation procedure can wipe out all of the data on a hard disk! The programs used in installation are quite reliable and most have seen years of use; still, a false move can cost you. Even after backing up, be careful and think about your answers and actions. Two minutes of thinking can save hours of unnecessary work.


Debian makes it possible to have both Debian GNU/Linux and another operating system installed on the same system. If you plan to use this option, make sure that you have on hand the original CD-ROM or floppies of the other installed operating systems. If you repartition your boot drive, you may find that you have to reinstall your existing operating system’s boot loader or the entire operating system itself.


[4] A boot loader is responsible starting an operating system’s boot procedure.

2.2.1 Information You Will Need

If your computer is connected to a network 24 hours a day (i.e., an Ethernet or similar LAN connection—not a PPP connection), you should ask your network’s system administrator for the following information:


◼ Your host name (you may be able to decide this on your own)


◼ Your domain name


◼ Your computer’s IP address


◼ The IP address of your network


◼ The netmask to use with your network


◼ The broadcast address to use on your network


◼ The IP address of the default gateway system you should route to, if your networkhas a gateway


◼ The system on your network that you should use as a DNS server


◼ Whether you connect to the network using Ethernet


◼ Whether your Ethernet interface is a PCMCIA card, and if so, the type of PCMCIA controller you have


If your only network connection is a telephone line using PPP or an equivalent dialup connection, you don’t need to worry about getting your network set up until your system is already installed. See section 11.1 on page 99 for information on setting up PPP under Debian.

2.3 Partitioning Your Hard Drive

Before you install Debian on your computer, it is generally a good idea to plan how the contents of your hard drive will be arranged. One part of this process involves partitioning your hard drive.

2.3.1 Background

Partitioning your disk simply refers to the act of breaking up your disk into sections. Each section is then independent of the others. It’s roughly equivalent to putting up walls in a house; after that, adding furniture to one room doesn’t affect any other room.


If you already have an operating system on your system (Windows 95, Windows NT, DOS, etc.) and you want to install Debian GNU/Linux on the same disk, you will probably need to repartition the disk. In general, changing a partition that already has a filesystem on it will destroy any information in that filesystem. Therefore, you should always make backups before doing any repartitioning. Using the analogy of the house, you would probably want to move all the furniture out of the way before moving a wall or you risk destroying your furniture. Luckily, there is an alternative for some users; see section 2.3.6 on page [*] for more information.


At a bare minimum, GNU/Linux needs one partition for itself. You can have a single partition containing the entire operating system, applications, and your personal files. Most people choose to give GNU/Linux more than the minimum number of partitions, however. There are two reasons you might want to break up the filesystem into a number of smaller partitions. The first is for safety. If something happens to corrupt the filesystem, generally only one partition is affected. Thus, you only have to replace (from the backups you’ve been carefully keeping) a portion of your system. At the very least, you should consider creating what is commonly called a “root partition.” This contains the most essential components of the system. If any other partitions get corrupted, you can still boot into GNU/Linux to fix the system. This can save you the trouble of having to reinstall the system from scratch.


The second reason is generally more important in a business setting, but it really depends on your use of the machine. Suppose something runs out of control and starts eating disk space. If the process causing the problem happens to have root privileges (the system keeps a percentage of the disk away from users), you could suddenly find yourself out of disk space. This is not good since the operating system needs to use real files (besides swap space) for many things. It may not even be a problem of local origin. For example, unsolicited e-mail (“spam”) can easily fill a partition. By using more partitions, you protect the system from many of these problems. Using e-mail as an example again, by putting the directory /var/spool/mail on its own partition, the bulk of the system will work even if unsolicited e-mail fills that partition.


Another reason applies only if you have a large IDE disk drive and are using neither LBA addressing nor overlay drivers[5]. In this case, you will have to put the root partition into the first 1,024 cylinders of your hard drive, usually around 524 megabytes. See section 2.3.3 on page [*] for more information on this issue.


[5] See your hard drive manual for a description of these features.


Most people feel that a swap partition is also a necessity, although this isn’t strictly true. “Swap” is scratch space for an operating system, which allows the system to use disk storage as “virtual memory” in addition to physical memory. Putting swap on a separate partition allows Linux to make much more efficient use of it. It is possible to force Linux to use a regular file as swap, but this is not recommended.


The only real drawback to using more partitions is that it is often difficult to know in advance what your needs will be. If you make a partition too small, either you will have to reinstall the system, or you will be constantly moving things around to make room in the undersized partition. On the other hand, if you make the partition too big, you may be wasting space that could be used elsewhere.

2.3.2 Planning Use of the System

Disk space requirements and your partitioning scheme are influenced by the type of installation you decide to create.


For your convenience, Debian offers a number of default “profiles” some of which are listed later in this section. Profiles are simply preselected sets of packages designed to provide certain desired capabilities on your system. Installation is easier since packages that fit your desired profile are automatically marked for installation. Each given profile lists the size of the resulting system after installation is complete. Even if you don’t use these profiles, this discussion is important for planning, since it will give you a sense of how large your partition or partitions need to be. The following are some of the available profiles and their sizes:


Server_std. This is a small server profile, useful for a stripped-down server, that does not have a lot of niceties for shell users. It basically has an FTP server, a web server, DNS, NIS, and POP. It will take up around 50MB. Of course, this is just the size of the software; any data you serve would be additional.


Dialup. This profile would be good for a standard desktop box, including the X Window system, graphics applications, sound, editors, etc. The size of the packages will be around 500MB.


Work_std. This profile is suitable for a stripped-down user machine without the X Window system or X applications. It is also suitable for a laptop or mobile computer. The size is around 140MB. It is possible to have a simple laptop setup including X with less than 100MB.


Devel_comp. This is a desktop setup profile with all the popular development packages, such as Perl, C, and C++. It requires around 475MB. Assuming you are adding X and some additional packages for other uses, you should plan for approximately 800MB of disk space for this type of installation.


Remember that these sizes don’t include all the other materials that are normally found, such as user files, mail, and data. It is always best to be generous when considering the space for your own files and data. Notably, the Debian /var directory contains a lot of state information. The installed package management files can easily consume 20MB of disk space. In general, you should allocate at least 50MB for the /var directory because system log files are also stored there.

2.3.3 PC Disk Limitations

A PC BIOS generally adds additional constraints for disk partitioning. There is a limit to how many “primary” and “logical” partitions a drive can contain. Additionally, there are limits to where on the drive the BIOS looks for boot information. More information can be found in the Linux Partition mini-HOWTO[6]. This section will include a brief overview to help you plan most situations.


[6] http://metalab.unc.edu/LDP/HOWTO/mini/Partition.html


“Primary” partitions are the original partitioning scheme for PC hard disks. However, there can be only four of them. To get past this limitation, “extended” or “logical” partitions were invented. By setting one of your primary partitions as an extended partition, you can subdivide all the space allocated to that partition into logical partitions. The number of logical partitions you can create is much less limited than the number of primary partitions you can create; however, you can have only one extended partition per drive.


Linux limits the number of partitions per drive to 15 partitions for SCSI drives (3 usable primary partitions, 12 logical partitions), and 63 partitions for IDE drives (3 usable primary partitions, 60 logical partitions).


The last issue you need to know about a PC BIOS is that your boot partition—that is, the partition containing your kernel image—needs to be contained within the first 1,024 cylinders of the drive. Because the root partition is usually your boot partition, you need to make sure your root partition fits into the first 1,024 cylinders.


If you have a large disk, you may have to use cylinder translation techniques, which you can set in your BIOS, such as LBA translation mode. (More information about large disks can be found in the Large Disk mini-HOWTO[7].) If you are using a cylinder translation scheme, your boot partition must fit within the translated representation of cylinder 1,024.


[7] http://metalab.unc.edu/LDP/HOWTO/mini/Large-Disk.html

2.3.4 Device Names in Linux

Linux disks and partition names may be different from those in other operating systems. You should know the names that Linux uses when you create and mount partitions. The basic scheme can be found in Table 2.1 on page [*].


 Table 2.1: Linux Device Names
+------------------------------------------------------------------------------+
| Device                                        |          Linux Name          |
|-----------------------------------------------+------------------------------|
| First floppy drive                            |           /dev/fd0           |
|-----------------------------------------------+------------------------------|
| Second floppy drive                           |           /dev/fd1           |
|-----------------------------------------------+------------------------------|
| First partition on /dev/hda (typically C: in  |          /dev/hda1           |
| other OSs)                                    |                              |
|-----------------------------------------------+------------------------------|
| Fifth partition on /dev/hdc                   |          /dev/hdc5           |
|-----------------------------------------------+------------------------------|
| Second partition on /dev/sdb                  |          /dev/sdb2           |
|-----------------------------------------------+------------------------------|
| Entire Primary-Master IDE hard disk or CD-ROM |           /dev/hda           |
|-----------------------------------------------+------------------------------|
| Entire Primary-Slave IDE hard disk or CD-ROM  |           /dev/hdb           |
|-----------------------------------------------+------------------------------|
| Entire Secondary-Master IDE hard disk or      |           /dev/hdc           |
| CD-ROM                                        |                              |
|-----------------------------------------------+------------------------------|
| Entire Secondary-Slave IDE hard disk or       |           /dev/hdd           |
| CD-ROM                                        |                              |
|-----------------------------------------------+------------------------------|
| First SCSI disk                               |           /dev/sda           |
|-----------------------------------------------+------------------------------|
| Second and remaining SCSI disks               |    /dev/sdb and so forth     |
|-----------------------------------------------+------------------------------|
| First serial port (COM1 in other OSs)         |          /dev/ttyS0          |
|-----------------------------------------------+------------------------------|
| Second, third, etc. serial ports              | /dev/ttyS1, /dev/ttyS2, etc. |
|-----------------------------------------------+------------------------------|
| SCSI tape units (automatic rewind)            |   /dev/st0, /dev/st1, etc.   |
|-----------------------------------------------+------------------------------|
| SCSI tape units (no automatic rewind)         |  /dev/nst0, /dev/nst1, etc.  |
|-----------------------------------------------+------------------------------|
| SCSI CD-ROMs                                  |  /dev/scd0, /dev/scd1, etc.  |
+------------------------------------------------------------------------------+


The partitions on each disk are represented by appending a number to the disk name. For example, the names hda1 and hda2 represent the first and second partitions of the first IDE disk drive in your system. Linux represents the primary partitions with the drive name plus the numbers 1 through 4. For example, the first primary partition on the first IDE drive is /dev/hda1. The logical partitions are numbered starting at 5, so the first logical partition on that same drive is /dev/hda5. Remember that the extended partition—that is, the primary partition holding the logical partitions—is not usable by itself. This applies to SCSI drives as well as IDE drives.


Let’s assume you have a system with two SCSI disks, one at SCSI address 2 and the other at SCSI address 4. The first disk (at address 2) is then named sda and the second sdb. If the sda drive has three partitions on it, these will be named sda1, sda2, and sda3. The same applies to the sdb disk and its partitions. Note that if you have two SCSI host bus adapters (i.e., controllers), the order of the drives can get confusing. The best solution in this case is to watch the boot messages, assuming you know the drive models.


As described above, you should have a separate smaller root partition and a larger /usr partition if you have the space. For most users, the two partitions initially mentioned are sufficient. This is especially appropriate when you have a single small disk, because creating lots of partitions can waste space.


In some cases, you might need a separate /usr/local partition if you plan to install many programs that are not part of the Debian distribution. If your machine will be a mail server, you may need to make /var/spool/mail a separate partition. Putting /tmp on its own 20 to 32MB partition, for instance, is a good idea. If you are setting up a server with lots of user accounts, it’s generally good to have a separate, large /home partition to store user home directories. In general, the partitioning situation varies from computer to computer depending on its uses.


For very complex systems, you should see the Multi Disk HOWTO[8]. It contains in-depth information, mostly of interest to people setting up servers.


[8] http://metalab.unc.edu/LDP/HOWTO/Multi-Disk-HOWTO.html


Swap partition sizes should also be considered. There are many views about swap partition sizes. One rule of thumb that works well is to use as much swap as you have system memory, although there probably isn’t much point in going over 64MB of swap for most users. It also shouldn’t be smaller than 16MB, in most cases. Of course, there are exceptions to these rules. If you are trying to solve 10,000 simultaneous equations on a machine with 256MB of memory, you may need a gigabyte (or more) of swap space.


As an example, consider a machine that has 32MB of RAM and a 1.7GB IDE drive on /dev/hda. There is a 500MB partition for another operating system on /dev/hda1. A 32MB swap partition is used on /dev/hda3 and the rest, about 1.2GB, on /dev/hda2 is the Linux partition.


2.3.6 Partitioning Prior to Installation

There are two different times that you can partition: prior to or during the installation of Debian. If your computer will be solely dedicated to Debian you should partition during installation as described in section 3.5 on page [*]. If you have a machine with more than one operating system on it, you should generally let the other operating system create its own partitions.


The following sections contain information regarding partitioning in your native operating system prior to Debian installation. Note that you’ll have to map between how the other operating system names partitions and how Linux names partitions; see Table 2.1 on page [*].


Partitioning from DOS or Windows

If you are manipulating existing FAT or NTFS partitions, it is recommended that you use either the scheme below or native Windows or DOS tools. Otherwise, it is not really necessary to partition from DOS or Windows; the Linux partitioning tools will generally do a better job.


Lossless Repartitioning


One of the most common installations is onto a system that already contains DOS (including Windows 3.1), Win32 (such as Windows 95, 98, NT), or OS/2 and it is desired to put Debian onto the same disk without destroying the previous system. As explained in section 2.3.1 on page [*], decreasing the size of an existing partition will almost certainly damage the data on that partition unless certain precautions are taken. The method described here, while not guaranteed to protect your data, works extremely well in practice. As a precaution, you should make a backup.


Before going any further, you should have decided how you will divide up the disk. The method in this section will only split a partition into two pieces. One will contain the original operating system, and the other will be used for Debian. During the installation of Debian, you will be given the opportunity to use the Debian portion of the disk as you see fit, i.e., as swap or as a filesystem.


The idea is to move all the data on the partition to the beginning before changing the partition information, so that nothing will be lost. It is important that you do as little as possible between the data movement and repartitioning to minimize the chance of a file being written near the end of the partition as this will decrease the amount of space you can take from the partition.


The first thing you need is a copy of FIPS, which is available in the tools directory on your Debian CD-ROM. This disk must be bootable. Under DOS, a bootable floppy can be created using the command sys a: for a previously formatted floppy or format a: /s for an unformatted floppy. Unzip the archive and copy the files RESTORRB.EXE, FIPS.EXE and ERRORS.TXT to the bootable floppy. FIPS comes with very good documentation that you may want to read. You should definitely read the documentation if you use a disk compression driver or a disk manager. Create the disk and read the documentation before you continue.


The next thing to be done is to move all the data to the beginning of the partition. DEFRAG, which comes standard with DOS 6.0 and later, can easily do the job. See the FIPS documentation for a list of other software that may also work. Note that if you have Windows 95 or higher, you must run DEFRAG from there, because DOS doesn’t understand VFAT, which is used to support long filenames in Windows 95 and higher.


After running the defragmenter (which can take a while on a large disk), reboot with the FIPS floppy disk you created. Simply type a:\ fips and follow the directions.


Note that there are many other other partition managers out there, in case FIPS doesn’t work for you.

2.3.7 Debian Installation Steps

As you initially install Debian, you will proceed through several different steps:


  1. Boot the installation system


  2. Initial system configuration


  3. Install the base system


  4. Boot the newly installed base system


  5. Install the rest of the system


Booting the Debian installation system, the first step, is generally done with the Rescue Floppy or from the CD-ROM.


Once you’ve booted into Linux, the dbootstrap program will launch and guide you through the second step, the initial system configuration. This step is described in detail in section 3 on page [*].


The “Debian base system” is a core set of packages that are required to run Debian in a minimal, stand-alone fashion. dbootstrap will install it from your CD-ROM, as described in section 3.12 on page [*]. Once you have configured and installed the base system, your machine can “stand on its own.”


The final step is the installation of the remainder of the Debian system. This would include the applications and documents that you actually use on your computer, such as the X Window system, editors, shells, and development environments. The rest of the Debian system can be installed from CD-ROM. At this point, you’ll be using the standard Debian package management tools, such as dselect. This step is described in section 3.20 on page [*].

2.4 Choosing Your Installation Media

First, choose the boot media for the installation system. Next, choose the method you will use to install the base system.


To boot the installation system, you have the following choices: bootable CD-ROM, floppies, or a non-Linux boot loader.


CD-ROM booting is one of the easiest ways to install. Not all machines can boot directly from the CD-ROM so you may still need to use floppies. Booting from floppies is supported for most platforms. Floppy booting is described in section 2.4.2 on page [*].

2.4.1 Installing from a CD-ROM

If your system supports booting from a CD-ROM, you don’t need any floppies. Put the CD-ROM into the drive, turn your computer off, and then turn it back on. You should see a Welcome screen with a boot prompt at the bottom. Now you can skip down to section 2.5.


If your computer didn’t “see” the Debian CD-ROM, the easiest option is to make two floppies for booting (described in section 2.4.2) and then use them to start Debian. Don’t worry; after Debian is finished with those two floppies, it will find your CD-ROM with no trouble.

2.4.2 Booting from Floppies

It’s not hard at all to boot from floppies. In fact, your CD-ROM contains all the information necessary to create boot disks for you. For these instructions, you will need to get two disks. Label the first one “Debian 2.1 Install/Rescue Disk” and the second “Debian 2.1 Modules/Drivers Disk.”


Creating Floppies from Disk Images


Disk images are files containing the complete contents of a floppy disk in raw form. Disk images, such as resc1440.bin, cannot simply be copied to floppy drives. A special program is used to write the image files to floppy disk in raw mode.


First, you need to get to a DOS prompt. In Windows 95 and above, you can do this by double-clicking on an MS-DOS icon or by going to Start( \rightarrow )Programs( \rightarrow )MS-DOS prompt. Then, insert your Debian GNU/Linux CD-ROM into your CD-ROM drive. First, you change to your CD-ROM drive. In most cases, this is D:.


C:\WINDOWS>D:


Now, change to the directory containing the disk images.


D:>CD

\DISTS\SLINK\MAIN\DISKS-I386\2.1.8-1999-02-22


If you get an error, double-check what you’re typing. If the error persists, manually issue CD \DISTS\SLINK\MAIN\DISKS-I386, then run DIR, and then CD into the directory indicated. Note that the above commands, and some other examples below, may appear as a single line on your display even if they are wrapped here.


Now, you’re ready to create the first of two disks. Start the program to write them out, rawrite2:



D:\DISTS\SLINK\MAIN\DISKS-I3862.1.8-1999-02-22>rawrite2 RaWrite 2.0 - Write disk file to raw floppy diskette


Rawrite2 starts and displays its welcome message. Next, it asks for the filename and diskette drive. You tell it to write resc1440.bin to a:


Enter disk image source file name: resc1440.bin Enter target diskette drive: a:


Rawrite2 now asks you to insert a disk into the floppy drive. Do so and press Enter.


Plese insert a formatted diskette into drive A: and press -ENTER- :


At this point, rawrite2 will create the first of the two disks. Now, you need to repeat the process for the second disk:


D:\DISTS\SLINK\MAIN\DISKS-I3862.1.8-1999-02-22>rawrite2 RaWrite 2.0 - Write disk file to raw floppy diskette Enter disk image source file name: drv1440.bin Enter target diskette drive: a: Please insert a formatted diskette into drive A: and press -ENTER- :

By now, your disks are created. You can now use the first one to boot.


Booting Debian You are now ready to boot into Debian! Shut down your existing operating system, turn off your computer, and place the Install/Rescue Disk into the floppy drive. Now turn your computer back on. You should get a Welcome screen with a boot prompt at the bottom.


2.5 Booting the Installation System

You should now have the boot prompt. Simply press Enter at this point.


Once you press Enter, you should see the message Loading..., and then Uncompressing Linux..., and then a screenful or so of information about the hardware in your system. In general, you can ignore these messages. Linux will look for various hardware devices and will tell you what it finds and doesn’t find. Don’t worry about messages at this point. Just wait until you see the Color Selection screen. If you have trouble, see section B.2 on page [*].




About HackerNoon Book Series: We bring you the most important technical, scientific, and insightful public domain books.


This book is part of the public domain. John Goerzen and Ossama Othman (2004). Debian GNU/Linux : Guide to Installation and Usage. Urbana, Illinois: Project Gutenberg. Retrieved https://www.gutenberg.org/cache/epub/6527/pg6527-images.html


This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org, located at https://www.gutenberg.org/policy/license.html.