Web Analytics Made Easy - Statcounter


https://www.amazon.it/dp/B0CT9YL557

We support WINRAR [What is this] - [Download .exe file(s) for Windows]

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
SITEMAP
Audiobooks by Valerio Di Stefano: Single Download - Complete Download [TAR] [WIM] [ZIP] [RAR] - Alphabetical Download  [TAR] [WIM] [ZIP] [RAR] - Download Instructions

Make a donation: IBAN: IT36M0708677020000000008016 - BIC/SWIFT:  ICRAITRRU60 - VALERIO DI STEFANO or
Privacy Policy Cookie Policy Terms and Conditions
a2 --- Installing GNU/Linux

[next] [previous] [top] [last] [contents] [indice ridotto] [violazione licenza] [translators] [docinfo] [indice analitico] [tome] [part]


Chapter 749.   Installing GNU/Linux

(1)

The installation of GNU/Linux is as difficult as it is the installation of any new operating system; i.e. when you must accept that you cannot use the usual tools that you have used for a long time. In this chapter we refer to the installation of GNU/Linux in an i386 (or larger) computer by starting with Dos tools.

749.1   Choice of the distribution

Before installing GNU/Linux you must obtain a distribution of this operating system. The are many GNU/Linux distributions; this is surely a positive symptom about the importance of this operating system. The problem for the user is which one to choose.

It is very difficult give general advices on a specific distribution, because no one is better than the other ones; each of them interprets in a specific way the user requirements, by stressing the importance of some of them and by give less importance to some other ones. Usually, if you want to use GNU/Linux in a systematic way, you should try a few distributions before deciding which one is better suited to your requirements.

In the past, the choice of a distribution depended on the diffulties to obtain them; often one started to use GNU/Linux with a CD-ROM enclosed in some book or magazine, since a direct download from the Internet was difficult. Today many specialised magazines publish with greater frequency the more common GNU/Linux distributions; moreover it is possible to purchase them easily by credit card on the Internet, from companies specialised in the distribution of CD-ROMs, for an average cost of 2 USD (US Dollars) per CD-ROM. It is useful to mention the more common distributions, by listing some of their characteristics.

749.1.1   ZipSlack

The ZipSlack distribution is a reduced version of the Slackware distribution, described later, which can be easily installed within an Dos-FAT file system. It can be obtained from the URI <http://mirror.switch.ch/ftp/mirror/slackware/slackware-current/zipslack/>, in addition to other mirror sites and from CD-ROM reproductions of the normal Slackware distribution. Some characteristics are the following:

  • it is suitable for users who normally use Dos or MS-Windows, do not want to have a normal installation of a standard GNU/Linux system, but wish to learn this operating system;

  • it allows to install the packages of the Slackware distribution.

749.1.2   Red Hat

The GNU/Linux Red Hat distribution can be obtained from the URI <http://distro.ibiblio.org/pub/linux/distributions/redhat/>, in addition to other mirror sites and from CD-ROM reproductions. Some characteristics are the following:

  • it is suitable for users with little knowledge of the Unix systems -- it allows to choose an almost automatic installation mode, in which the user does not need to choose the application packages;

  • The distribution packages are archived in the RPM format (Red Hat package manager) and their management is relatively simple;

  • at the end of the installation, the system has already a good starting configuration, including small things for the less experienced user;

  • the version published directly by Red Hat could contain some commercial applications with a single licence; therefore, if you want to install GNU/Linux on multiple machines, you should pay attention to exclude these programs.

749.1.3   SuSE

The SuSE GNU/Linux distribution can be obtained from the URI <ftp://ftp.suse.com/pub/suse/>, in addition to mirror sites and reproductions on CD-ROM.

The SuSE distribution started as a German variant of the Slackware distribution andt even today there are still similarities, even if currently it uses the RPM package management software. Some characteristics are as follows:

  • it is suitable for users with little knowledge of Unix systems;

  • the program for the installation and configuration is very sophysticated;

  • the archives of the distribution packages are in RPM format (Red Hat package manager) and their management is relatively simple;

  • at the end of the installation, the system has already a good starting configuration;

  • the version published directly by SuSE could contain some commercial applications with a single licence; therefore, if you want to install GNU/Linux on multiple machines, you should pay attention to exclude these programs.

749.1.4   Slackware

The Slackware GNU/Linux distribution can be obtained from the URI <http://distro.ibiblio.org/pub/linux/distributions/slackware/>, in addition to mirror sites and reproductions on CD-ROM. This is the first distribution that is relatively 'simple' to install and for this reason has contributed to the expansion of this operating system in the first few years of its life. Some characteristics are as follows:

  • it is a distribution suitable for users who do not have a good knowledge of Unix systems, however, the installation is a bit complex and can discourage the unexperienced user;

  • it allows the installation on a UMSDOS file system, i.e a partition already used for Dos;

  • it does not include a system for the change management: the user often risks to leave around files that are not used any more and there are not dependencies checks.

749.1.5   Debian

The Debian GNU/Linux distribution can be obtained from the URI <http://ftp.it.debian.org/debian/>, in addition to other mirror sites and reproductions on CD-ROM.

This distribution has been developed by a large number of voluntary people with an organization that makes their coordination easier. A very important aspect of their distribution policy is the attention to the licenses and other legal restrictions in the western countries; for this reason each package, in addition to always including information on the license , receives also a general classification that allows to understand the level of freedom or the restrictions involved in its installation. Some characteristics are as follows:

  • it is suitable to users with a good knowledge of the Unix systems, whereas the beginner might have difficulty to install it;

  • the archives of the distribution packages are in the Debian format (.deb) and the system to manage them is very efficient;

  • since the system used to manage the Debian packages is very complex, the program that controls the installation of the packages is complex to use as well.

749.2   Cheap reproductions of the GNU/Linux distributions

The commercial GNU/Linux distributions, such as Red Hat and SuSE, are sold directly from the production companies, together with specific documentation and some form of support. However it is possible to obtain these and other GNU/Linux distributions at lower prices from companies that specialise in the masterisation of CDs. By working in a legal way, they download the materials from the Internet and distribute them without any type of technical support. The following companies reproduce CD-ROMs for an average price of 2 USD per unit:

It is also possible to search the <http://www.linux.org/vendor/retailer/distribution.html>.

749.3   i386 hardware

As already mentioned before in this document, the GNU/Linux distributions targeted to the i386 hardware can work only with an x386 or higher processor. The main limit is the RAM memory that should be at least 16 Mbytes to install a minimum system without support for the X graphical system. As GNU/Linux evolves, its executables become heavier and the system requires more and more resources. This means that currently a minimum configuration requires a 486-66 with at least 32 Mbytes of RAM memory.

Theoratically, it is still possible to install GNU/Linux without X by having only 8 Mbytes of RAM memory, but it is a difficult operation. if your circumstances cause you to try an installation of this type, it is better to use an older GNU/Linux distribution, possibly one of those that used the kernel 1.0.x, or at least with the A.out binaries. Those old distributions can still be found as appendixes of the first few books on GNU/Linux.

Before installing any operating system, it is always necessary to collect as much information as possible on the installed hardware. The tables 749.1, 749.2 and 749.3, show the common resource usage of the most common components. This inventory is useful to determine which resources are available if you need to add a new component.

Table 749.1. Common usage of IRQ addresses in the i386 architecture computers.

IRQ Reserved Standard Possible
0 Timer
1 Keyboard
2/9 LPT3:
3 COM2: COM4:
4 COM1: COM3:
5 LPT2:
6 Diskette control unit
7 LPT1:
8 Clock
10
11
12 Mouse PS/2
13 Mathematical coprocessor
14 ATA (IDE) Control unit
15 Secondary ATA (IDE) Control unit

Table 749.2. Common usage of the DMA channels in the i386 architecture computers.

DMA Channel Normal usage Possible
1
2 Control unit of the diskettes (1 and 2)
3 Control unit of the diskettes (3 and 4)
4 DMA Control unit

Table 749.3. Common usage of the i-o addresses from 00016 to 3FF16 in the i386 architecture computers.

Hexadecimal address Normal usage
from 000016 to 001F16 DMA1 Control unit
from 002016 to 003F16 PIC1 (Programmable interrupt controller)
from 004016 to 005F16 Timer
from 006016 to 006F16 Keyboard
from 007016 to 007F16 RTC (Real time clock)
from 008016 to 009F16 dma page reg
from 00A016 to 00BF16 PIC2 (Programmable interrupt controller)
from 00C016 to 00DF16 DMA2 Control unit
from 00E016 to 00EF16
from 00F016 to 00FF16 NPU (Mathematical coprocessor)
from 010016 to 017616
from 017016 to 017716 ATA1 secondary (control unit for ATA disks)
from 017816 to 01EF16
from 01F016 to 01F716 ATA0 primary (control unit for ATA disks)
from 01F816 to 01FF16
from 020016 to 020F16
from 021016 to 021F16
from 022016 to 022F16
from 023016 to 023F16
da 024016 a 024F16
from 025016 to 025F16
from 026016 to 026F16
from 027016 to 027716
from 027816 to 027F16 LPT(2) (Printer port)
from 028016 to 028F16
from 029016 to 029F16
from 02A016 to 02AF16
from 02B016 to 02BF16
from 02C016 to 02CF16
from 02D016 to 02DF16
from 02E016 to 02E716
from 02E816 to 02EF16 COM4: (Serial port)
from 02F016 to 02F716
from 02F816 to 02FF16 COM2: (Serial port)
from 030016 to 031F16 Ethernet NE2000
from 032016 to 032F16
from 033016 to 033F16
from 034016 to 034F16
from 035016 to 035F16
from 036016 to 036F16
from 037016 to 037516 Control unit of the diskettes (third and fourth)
from 037616 to 037616 ATA1 secondary (control unit for ATA disks)
from 037716 to 037716
from 037816 to 037F16 LPT(1) (Printer port)
from 038016 to 038F16
from 039016 to 039F16
from 03A016 to 03AF16
from 03B016 to 03BF16
from 03C016 to 03CF16 EGA/VGA
from 03D016 to 03DF16 CGA/EGA/VGA in the color video mode
from 03E016 to 03E716
from 03E816 to 03EF16 COM3: (Serial port)
from 03F016 to 03F516 Diskettes (First and second unit) control unit
from 03F616 to 03F616 ATA0 primary (control unit for ATA disks)
from 03F716 to 03F716
from 03F816 to 03FF16 COM1: (Serial port)

If you have 8 bit cards (those that use only the first part of an ISA slot), it is possible to use only the IRQ addresses lower than 10.

The parallel port situation is a bit special: the Dos operating system assigns the names LPT1:, LPT2: and LPT3: according to a search on the possible I/O addresses. It scans the addresses 3BC16, 37816 and 27816. The first port that is found becomes LPT1: and so on for the other ones.

749.4   Device names of the storage units

GNU/Linux uses well ordered names for the device files, but these can be confusing for people coming from the Dos experience. The table 749.4 shows a list of some device file names that refer to a storage unit.

Table 749.4. List of device file names used for a storage unit.

Name Description Dos
/dev/fd0 first diskette unit A:
/dev/fd0u1440 first diskette unit for diskettes of 1 440 Kbytes A:
/dev/fd1 second diskette unit B:
/dev/fd1u1440 second diskette unit for diskettes of 1 440 Kbytes B:
/dev/hda first ATA (IDE) hard disk
/dev/hdb second ATA (IDE) hard disk (or CD-ROM)
/dev/hdc third ATA (IDE) hard disk (or CD-ROM)
/dev/hdd fourth ATA (IDE) hard disk (or CD-ROM)
/dev/sda first SCSI disk
/dev/sdb second SCSI disk
/dev/sdc third SCSI disk
...

The disks, except the 'diskettes' (or floppy), are divided into partitions, which have a reference with a number at the end of the name. For instance, /dev/hda1 is the first partition of the first ATA disk, /dev/sda2 is the second partition of the first SCSI disk.

The distinction among the names used for the primary partitions and the logical partitions contained in the extended ones, can create additional confusion. Generally it is better not to use logical partitions, unless it is a real necessity. For example if you use the first ATA hard disk, the first four normal partitions (primary and extended) have names from /dev/hda1 to /dev/hda4, whereas the logical partitions are given names from /dev/hda5 onwards.

749.5   Preparation

Before installing GNU/Linux it is necessary that the target computer is ready. If Dos has already been installed, with or without MS-Windows, it is advisable to keep it until you have become completely independent from that environment.

When one installs GNU/Linux actually there are two main possibilities about its destination: the usage of a file system of type Second-extended (Ext2 o Ext3) in a dedicated partition, or the usage of the file system of type UMSDOS which allows to share the existing Dos-FAT file system without altering the data that it contains.

The former solution requires a higher commitment, but it is the best one on a technical point of view: it requires the preparation of a partition for the exclusive usage by GNU/Linux. The latter one is a faster solution suitable for people who do not want to commit too much to GNU/Linux: you can create a directory C:\LINUX\ which is the beginning of the Linux directory (and file) structure and which is eventually recognised and correctly managed by the GNU/Linux system, even if it respects the rules of the 8.3 Dos names. Since the latter solution, does not require the preparation of a dedicated partition for GNU/Linux, might look the best one for everybody. Actually it is suitable only for people who want to see how GNU/Linux works, but it is not suitable for people who want to actually use it.(2)

If you decide to take GNU/Linux seriously you should prepare a partition or multiple partitions for its exclusive usage, by taking space away from what had been previously installed on the disk. To insure that no data are lost, you should start with a good back-up copy.

There are many ways to make a back-up copy of the data on the disk. It is important to remember that it's not enough to have a back-up of the data, you must also be able to reload the saved data when the system is restarted. It is therefore necessary to have a system boot disk with all the necessary utilities. We assume that you know how to restore your operating system.

To reduce the size of an existing FAT partition, you can use the following programs, usable under Dos:

In order to reduce the size of a partition you should check that it does not contain a large amount of data and especially that there is some free space at the end of the partition. Usually the problem is solved by a defragmentation program that compacts all data in the initial part of the partition.(5)

749.5.1   Boot diskettes and image-file

Before starting the installation of any GNU/Linux distribution, you must be in a condition to start the installation program. Usually it is necessary to reproduce one or more diskettes that allow to start up a minimum GNU/Linux system that contains what is needed for this purpose. These diskettes are normally distributed in the format of image-files, which must be copied on an already initialised diskette.(6)

Normally, to start a minimum GNU/Linux system it is necessary to have two diskettes: one with mainly the kernel and the second one with the programs. Theoretically both of them might be stored in a single diskette, but this becomes more and more difficult because the programs of GNU/Linux become more and more large.

The first diskette, i.e. that which contains the kernel, is used to start the system which then requests the user to replace the diskette with the second one when it has been loaded into memory. The program diskette normally contains a compressed image of a larger file system. In this context, the 'image' is a file containing the file system.

A diskette of 1.4 Mbytes can be seen as a unique file. When a diskette is transferred without changes to a unique file, this file is called an image of the diskette. It is possible to create virtual diskettes with more space, e.g. 4 Mbytes, by working directly on their images. The kernel can use these compressed images, by expanding them in memory, within a RAM disk.

Currently, almost all available diskettes containing an emergency minimum system, are compressed images of larger disks, so that the kernel must load them in a RAM disk. Therefore the use of emergency diskettes requires much RAM memory.

If you use only Dos, you can reproduce a diskette from an image-file, by using the RAWRITE.EXE program. Notice the following example on reproducing a diskette from the file BOOT.IMG.

C:> RAWRITE BOOT.IMG A:[Enter]

If you use a GNU/Linux system, there are two different possible approaches. Notice the following examples which reproduce a diskette of 1 440 Kbytes from the file boot.img.

cp boot.img /dev/fd0[Enter]

dd if=boot.img of=/dev/fd0 bs=1440k[Enter]

749.6   Partitions and file system

GNU/Linux can be installed in a single, or multiple partitions. Moreover, in most cases you should create a partition to use as virtual memory: the swap partition.

The swap partition is a partition like the other ones, which is identified and initialised in a different way. Generally it is convenient to use a size at least equal to that of the existing RAM memory, by considering that a larger size does not cause any problem, except the use of the disk space.

When you use ATA (IDE) disks of large size you should consider the position the kernel and the other start-up files. They must be found physically within the cylinder 1 024, because of BIOS limitations in the i386 computers. If a partition extends over this limit, you cannot be certain that these files exist before that position.

To avoid problems, you should create a dedicated partition, only for the start-up files (usually it is just the content of the /boot/) directory, in a physical location before the 1 024 cylinder.

749.6.1   Subdivision of the file system in multiple partitions

The file system of the GNU/Linux system, in the same way as on other Unix systems, may be subdivided in multiple parts that physically exist in different partitions, and that are united together by using mount operations. There are different good reasons for this, especially the following ones:

  • The accesses of the file system are distributed on multiple disks;

  • multiple disks of small size can be united together instead of buying a gigantic hard disk;

  • the parts of the file system which should not be changed can be stored also on CD-ROM;

  • in a local network it is possible to share data and programs by using a network file system.

You will find below a list of the typical possibilities to be used for the decomposition of a GNU/Linux file system.

  • Main partition

    The main partition must always contain the root directory (/). When the file system is decomposed, it is a unique partition.

  • Start-up partition

    If the hard disk has a number of cylinders larger then 1 024, it is absolutely necessary that the kernel and the other files used in the start-up phase are found before that limit. For this reoson, in this situation you should create a special partition in the initial part of the disk to store the /boot/ directory, which contains also the kernel file.

  • Partition dedicated to programs

    Most of the software is stored in the /usr/ directory and its content is often stored in a separate partition.

  • Partition dedicated to users

    When a system is multi-user, the content of the /home/ directory may become very large and it might be convenient to store it in a separate partition.

In addition to the above main situations, you should also consider the following possibilities.

  • Partition for temporary files

    All Unix systems use the /tmp/ directory as a generic container of temporary files. In a multi-user system, the activity within this directory may become pretty heavy. In this case, it is convenient to store its content in a separate partition to reduce the accesses on the disk that contains the main partition.

  • Partition for the sources

    The application sources usually exist in the /usr/src/ directory. If you want to manage a large quantity of sources, it is convenient to use a separate partition for this purpose.

  • Partition for local programs and files

    By convention, a GNU/Linux file system should reserve the /usr/local/ directory for the programs and files reserved to local usage. Its extension depends on specific circumstances. Generally, the /usr/ directory could exist on a read-only partition (e.g. a CD-ROM or an NFS network server. The /usr/local/ directory could exist separately to allow the installation of special programs to be used only on that single machine or on a sub-network. Usually, this approach is extended to use this directory for the installation of all programs that are not included in the used GNU/Linux distribution.

749.7   Moduli

The more sophysticated GNU/Linux distributions decompose the kernel into modules, in order to use few installation diskettes suitable to a large number of hardware configurations. Generally, these installation diskettes can easily support, without using modules, a typical hardware configuration, where the hard disk and the CD-ROM are connected to the ATA (IDE) control unit.

If you use a SCSI unit or CD-ROM units based on propietory cards, you might have difficulties. With GNU/Linux these special situations are managed by creating a specific kernel, or by adding modules to it. Often, when modules are needed, it is necessary to supply parameters suitable for the physical hardware.

749.8   Updating an existing installation

The GNU/Linux distributions that use a more or less sophysticated system to manage packages, theoratically allow to update an existing installation. In many cases this is dangerous, because sometimes the updating has not success and the system remains, partially or completely, not working.

If you really want to update a previous installation, you should start with a security back-up, unless you have a complete faith in the used distribution.

749.9   Loading the operating system after the installation

Usually, the last fundamental thing to be defined, before terminating the installation procedure, is the procedure to start the operating system. Normally the system proposes to create an emergency diskette for that specific installation and also to configureLILO (if you use the i386 architecture) to allow an automatic start-up of the system.

The creation of the emergency diskette is very important and should not be skipped if it is available, especially during the first few installations. Moreover, it is useful to keep in mind that the configuration obtained with LILO, by using the installation program, could be rather limited, therefore it is a good idea to have a boot diskette to start correctly.

When it is time to configure LILO, you might be given only the choice to install its start sector into the MBR, i.e. the first sector of the hard disk, or in the first sector of the main partition where GNU/Linux is stored. Unfortunately there are situations where these two possibilities are too limited, for your needs, therefore it is better to use a boot diskette to start the system and eventually configure LILO as you prefer.

In the simplest situation, you can just allow LILO to modify the MBR and to transfer there the start up control of GNU/Linux and other possible operating systems. If this cannot be done for some reason, you can install it in the first sector of the partition that contains GNU/Linux and use another program (called bootloader) to start it from that sector.

LILO, as other systems for the start-up of GNU/Linux, allows to enter some parameters for the kernel that might be necessary if one uses special devices that are not processed correctly, or in other similar situations. The installation program might request the entry of these additional parameters, that normally are not required.

LILO and the start-up system of GNU/Linux is described on more details in the chapter ##en-capitolo-boot##.

749.10   Tools and general concepts

You can install a GNU/Linux distribution after the preparation of partitions by using emergency diskettes which contain a minimum number of essential programs. Most GNU/Linux distributions offer an emergency diskette for this purpose.

The more common distributions can manage everything within the installation procedures, but often, in this way, the user ignores the meaning of what is done. Before installing GNU/Linux for the first time, you should learn how to use the programs for the creation and modification of partitions; moreover it is important to know how these can be initialised.

If you try to start up an emergency system, probably the diskette image that contains a minimum system is a file with the name similar to resque, but there is still a problem to choose the correct start-up diskette which might depend on the hardware characteristics of your computer. For this, it is usually sufficient to read the text files that accompany those images (README, WHICH.ONE and similar ones).

If you use the Slackware distribution, commonly used in this way, the boot disk for a generic hardware is contained in the image bootdsks.144/bare.i, which contains a kernel suitable to ATA (IDE) disks; the emergency system diskette is instead rootdsks/rescue.gz.

A system on emergency diskettes is started by starting up the computer from the boot diskette, which then loads the kernel. As soon as the kernel takes control, the user is requested to replace the diskette witj another containing the main file system. This can be done in different ways. One possible way is a request such as the following one, typical of the Slackware distribution,

VFS: Insert root floppy disk to be loaded into ramdisk and press ENTER

where you can simply change the diskette and press [Enter]. In other situations the request is made in more complex ways, by using entry forms or other approaches, as it happens with the SuSE distribution.

Once the emergency system has been started, this may produce an optional request of identificatopn by using a traditional access procedure (the login). If this happens, you should normally enter the user-name root, which probably does not require any password.

From now on it should be possible to use the programs for the definition and initialisation of partitions.

749.10.1   Manual preparation of partitions

Basically there are two programs to define the partitions: fdisk and cfdisk. The first uses an elementary approach, by command lines, whereas the second uses the full screen and shows how the situation is changing. Even if you wouldn't think so, the first program is the best one for a beginner, because there are no assumptions, whereas the second program assumes that some concepts on the disk partitions are clear.

You will find below how the old fdisk is used, (7) with a complete example. Even if this program is disappearing from the emergency diskettes of many distributions, it is still the simplest one to describe; moreover learning how to use helps understanding other alternative programs.

fdisk [device]

fdisk receives as an argument the name of the full fixed (or removable) disk device, since it acts on the partitions and not on their content. If we assume to work on the first ATA (IDE), which contains a reduced Dos-FAT partition that we want to reduce to find some space for GNU/Linux, the fdisk command can be started as follows:

fdisk /dev/hda[Enter]

fdisk replies with a particular prompt:

Command (m for help)

fdisk accepts commands made up by a single letter and you can see a list of them by using the command m.

m[Enter]

Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatiblity flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   p   print the partition table
   q   quit without saving changes
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

The should start by checking the initial situation of the hard disk; the command p allows to view the list of existing partitions:

p[Enter]

Disk /dev/hda: 16 heads, 63 sectors, 1024 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1   *        1        1       82    41296+   6  DOS 16-bit >=32M
/dev/hda2           83       83     1024   474768    6  DOS 16-bit >=32M

To obtain the above situations of two Dos partitions, the FIPS.EXE had been used: the first one is the used Dos partition, the second one is empty and will be replaced. We decide therefore to remove the second partition.

d[Enter]

Partition number (1-4):

2[Enter]

Now only a single partition exists.

p[Enter]

Disk /dev/hda: 16 heads, 63 sectors, 1024 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1   *        1        1       82    41296+   6  DOS 16-bit >=32M

To add a swap partition, we can use the command n which creates a new partition.

n[Enter]

Command action
   e   extended
   p   primary partition (1-4)

In this instance we choose a primary partition.

p[Enter]

Partition number (1-4):

Since this is the second partition, we enter the number two.

2[Enter]

The systems prompts the entry of the first cylinder to be assigned to the new partition. It then proposes a minimum and maximum value.

First cylinder (83-1024):

83[Enter]

It prompts also the entry of the last cylinder, or of the minimum partition size. In this instance we choose a minimum size of 32 Mbytes.

Last cylinder or +size or +sizeM or +sizeK (83-1024):

+32M[Enter]

To view the result, we use again the command p.

p[Enter]

Disk /dev/hda: 16 heads, 63 sectors, 1024 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1   *        1        1       82    41296+   6  DOS 16-bit >=32M
/dev/hda2           83       83      148    33264   83  Linux native

As you can see, there is now a new partition of type Linux-native of 33 264 blocks with a size of 1 024 bytes. The Linux-native partition is suitable for a file system Second-extended (Ext2 or Ext3) and not for the memory swap, therefore it is necessary to change the type of partition.

t[Enter]

Partition number (1-4):

2[Enter]

Hex code (type L to list codes):

As suggested, it is advisable to view the list of codes.

L[Enter]

 0  Empty            9  AIX bootable    75  PC/IX           b7  BSDI fs
 1  DOS 12-bit FAT   a  OS/2 Boot Manag 80  Old MINIX       b8  BSDI swap
 2  XENIX root      40  Venix 80286     81  Linux/MINIX     c7  Syrinx
 3  XENIX usr       51  Novell?         82  Linux swap      db  CP/M
 4  DOS 16-bit <32M 52  Microport       83  Linux native    e1  DOS access
 5  Extended        63  GNU HURD        93  Amoeba          e3  DOS R/O
 6  DOS 16-bit >=32 64  Novell Netware  94  Amoeba BBT      f2  DOS secondary
 7  OS/2 HPFS       65  Novell Netware  a5  BSD/386         ff  BBT
 8  AIX

The code for a swap partition is 8216 and this is what we choose.

82[Enter]

Changed system type of partition 2 to 82 (Linux swap)

p[Enter]

Disk /dev/hda: 16 heads, 63 sectors, 1024 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1   *        1        1       82    41296+   6  DOS 16-bit >=32M
/dev/hda2           83       83      148    33264   82  Linux swap

If you want to create a new partition, you can do again what we have seen above.

n[Enter]

Command action
   e   extended
   p   primary partition (1-4)

Also in this instance we select a primary partition type.

p[Enter]

Partition number (1-4):

Since this is the third partition, we enter the number three.

3[Enter]

The system prompts the entry of the new partition first cylinder and proposes the range of possible values.

First cylinder (149-1024):

149[Enter]

It prompts the entry of the last cylinder, or the minimum partition size. In this case we choose the maximum size by selecting the last cylinder.

Last cylinder or +size or +sizeM or +sizeK (149-1024):

1024[Enter]

To view the results, you can again use the command p.

p[Enter]

Disk /dev/hda: 16 heads, 63 sectors, 1024 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1   *        1        1       82    41296+   6  DOS 16-bit >=32M
/dev/hda2           83       83      148    33264   82  Linux swap
/dev/hda3          149      149     1024   441504   83  Linux native

Finally to store the changes, you can use the command w. If instead you prefer to back-track, you can use the command q which terminates the program without writing the previous selections.

w[Enter]

The partition table has been altered!
...
Syncing disks.
...

In a real situation you should probaly use multiple partitions for GNU/Linux. In this situation it might be necessary to use extended partitions, within which logical partitions can be created. If we assume to manage the /dev/hda3 partition as an extended one and then to add two logical partitions within it, we could proceed as explained below.

n[Enter]

Command action
   e   extended
   p   primary partition (1-4)

In this instance we create an extended partition to be subdivided in a similar way to what we have already seen during the creation of a primary partition.

e[Enter]

Partition number (1-4):

3[Enter]

First cylinder (149-1024):

149[Enter]

Last cylinder or +size or +sizeM or +sizeK (149-1024):

1024[Enter]

p[Enter]

Disk /dev/hda: 16 heads, 63 sectors, 1024 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1   *        1        1       82    41296+   6  DOS 16-bit >=32M
/dev/hda2           83       83      148    33264   82  Linux swap
/dev/hda3          149      149     1024   441504    5  Extended

Eventually, the extended partition must be subdivided . We assume to create two logical partitions; one of about 10 Mbytes and the second one for the remaining space.

n[Enter]

Command action
   l   logical (5 or over)
   p   primary partition (1-4)

We select the letter 'l' , to request the creation of a logical partition.

l[Enter]

Differently from what we have seen with the primary partitions, the partition number is no more requested.

First cylinder (149-1024):

149[Enter]

Last cylinder or +size or +sizeM or +sizeK (149-1024):

169[Enter]

n[Enter]

Command action
   l   logical (5 or over)
   p   primary partition (1-4)

l[Enter]

First cylinder (170-1024):

170[Enter]

Last cylinder or +size or +sizeM or +sizeK (170-1024):

1024[Enter]

p[Enter]

Disk /dev/hda: 16 heads, 63 sectors, 1024 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1   *        1        1       82    41296+   6  DOS 16-bit >=32M
/dev/hda2           83       83      148    33264   82  Linux swap
/dev/hda3          149      149     1024   441504    5  Extended
/dev/hda5          149      149      169    10552   83  Linux native
/dev/hda6          170      170     1024   430888   83  Linux native

749.10.2   Use of cfdisk

After the previous relatively detailed description of how fdisk works, we give also some details on the usage of cfdisk. (8) The picture 749.39 shows how it appears when it is started, in the same initial conditions previously described for fdisk. Notice that initially the graphic button <Bootable> and also the first item in the partition list are selected.

Picture 749.39. Initial screen of cfdisk after its start.

                                cfdisk 0.8l

                            Disk Drive: /dev/hda
            Heads: 16   Sectors per Track: 63   Cylinders: 1024

    Name        Flags     Part Type  FS Type          [Label]      Size (MB)
 ----------------------------------------------------------------------------
**  hda1        Boot       Primary   DOS FAT16 (big)  [           ]    40.33 **
    hda2                   Primary   DOS FAT16 (big)  [           ]   463.64












     >Bootable<  [ Delete ]  [  Help  ]  [Maximize]  [ Print  ]
     [  Quit  ]  [  Type  ]  [ Units  ]  [ Write  ]

                 Toggle bootable flag of the current partition

The graphical buttons can be selected by using the arrow keys and then by pressing [Enter] when the target button has been selected. As an alternative, you can directly enter the initial letter of these buttons. Some functions of the graphical buttons depend on the item selected in the partition list; actually, you should first position the selection bar on the target item and then select the graphical button of a function that that should be applied to it. The same approach is valid also for the creation of a new partition, but, in this case, you must move the selection bar under the last existing item.

We start by deleting the second partition, then by eventually creating the swap partition for the virtual memory and the partition for the file system of GNU/Linux:

  1. We select the item hda2 and then press the graphical button <Delete> to delete the selected partition;

  2. We can leave the selection bar on the empty space and the select the graphical button <Primary>, which has been displayed in the meantime (as you can see on the picture 749.40);

  3. The program prompts the entry of the size expressed in megabytes (simbol: Mbyte) and we enter the value 32, followed by [Enter];

  4. We change the partition type, by selecting the button <Type> and by eventually entering the value 8216 (followed by [Enter]);

  5. We move the selection bar to the empty space below and select the graphical button <Primary>, to create another partition for the remaining space (it is sufficient to confirm the value proposed by the program).

Picture 749.40. How cfdisk appears when there is free space on the disk.

                                cfdisk 0.8l

                            Disk Drive: /dev/hda
            Heads: 16   Sectors per Track: 63   Cylinders: 1024

    Name        Flags     Part Type  FS Type          [Label]      Size (MB)
 ----------------------------------------------------------------------------
    hda1        Boot       Primary   DOS FAT16 (big)  [           ]    40.33
**  hda2                   Pri/Log   Free Space                       463.64 **












     >Primary<  [Logical]  [Cancel ]


                         Create a new primary partition

Figura 749.41. L'aspetto di cfdisk alla fine.

                                cfdisk 0.8l

                            Disk Drive: /dev/hda
            Heads: 16   Sectors per Track: 63   Cylinders: 1024

    Name        Flags     Part Type  FS Type          [Label]      Size (MB)
 ----------------------------------------------------------------------------
    hda1        Boot       Primary   DOS FAT16 (big)  [           ]    40.33
    hda2                   Primary   Linux Swap                        32.48
**  hda3                   Primary   Linux ext2                       431.15 **











     >Bootable<  [ Delete ]  [  Help  ]  [Maximize]  [ Print  ]
     [  Quit  ]  [  Type  ]  [ Units  ]  [ Write  ]

                 Toggle bootable flag of the current partition

We do not present the case of an extended partition with logical partitions. However you should consider that it is not possible to define explicitely an extended partition; you should request directly the logical partitions, for which the corresponding extended partition is created automatically, but it is not presented in partition list.

749.10.3   Manual initialisation of partitions and activation of the swap memory

Generally, the procedure used for the installation of a GNU/Linux distribution, once the partitions have been defined, processes also its initialisation and the activation of the swap memory. In some instances it might be better to do all this manually. If we continue the previous example, in which we created a partition for the /dev/hda2 device, one for the swap of the virtual memory and another for the /dev/hda3 device for the complete installation of the system, we can proceed as described below.

Usually it is better to start with the swap partition; it can be initialised by using mkswap. (9) To insure that the operation is performed correctly, it is useful to enter the size in blocks of the partition; in our example, there are 33 264 blocks of 1 024 bytes:

mkswap -c /dev/hda2 33264[Enter]

If necessary (usually when one has little RAM memory), it is possible to activate the virtual memory immediately, i.e to use this swap partition that has just been created, without waiting for the installation procedure to do that. This can be done by using the program swapon.

swapon /dev/hda2[Enter]

After the swap partition, one can continue with those used for the file system, i.e. those used to install the operating system. The Linux-native partitions must be initialised by using the program mke2fs (10) (or mkfs.ext3). The last number entered on the command line represents the size in blocks of 1 024 bytes. As we have suggested for the swap partition, it is advisable to enter this information.

mke2fs -j -c /dev/hda3 441504[Enter]

Only primary or logical partitions must be initialised. It is not possible to initialise an extended partition to initialise at the same time its logical partitions.

After the command, the partition contains a file system Second-extended, in this instance precisely Ext3.

749.11   References

Appunti di informatica libera 2006.01.01 --- Copyright © 2000-2006 Daniele Giacomini -- <daniele (ad) swlibero·org>, <daniele·giacomini (ad) poste·it>


1) Translation last update on 2003.09.11 from Mario Pesce <mario (ad) datamission·co·uk>.

2) By choosing a file system of type UMSDOS one implicitely accepts to use a file system of type Dos-FAT, with all its limitations and its weeknesses. Among other things, a loss of power might even cause the complete loss of all data.

3) Fips   GNU GPL

4) Presizer   no cost software, but not free

5) All this is not necessary if you want to install GNU/Linux in an existing FAT partition, by using a file system of type UMSDOS.

6) The diskettes used for this purpose should be fault free. Even if no errors are signalled during the initialisation phase, the diskettes might have problems during their usage. This could cause messages of various type , or the system could stop during the start-up. In these situations it is advisable to try again with different diskettes.

7) util-linux: fdisk   GNU GPL

8) util-linux: cfdisk   GNU GPL

9) util-linux: disk-utils   GNU GPL

10) e2fsprogs   GNU GPL


It should be possible to link to this page also with the name installing_gnu_linux.htm

[next] [previous] [top] [last] [contents] [indice ridotto] [violazione licenza] [translators] [docinfo] [indice analitico]

Valid ISO-HTML!

CSS validator!

Static Wikipedia 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Sub-domains

CDRoms - Magnatune - Librivox - Liber Liber - Encyclopaedia Britannica - Project Gutenberg - Wikipedia 2008 - Wikipedia 2007 - Wikipedia 2006 -

Other Domains

https://www.classicistranieri.it - https://www.ebooksgratis.com - https://www.gutenbergaustralia.com - https://www.englishwikipedia.com - https://www.wikipediazim.com - https://www.wikisourcezim.com - https://www.projectgutenberg.net - https://www.projectgutenberg.es - https://www.radioascolto.com - https://www.debitoformtivo.it - https://www.wikipediaforschools.org - https://www.projectgutenbergzim.com