Installation alternatives/it

Questa guida è pensata per essere un repository dei metodi di installazione alternativi di Gentoo, per coloro con necessità di installazione speciali come una mancanza del CD-ROM o un computer che non può avviarsi tramite CD.

Riguardo questa guida
Se il metodo di installazione standard tramite avvio dal CD di installazione non funziona (o è impossibile da utilizzare, o non piace proprio), si può trovare aiuto qui. Questa guida serve per fornire un repository di tecniche di installazione alternative di Gentoo Linux a coloro che ne hanno bisogno. O, se si preferisce, funge da luogo in cui inserire metodi strambi di installazione. Se c'è un metodo di installazione che è ritenuto di aiuto, o che il lettore ritiene essere una maniera interessante con cui installare Gentoo, non esistare a scrivere qualcosa qui, in questo articolo.

Avvio del CD di installazione con Smart BootManager
Scaricare Smart BootManager disponibile su http://btmgr.sourceforge.net/download.html. Sono disponibili i sorgenti Linux o i formati binari e le versioni windows in formato, così come molti pacchetti lingua. Tuttavia, il metodo preferito dovrebbe essere usare il formato binario, in quanto i sorgenti non si possono compilare con le versioni più recenti di NASM.

Compilare il pacchetto dai sorgenti o scaricare i binari. Ci sono diverse opzioni utilizzabili quando si crea un floppy di avvio, come mostrato sotto.

Usare per creare il floppy di avvio:

Ora inserire semplicemente il floppy nel lettore floppy del computer e il CD di installazione nel lettore CD-ROM e avviare il computer.

Comparirà la finestra di dialogo di Smart BootManager. Selezionare il CD-ROM e premere il tasto (Invio) per avviare il CD di installazione. Una volta avviato, procedere con le istruzioni di installazione normali.

Ulteriori informazioni su Smart BootManager possono essere trovate su http://btmgr.sourceforge.net/.

Introduzione
Gli utenti possono avviare altri LiveCD oltre ai CD forniti da Gentoo. In ogni caso, questi LiveCD forniscono un ambiente funzionale da usare mentre si compila ed installa Gentoo. Le istruzioni fornite qui dovrebbero funzionare in linea di principio con praticamente qualsiasi altro LiveCD.

Ci sono troppi LiveCD da elencare, ma Knoppix potrebbe essere un'opzione da provare. Fornisce una scrivania basata interamente sull'interfaccia grafica, con applicazioni per ufficio, browser di rete, e giochi per tenersi occupati. Knoppix è disponibile solamente per utenti, quindi a seconda dei requisiti utente potrebbe essere necessario usare altri LiveCD o metodi.

Installation instructions
Boot from the LiveCD. Open a terminal and run so the password can be changed. This allows to set the root password for the CD. The sshd daemon can now be configured for remote login if required. Next, creating the mount point is necessary.

At this point, the standard install documentation can be picked up at Preparing the Disks. However, when asked to mount the proc system, issue the following command instead:

When unpacking the stage tarball in Unpacking the stage tarball, be sure to use the following command options to ensure that proper group IDs are enforced on the unpacked stage:

If Ubuntu is being used, note that is a symbolic link to. It must be bind-mounted or a tmpfs mount has to be set at this location (within the chroot path). To bind-mount the location, run the following command (before chrooting):

This is to avoid where Python sees   as broken (due to lack of ) and Portage seeing that as an error (technically Python configuration would continue and build assuming the POSIX_SEMAPHORES_NOT_ENABLED variable has been enabled but this would lead to a very undesired Python build).

Once ready to chroot into the unpacked stage in Installing Base System, a different chroot command sequence will need to be used. This ensures that the environment variables are properly setup.

Finally, know that some Portage FEATURES may not work in the LiveCD. Especially watch out for  and   values. If there are errors, try disabling some or all of the optional FEATURES.

Diskless install using PXE and kernel/initrd/squashfs from the LiveCD
This method is easier to configure than PXE boot based on iSCSI or NFS. Multiple machines can boot from the same set of images distributed via TFTP and can be easily extended to also work over HTTP or other protocol.

Some other distributions including Fedora already distribute images needed to bootstrap a live or installation CD. With Gentoo, this is not the case. Instead, users need to


 * 1) Extract kernel, initrd and squashfs from the live CD.
 * 2) Patch initrd contents.
 * 3) Merge squashfs into initrd.

Only then can a PXE based boot loader be configured that will load the images and boot into a live system.

Save the following script, make it executable and put its directory value into the PATH variable (or follow the documented steps manually).

Download the minimal installation CD. Install, make sure it serves and start it.

Run the script with the appropriate parameters.

Now the TFTP boot service is ready, so the next step is to configure a DHCP service. Setting up a DHCP server on the same machine is possible - just make sure that the booted machines are connected to it. Or just tweak the configuration of an existing router.

Example configuration for OpenWRT DHCP service follows:

Requirements
PXE (Preboot eXecution Environment) is a method for booting computers over a PXE-capable network interface (and using a PXE-supporting BIOS). In case the system does not support PXE boot from the network interface or BIOS, PXE can also be used as a boot method from block devices (like CDs or USBs). In such cases, a minimal boot environment mimics the PXE supporting network card (see also Etherboot/gPXE).

Server base setup
Create directories: The first thing to do is to create the directories where the diskless system will be stored. Create a directory called which houses a directory for each diskless client. For the remainder of this howto, the client that is being worked on will be called 'eta'.

DHCP and TFTP setup: The client will get boot information using DHCP and download all the required files using TFTP.

For dhcpd, just run (or any other DHCP server of choice). Make sure that the correct interface is selected in, and configure it accordingly. Then, add the following on.

Next configure the interface in so that it doesn't get cleared at bootup. See for more information.

For TFTP, emerge. In, put the following:

Emerge GRUB:

Once GRUB is compiled, create the diskless client's boot directory:

Original way was to copy the PXE image to the diskless client but the path does not seem to exit anymore.

Then edit its config file.

NFS is quite easy to configure. The only thing that has to be done is to add a line on the config file:

One important thing to do now is to modify the file to fit requirements.

Creating the system on the server
A next step is to reboot the server with a Gentoo installation CD (although experienced administrators can continue without if they are sufficiently versed in Gentoo installations). Follow the standard install procedure as explained in the Gentoo Handbook BUT with the following differences: when mounting the file system, execute the next step (where is the partition where the  directory was created).

Mounting any other partition is not needed as all of the files will reside in the directory.

This example uses a stage3 tarball. Mount to the diskless directory and chroot into it to continue with the install. Then follow the installation manual until kernel configuration.

When doing the of the kernel configuration, don't forget to enable the following options with the others recommended into the install guide.

Save the kernel in the chrooted (not in ) according to the pxegrub setting defined earlier. Next configure the diskless client's.

Now to prevent the client from running a filesystem check:

Install since the client will heavily depend on it:

Do not install another bootloader because there is already one - pxegrub. Simply finish the install and restart the server. Start the services that are needed to boot the new client: DHCP, TFTPD, and NFS.

Booting the new client
For the new client to boot properly, the BIOS and the network card need to be configured to use PXE as the first boot method - before CD-ROM or floppy. For help with this consult the hardware manuals or manufacturers website. The network card should get an IP address using DHCP and download the GRUB PXE image using TFTP. Then, a nice black and white GRUB bootmenu should be displayed from where users can select the kernel to boot and press the (Return) key. If everything is okay the kernel should boot, mount the root filesystem using NFS and provide a login prompt. Enjoy.

Requirements
In order to install Gentoo from an existing Linux distribution it needs to have the chroot command installed, and have a copy of the Gentoo installation or ISO that's desired to install. A network connection is highly recommended as otherwise the installation can only work with the files available in the installation media. By the way, a tarball is just a file ending in or. Let's get started!

Overview
First allocate a partition to Gentoo by resizing an existing Linux partition, mount the partition, untar the tarball to the partition that is mounted, chroot inside the pseudo-system and start building. Once the bootstrap process is done, do some final configuration on the system so as to make sure it boots, then reboot and use Gentoo.

How to make space for Gentoo?
The root partition is the filesystem mounted under. The first example shows the output of on a system. The second example uses (disk free) to see how much space there is left and how it will be resized. Note that resizing the root partition is not mandatory! Anything else supported by the resizer can be resized, but let's talk about that later.

As can be seen, the partition mounted as named  has 2.4 GB free. In this case, it was decided to be resized as to leave 400 MB of free space, therefore allocating 2 GB for Gentoo. Not bad, it could have quite some stuff installed. However, 1 GB is deemed enough for most users. So now partition this thing!

Building parted to resize partition
is extremely useful for resizing partitions. It is included on the minimal installation CD.

Look up on that page the type of file system to resize and see if can do it. If not: tough luck, some partitions might need to be destroyed to make space for Gentoo, and reinstall back. Go ahead by downloading the software and install it. In the next step, a problem arises. The Linux root partition needs to be resized, therefore a floppy disk with a minimal Linux system must be booted and to use a previously-compiled parted copied to a diskette in order to resize. If the partition can be unmounted while still running in Linux then the following steps are not needed. Just compile parted and run it on a chosen unmounted partition to resize. Here's how it was done on this system.

Get the mininux boot/root disk (a 2.4-powered mini Linux distribution on a floppy - free of charge) from http://mininux.free.fr/uk/, create a floppy as suggested in the Documentation that accompanies the software package and insert a new floppy in the drive for the next step.

Proceed with the build of parted. Download and untar the utility, and into the corresponding directory. Now run the following set of commands to build the utility and copy it to the floppy disk.

Time to reboot and resize the partition. Do this only after taking a quick look at the parted documentation on the GNU website. The resize should take under 30 minutes for the largest hard-drives, be patient. Reboot the system with the mininux boot disk (just pop it inside), and once logged in, switch the disk in the drive with the utility disk that was created above and type to have parted under. Run parted to be able to resize the partition. Once this lengthy process is done, continue with installing Gentoo. Reboot back into the old Linux system for now. The drive to operate on is the drive containing the partition that is going to be resized. For example, if the partition to be resized is, the drive is.

Once the resize has finished, boot back into the old Linux as described. Then go to The Gentoo Handbook: Preparing the Disks and follow the instructions. When chrooting, use the following command to flush the environment:

Enjoy!