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. This section will include a brief overview to help you plan most situations.
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.) If you are using a cylinder translation scheme, your boot partition must fit within the translated representation of cylinder 1,024.
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.
2.3.5 Recommended Partitioning Scheme
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. It contains in-depth information, mostly of interest to people setting up servers.
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-I386\ 2.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-I386\ 2.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 [*].
3. Step-by-Step Installation
dbootstrap is the name of the program that is run after you have booted into the installation system. It is responsible for initial system configuration and the installation of the “base system.”
The main job of dbootstrap and the main purpose of your initial system configuration is to configure certain core elements of your system. For instance, this includes your IP address, host name, and other aspects of your networking setup, if any. This also includes the configuration of “kernel modules,” which are drivers that are loaded into the kernel. These modules include storage hardware drivers, network drivers, special language support, and support for other peripherals. Configuring these fundamental things is done first, because it is often necessary for the system to function properly for the next steps of installation.
dbootstrap is a simple, character-based application. It is very easy to use; generally, it will guide you through each step of the installation process in a linear fashion. You can also go back and repeat steps if you made a mistake. Navigation within dbootstrap is accomplished with the arrow keys, Enter, and Tab.
3.1 Select Color or Monochrome Display
Once the system has finished booting, dbootstrap is invoked. The first thing that dbootstrap asks about is your display. You should see the “Select Color or Monochrome display” dialog box. If your monitor is capable of displaying color, press Enter. The display should change from black-and-white to color. Then press Enter again, on the “Next” item, to continue with the installation.
If your monitor can display only black and white, use the arrow keys to move the cursor to the “Next” menu item, and then press Enter to continue with the installation.
3.2 Debian GNU/Linux Installation Main Menu
You may see a dialog box that says “The installation program is determining the current state of your system and the next installation step that should be performed.” This is a phase in which the installation program automatically figures out what you probably need to do next. In some cases, you may not even see this box.
During the entire installation process, you will be presented with the main menu, titled “Debian GNU/Linux Installation Main Menu.” The choices at the top of the menu will change to indicate your progress in installing the system. Phil Hughes wrote in the Linux Journal that you could teach a chicken to install Debian! He meant that the installation process was mostly just pecking at the Enter key. The first choice on the installation menu is the next action that you should perform according to what the system detects you have already done. It should say “Next,” and at this point the next step in installing the system will be taken.
http://www.linuxjournal.com
3.3 Configure the Keyboard
Make sure the highlight is on the “Next” item and press Enter to go to the keyboard configuration menu.
Move the highlight to the keyboard selection you desire and press Enter. Use the arrow keys to move the highlight. In most cases, you can just use the default U.S. layout.
3.4 Last Chance to Back Up!
Did we tell you to back up your disks? Here’s your first chance to wipe out all of the data on your disks and your last chance to save your old system. If you haven’t backed up all of your disks, remove the floppy from the drive, reset the system, and run backups.
3.5 Partition a Hard Disk
Whatever the “Next” menu selection is, you can use the down-arrow key to select “Partition a Hard Disk.” Go ahead and do this now, then press Enter.
The “Partition a Hard Disk” menu item presents you with a list of disk drives you can partition and runs a partitioning application called cfdisk. You must create at least one “Linux native” (type 83) disk partition, and you probably want at least one “Linux swap” (type 82) partition, as explained in later in this section.
You will now create the partitions that you need to install Debian. For this example, the assumption is that you are partitioning an empty hard disk.
The boot partition must reside within the first 1,024 of cylinders of your hard disk (see section 2.3.3 on page [*]). Keeping that in mind, use the right-arrow key to highlight the “New” menu selection, and then press Enter. You will be presented with the choice of creating a primary partition or a logical partition. To help ensure that the partition containing the boot information is within the first 1,024 cylinders, create a primary partition first. This primary partition will be your “Linux native” partition.
Highlight the “Primary” menu selection and press Enter. Next you will need to enter how large you want that partition to be. Review
Debian Gnu/linux : Guide to Installation and Usage · The Wunder Library — complete classics, free to read, with narration.